API reference / Forex

Forex

Currency-pair price history and previous-day bars.

2 endpoints. Pay per call in USDC via x402 with no account, or get unlimited calls for $99/mo. Every response is shaped { ticker, data, source, as_of }.

GET/api/v1/forex/{pair}/aggregates$0.02

Forex price history: OHLC bars for a currency pair over any timespan and date range

Historical OHLCV bars for a foreign-exchange pair at the requested multiplier and timespan (minute, hour, day, week, month) between `from` and `to`. Pass the pair in the path as BASE-QUOTE, e.g. EUR-USD or USD-JPY. Use for FX charting, backtesting, and macro/rate analysis.

Example request
GET /api/v1/forex/BTC-USD/aggregates
Response type (TypeScript)
interface ForexAggregatesResponse {
  ticker: string;
  data: {
    bars: Array<{
      open: number;
      high: number;
      low: number;
      close: number;
      volume: number;
      vwap: number;
      trade_count: number;
      timestamp: string;
    }>;
    count: number;
    adjusted: boolean;
  };
  source: string;
  as_of: string;
}
Example response (click to expand)
{
  "ticker": "C:EURUSD",
  "data": {
    "bars": [
      {
        "open": 1.17293,
        "high": 1.1786,
        "low": 1.1714,
        "close": 1.1719,
        "volume": 182880,
        "vwap": 1.1743,
        "trade_count": 182880,
        "timestamp": "2026-05-01T00:00:00.000Z"
      },
      {
        "open": 1.17448,
        "high": 1.17491,
        "low": 1.1723,
        "close": 1.1725,
        "volume": 5744,
        "vwap": 1.1732,
        "trade_count": 5744,
        "timestamp": "2026-05-03T00:00:00.000Z"
      },
      {
        "open": 1.17252,
        "high": 1.17388,
        "low": 1.1679,
        "close": 1.16913,
        "volume": 224865,
        "vwap": 1.171,
        "trade_count": 224865,
        "timestamp": "2026-05-04T00:00:00.000Z"
      },
      {
        "open": 1.16912,
        "high": 1.17253,
        "low": 1.1675,
        "close": 1.17145,
        "volume": 187569,
        "vwap": 1.1694,
        "trade_count": 187569,
        "timestamp": "2026-05-05T00:00:00.000Z"
      },
      {
        "open": 1.17144,
        "high": 1.17966,
        "low": 1.171,
        "close": 1.1746,
        "volume": 235359,
        "vwap": 1.1748,
        "trade_count": 235359,
        "timestamp": "2026-05-06T00:00:00.000Z"
      },
      {
        "open": 1.17314,
        "high": 1.1788,
        "low": 1.1723,
        "close": 1.1785,
        "volume": 175303,
        "vwap": 1.1759,
        "trade_count": 175303,
        "timestamp": "2026-05-08T00:00:00.000Z"
      },
      {
        "open": 1.17475,
        "high": 1.177,
        "low": 1.17457,
        "close": 1.17669,
        "volume": 5151,
        "vwap": 1.1763,
        "trade_count": 5151,
        "timestamp": "2026-05-10T00:00:00.000Z"
      },
      {
        "open": 1.17777,
        "high": 1.1778,
        "low": 1.1721,
        "close": 1.17348,
        "volume": 177980,
        "vwap": 1.1745,
        "trade_count": 177980,
        "timestamp": "2026-05-12T00:00:00.000Z"
      },
      {
        "open": 1.17346,
        "high": 1.1742,
        "low": 1.1694,
        "close": 1.1715,
        "volume": 185295,
        "vwap": 1.1715,
        "trade_count": 185295,
        "timestamp": "2026-05-13T00:00:00.000Z"
      },
      {
        "open": 1.17155,
        "high": 1.17214,
        "low": 1.1659,
        "close": 1.16616,
        "volume": 197220,
        "vwap": 1.1697,
        "trade_count": 197220,
        "timestamp": "2026-05-14T00:00:00.000Z"
      },
      {
        "open": 1.16614,
        "high": 1.16634,
        "low": 1.1615,
        "close": 1.1623,
        "volume": 217652,
        "vwap": 1.1635,
        "trade_count": 217652,
        "timestamp": "2026-05-15T00:00:00.000Z"
      },
      {
        "open": 1.16197,
        "high": 1.16237,
        "low": 1.161,
        "close": 1.16132,
        "volume": 5505,
        "vwap": 1.1618,
        "trade_count": 5505,
        "timestamp": "2026-05-17T00:00:00.000Z"
      },
      {
        "open": 1.16137,
        "high": 1.16612,
        "low": 1.1607,
        "close": 1.16544,
        "volume": 225484,
        "vwap": 1.1637,
        "trade_count": 225484,
        "timestamp": "2026-05-18T00:00:00.000Z"
      },
      {
        "open": 1.16544,
        "high": 1.16558,
        "low": 1.15896,
        "close": 1.16066,
        "volume": 215736,
        "vwap": 1.1621,
        "trade_count": 215736,
        "timestamp": "2026-05-19T00:00:00.000Z"
      },
      {
        "open": 1.16066,
        "high": 1.16442,
        "low": 1.1581,
        "close": 1.16245,
        "volume": 225951,
        "vwap": 1.1607,
        "trade_count": 225951,
        "timestamp": "2026-05-20T00:00:00.000Z"
      },
      {
        "open": 1.16245,
        "high": 1.1636,
        "low": 1.1575,
        "close": 1.16176,
        "volume": 188718,
        "vwap": 1.1612,
        "trade_count": 188718,
        "timestamp": "2026-05-21T00:00:00.000Z"
      },
      {
        "open": 1.16175,
        "high": 1.16188,
        "low": 1.1586,
        "close": 1.16031,
        "volume": 179340,
        "vwap": 1.1606,
        "trade_count": 179340,
        "timestamp": "2026-05-22T00:00:00.000Z"
      },
      {
        "open": 1.16393,
        "high": 1.1646,
        "low": 1.16284,
        "close": 1.16417,
        "volume": 6109,
        "vwap": 1.1641,
        "trade_count": 6109,
        "timestamp": "2026-05-24T00:00:00.000Z"
      },
      {
        "open": 1.16413,
        "high": 1.1653,
        "low": 1.1629,
        "close": 1.16355,
        "volume": 136787,
        "vwap": 1.1641,
        "trade_count": 136787,
        "timestamp": "2026-05-25T00:00:00.000Z"
      },
      {
        "open": 1.1635,
        "high": 1.1645,
        "low": 1.16118,
        "close": 1.16364,
        "volume": 171791,
        "vwap": 1.1632,
        "trade_count": 171791,
        "timestamp": "2026-05-26T00:00:00.000Z"
      },
      {
        "open": 1.16361,
        "high": 1.1661,
        "low": 1.1615,
        "close": 1.16173,
        "volume": 194314,
        "vwap": 1.1638,
        "trade_count": 194314,
        "timestamp": "2026-05-27T00:00:00.000Z"
      },
      {
        "open": 1.16172,
        "high": 1.16613,
        "low": 1.1584,
        "close": 1.16521,
        "volume": 197655,
        "vwap": 1.1627,
        "trade_count": 197655,
        "timestamp": "2026-05-28T00:00:00.000Z"
      }
    ],
    "count": 22,
    "adjusted": true
  },
  "source": "x402stock",
  "as_of": "2026-06-03T01:44:00.871Z"
}
GET/api/v1/forex/{pair}/prev-close$0.01

Previous day OHLC bar for a currency pair

Open, high, low, close, volume, and VWAP for a foreign-exchange pair's most recent completed trading day. Pass the pair in the path as BASE-QUOTE, e.g. EUR-USD. One call returns one bar for a quick prior-close reference.

Example request
GET /api/v1/forex/BTC-USD/prev-close
Response type (TypeScript)
interface ForexPrevCloseResponse {
  ticker: string;
  data: {
    open: number;
    high: number;
    low: number;
    close: number;
    volume: number;
    vwap: number;
    trade_count: number;
    timestamp: string;
  };
  source: string;
  as_of: string;
}
Example response (click to expand)
{
  "ticker": "C:EURUSD",
  "data": {
    "open": 1.16352,
    "high": 1.1656,
    "low": 1.1612,
    "close": 1.16211,
    "volume": 167388,
    "vwap": 1.1639,
    "trade_count": 167388,
    "timestamp": "2026-06-02T23:59:59.999Z"
  },
  "source": "x402stock",
  "as_of": "2026-06-02T23:59:59.999Z"
}