DocsForex

Forex

Major FX pairs and crosses as six-character symbols (e.g. EURUSD). All routes live under /forex.

Forex routes follow the same REST patterns as other asset classes. All routes require an API key.

Authx-api-key headerBase path/forexWebSocketforex.quotes · forex.tradesSymbol formatEURUSD · GBPJPY
Forex endpoints provide indicative OTC-style pricing for supported currency pairs. Responses use a consistent REST shape with bid, ask, timestamp, and quote-size fields for analytics, display, and operational tooling.
GET/forex/quote/:symbol

Latest quote

Bid and ask from the aggregated FX quote cache when present; otherwise resolved via the REST aggregation path for the pair.

ParameterTypeDescription
symbolreqstringEnabled forex pair (e.g. EURUSD). Six-character concatenated pair, trimmed and uppercased before lookup. Retrieve the full list from GET /forex/symbols.
curl -sS "https://api.tickerlayer.com/forex/quote/EURUSD" \
  -H "x-api-key: <YOUR_API_KEY>"

Send runs against the live API with your account key (never exposed in the browser).

Response 200 OK

JSON
{
  "symbol": "EURUSD",
  "bid": 1.0522,
  "ask": 1.0524,
  "bid_size": 42,
  "ask_size": 37,
  "timestamp": 1743512400000
}
404 unknown symbol if the pair is not in the enabled registry.
GET/forex/trade/last/:symbol

Last trade

Most recent trade from the aggregated tape when present; when the tape snapshot is empty, price and timestamp fall back to the consolidated quote mid.

ParameterTypeDescription
symbolreqstringEnabled forex pair (e.g. EURUSD). Six-character concatenated pair, trimmed and uppercased before lookup. Retrieve the full list from GET /forex/symbols.
curl -sS "https://api.tickerlayer.com/forex/trade/last/EURUSD" \
  -H "x-api-key: <YOUR_API_KEY>"

Send runs against the live API with your account key (never exposed in the browser).

Response 200 OK

JSON
{
  "symbol": "EURUSD",
  "price": 1.0523,
  "size": 96,
  "timestamp": 1743512400000
}
size is number | null: it may occasionally be null when no lot size exists in the consolidated view—see intro.
GET/forex/snapshot/:symbol

Market snapshot

Combined bid/ask, last price, previous daily close, and derived change metrics in one normalized aggregated view.

ParameterTypeDescription
symbolreqstringEnabled forex pair (e.g. EURUSD). Six-character concatenated pair, trimmed and uppercased before lookup. Retrieve the full list from GET /forex/symbols.
curl -sS "https://api.tickerlayer.com/forex/snapshot/EURUSD" \
  -H "x-api-key: <YOUR_API_KEY>"

Send runs against the live API with your account key (never exposed in the browser).

Response 200 OK

JSON
{
  "symbol": "EURUSD",
  "bid": 1.0522,
  "ask": 1.0524,
  "bid_size": 42,
  "ask_size": 37,
  "last_price": 1.0523,
  "last_timestamp": 1743512400000,
  "prev_close": 1.0480,
  "change": 0.0043,
  "change_percent": 0.4103
}
last_size appears when a trade size is available in the consolidated snapshot; otherwise it is omitted from the payload. change_percent is null when prev_close is zero or not yet available.
GET/forex/agg/:symbol/:multiplier/:timespan/:from/:to

Aggregates — OHLCV range

Historical FX bars between two UTC calendar dates. Same interval rules, date format, and pagination as crypto and stocks.

ParameterTypeDescription
symbolreqstringEnabled public symbol for the asset: crypto pairs like BTCUSD; stocks use CC:SYMBOL (e.g. US:AAPL). Trimmed before lookup.
multiplierreqnumberInterval multiplier. Valid pairs: 1, 5, 15 with minute; 1, 4 with hour; 1 with day.
timespanreqstringminute · hour · day — case-insensitive. Other values return 400.
fromreqstringUTC date start, inclusive. Format: YYYY-MM-DD.
toreqstringUTC date end, inclusive. Format: YYYY-MM-DD. Must be ≥ from.
ParameterTypeDescription
limitnumberPage size. Default 500, max 5000.
offsetnumberZero-based row offset applied after sort. Default 0.
sortstringSort bars by timestamp t before pagination. asc or desc (default desc).
curl -sS "https://api.tickerlayer.com/forex/agg/EURUSD/1/day/2025-11-01/2025-11-30?sort=desc&limit=2" \
  -H "x-api-key: <YOUR_API_KEY>"

