GET
/hist/forex/:pair/barsgzip requiredForex bars
Paginated OHLC bars for a forex pair, from 1-minute through 1-hour. Each bar carries t (Unix epoch milliseconds, UTC, marking the bucket's open time), o/h/l/c as mid prices, and v always 0. Forex trades nearly 24/7 across a rolling global calendar, so all time inputs are read as UTC, with no exchange-local quirk like /hist/stocks.
Parameters
ParameterDescription
Parameter
pairrequiredstring · path- Six-character concatenated FX symbol, uppercase. Must match ^[A-Z]{6}$. Examples: EURUSD, USDJPY, GBPUSD, XAUUSD.
startstring · query- Inclusive lower bound on bar time. Required unless cursor is provided. Accepts YYYY-MM-DD (midnight UTC) or full RFC3339 (2026-05-01T00:00:00Z).
endstring · query- Inclusive upper bound on bar time. Same shape as start. Defaults to now.
intervalstring · query- Bar size. One of: 1m, 5m, 15m, 30m, 1h. Advisory. Our pipeline auto-buckets resolution based on the requested window, so meta.interval reports the actual cadence observed in the returned bars.
limitinteger · query- Bars per page. Default 1000, max 2000.
cursorstring · query- Pagination token. Opaque. Pass back the value of meta.next_cursor from the previous response verbatim. When present, overrides start.
Accept-Encodingrequiredstring · header- Must include gzip; otherwise the endpoint returns 406 gzip_required.
Example
request · shell
curl -H "X-API-Key: $KEY" -H "Accept-Encoding: gzip" --compressed \
"https://api.sifting.io/v1/hist/forex/EURUSD/bars?start=2026-05-01&end=2026-05-06&interval=1h"200OKapplication/json (gzip)
{ "data": [ { "t": 1745971200000, "o": 1.0837, "h": 1.0844, "l": 1.0831, "c": 1.0840, "v": 0 }, { "t": 1745974800000, "o": 1.0840, "h": 1.0851, "l": 1.0838, "c": 1.0848, "v": 0 } ], "meta": { "symbol": "EURUSD", "interval": "1h", "as_of": "2026-05-19T15:21:32Z", "next_cursor": "eyJzIjoxNzQ2MTQ0MDAwMDAwfQ" }}Loading runner…
First load onlyReference
Result shapes by pair stateDescription
Result shapes by pair state
- Known pair, bars in range
- 200 OK with a populated data array.
- Known pair, empty window
- 200 OK with data: [].
- Unknown pair
- 404 not_found (pair outside our coverage).
Per-bar fieldsDescription
Per-bar fields
- t
- Bar open time, Unix epoch milliseconds, UTC.
- o, h, l, c
- Open, high, low, close.
- v
- Always 0 (spot FX is OTC, no canonical volume).
Coverage todayDescription
Coverage today
- Reliable
- Major pairs (EURUSD, USDJPY, GBPUSD, USDCHF, AUDUSD, USDCAD, NZDUSD) are correct out of the box.
CachingDescription
Caching
- Settled windows (end ≥ 7 days ago)
- Cached server-side for 30 days.
- Recent / in-progress windows
- Cached server-side for 5 minutes.
- Edge
- Cache-Control: no-store on every response. Clients always fetch fresh server data.
Error responses
StatusCodeMeaning
- 404
not_foundPair is outside our coverage.
{ "error": "not_found", "message": "Pair not found."} - 400
invalid_parameterMalformed pair, interval, start, end, or cursor.
{ "error": "invalid_parameter", "message": "pair must match ^[A-Z]{6}$."} - 406
gzip_requiredHeavy endpoint called without Accept-Encoding: gzip.
{ "error": "gzip_required" } - 503
historical_unavailableForex historical data is not configured on this deployment.
{ "error": "historical_unavailable" } - 503
upstream_rate_limitedOur aggregation pipeline hit its rate limit. Try again shortly.
{ "error": "upstream_rate_limited" }