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.
/forex/quote/:symbolLatest quote
Bid and ask from the aggregated FX quote cache when present; otherwise resolved via the REST aggregation path for the pair.
Path parameters
| Parameter | Type | Description |
|---|---|---|
| symbolreq | string | Enabled forex pair (e.g. EURUSD). Six-character concatenated pair, trimmed and uppercased before lookup. Retrieve the full list from GET /forex/symbols. |
Request
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
{
"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./forex/trade/last/:symbolLast 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.
Path parameters
| Parameter | Type | Description |
|---|---|---|
| symbolreq | string | Enabled forex pair (e.g. EURUSD). Six-character concatenated pair, trimmed and uppercased before lookup. Retrieve the full list from GET /forex/symbols. |
Request
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
{
"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./forex/snapshot/:symbolMarket snapshot
Combined bid/ask, last price, previous daily close, and derived change metrics in one normalized aggregated view.
Path parameters
| Parameter | Type | Description |
|---|---|---|
| symbolreq | string | Enabled forex pair (e.g. EURUSD). Six-character concatenated pair, trimmed and uppercased before lookup. Retrieve the full list from GET /forex/symbols. |
Request
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
{
"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./forex/agg/:symbol/:multiplier/:timespan/:from/:toAggregates — OHLCV range
Historical FX bars between two UTC calendar dates. Same interval rules, date format, and pagination as crypto and stocks.
Path parameters
| Parameter | Type | Description |
|---|---|---|
| symbolreq | string | Enabled public symbol for the asset: crypto pairs like BTCUSD; stocks use CC:SYMBOL (e.g. US:AAPL). Trimmed before lookup. |
| multiplierreq | number | Interval multiplier. Valid pairs: 1, 5, 15 with minute; 1, 4 with hour; 1 with day. |
| timespanreq | string | minute · hour · day — case-insensitive. Other values return 400. |
| fromreq | string | UTC date start, inclusive. Format: YYYY-MM-DD. |
| toreq | string | UTC date end, inclusive. Format: YYYY-MM-DD. Must be ≥ from. |
Query parameters
| Parameter | Type | Description |
|---|---|---|
| limit | number | Page size. Default 500, max 5000. |
| offset | number | Zero-based row offset applied after sort. Default 0. |
| sort | string | Sort bars by timestamp t before pagination. asc or desc (default desc). |
Request
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
{
"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
}vmay 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.
/forex/agg/:symbol/prevPrevious completed daily bar
Single most-recently completed UTC daily candle for the pair.
Path parameters
| Parameter | Type | Description |
|---|---|---|
| symbolreq | string | Enabled forex pair (e.g. EURUSD). Six-character concatenated pair, trimmed and uppercased before lookup. Retrieve the full list from GET /forex/symbols. |
Query parameters
| Parameter | Type | Description |
|---|---|---|
| interval | string | Optional. 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. |
Request
curl -sS "https://api.tickerlayer.com/forex/agg/EURUSD/prev" \
-H "x-api-key: <YOUR_API_KEY>"Response 200 OK
{
"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.
wss://stream.tickerlayer.com/?apiKey=<YOUR_API_KEY>Available channels
Subscribe example
After the connection is ready, send a JSON text frame:
{
"action": "subscribe",
"channels": [
"forex.quotes",
"forex.trades"
],
"symbols": [
"EURUSD",
"GBPUSD"
]
}Example message
{
"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.
{
"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.tradescarries the venue tick volume insize; quotebid_sizeandask_sizearenull.- Also served on
/forex/quote,/forex/trade/lastand/forex/snapshot. Historical data is available: the aggregates endpoints accept the.RAWsymbol 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.