Response 200 OK

JSON
{
  "symbol": "EURUSD",
  "results_count": 2,
  "results": [
    { "o": 1.0500, "h": 1.0528, "l": 1.0488, "c": 1.0523, "v": 9820000000, "t": 1733011200000 },
    { "o": 1.0475, "h": 1.0505, "l": 1.0460, "c": 1.0500, "v": 8750000000, "t": 1732924800000 }
  ],
  "next_offset": 2
}
  • v may occasionally be null when no consolidated volume is published for that interval—see intro.
  • Valid pairs: 1, 5, 15 / minute; 1, 4 / hour; 1 / day.
GET/forex/agg/:symbol/prev

Previous completed daily bar

Single most-recently completed UTC daily candle for the pair.

ParameterTypeDescription
symbolreqstringEnabled forex pair (e.g. EURUSD). Six-character concatenated pair, trimmed and uppercased before lookup. Retrieve the full list from GET /forex/symbols.
ParameterTypeDescription
intervalstringOptional. 1m · 5m · 15m · 1h · 4h · 1d. Returns the most recently settled bar at that interval instead of the previous daily bar, and adds interval, bar_start, bar_end and as_of to the response. Omit for the daily bar.
curl -sS "https://api.tickerlayer.com/forex/agg/EURUSD/prev" \
  -H "x-api-key: <YOUR_API_KEY>"

Response 200 OK

JSON
{
  "symbol": "EURUSD",
  "result": {
    "o": 1.0500,
    "h": 1.0528,
    "l": 1.0488,
    "c": 1.0523,
    "v": 9820000000,
    "t": 1733011200000
  }
}
404 no bar available when the daily bar cannot be resolved yet. Pass ?interval= (1m, 5m, 15m, 1h, 4h, 1d) for the most recently settled bar at that interval instead; the response then also carries interval, bar_start, bar_end and as_of. While the market is closed the last real bar is returned, still labelled with its own bar_start.

WebSocket Streaming

Stream live quotes and trades for this asset class over the public WebSocket.

Connect
wss://stream.tickerlayer.com/?apiKey=<YOUR_API_KEY>

Available channels

Quotesforex.quotesTradesforex.trades

Subscribe example

After the connection is ready, send a JSON text frame:

Subscribe
{
  "action": "subscribe",
  "channels": [
    "forex.quotes",
    "forex.trades"
  ],
  "symbols": [
    "EURUSD",
    "GBPUSD"
  ]
}

Example message

forex.quotes
{
  "type": "quote",
  "channel": "forex.quotes",
  "asset": "forex",
  "symbol": "EURUSD",
  "bid": "1.08512",
  "ask": "1.08518",
  "bid_size": "1000000",
  "ask_size": "1000000",
  "ts": 1743512400000
}

Raw line: SYMBOL.RAW

The default forex feed is consolidated across venues, which keeps it stable for pricing, oracles and risk. For charting, backtesting and anything that has to look like a broker terminal, the raw line serves the same pairs as an unblended, single-venue tick stream: every tick as the venue printed it, real tick volume on trades, no smoothing between ticks. Same key, same channels, same message shape. Add .RAW to the pair.

subscribe
{
  "action": "subscribe",
  "channels": ["forex.quotes", "forex.trades"],
  "symbols": ["EURUSD.RAW", "GBPUSD.RAW", "XAUUSD.RAW"]
}

What is different on the raw line

  • One venue, published as received: candles built from it match what a raw-spread broker terminal shows, including the wicks.
  • forex.trades carries the venue tick volume in size; quote bid_size and ask_size are null.
  • Also served on /forex/quote, /forex/trade/last and /forex/snapshot. Historical data is available: the aggregates endpoints accept the .RAW symbol too, with candles from the same venue as the stream, with tick volume, back to 2010.
  • Coverage today: the majors, the main crosses and emerging-market pairs, and spot gold, silver, platinum and palladium. The line is new and still expanding: if a pair you chart is missing, tell us and we add it on the same line.

General WebSocket documentation

For authentication, subscribe/unsubscribe lifecycle, errors, limits, and heartbeats, see the WebSocket overview and Subscriptions.