GET
/v1/hist/forex/:pair/barsgzip requiredForex bars
Paginated OHLC bars for a forex pair, from 1-minute through monthly. Each bar carries t (Unix epoch milliseconds, UTC, marking the bucket's open time), o/h/l/c as trade 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.
- Auth
X-API-Keyheader- Format
- JSON, gzip-encoded
- Rate limits
- Per-key, see limits
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 onlyParameters
ParameterDescription
Parameter
pairrequiredstring · path- Six-character concatenated FX symbol, uppercase. Must match ^[A-Z]{6}$. Examples: EURUSD, USDJPY, GBPUSD, XAUUSD.
startrequiredstring · 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) only. Epoch milliseconds (e.g. 1746144000000) are not accepted and return 400 invalid_parameter.
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, 1d, 1w, 1mo. Default 1m. Same enum across every /hist/* bars endpoint, so a single client schema works across asset classes.
orderstring · query- Sort direction by bar time. One of: asc, desc. Default asc (oldest first), the natural order for charting and forward pagination. Pass desc to return the most recent bars first.
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.
Response fields
FieldDescription
Field
data[]array- OHLCV bars, oldest first, one per interval bucket.
data[].tint64 (epoch ms)- Bar open time, Unix epoch milliseconds, UTC.
data[].ofloat- Open price.
data[].hfloat- High price.
data[].lfloat- Low price.
data[].cfloat- Close price.
data[].vinteger- Always 0; spot FX is OTC with no canonical volume.
meta.symbolstring- Echoed pair.
meta.intervalstring- Echoed bar size.
meta.as_ofstring- When the response was produced. RFC 3339, UTC.
meta.next_cursorstring- Opaque pagination token. Pass back as cursor for the next page; absent on the last page.
Reference
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).
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}$."} - 400
invalid_parameterstart or end sent as epoch milliseconds instead of a date. Only YYYY-MM-DD or RFC3339 is accepted.
{ "error": "invalid_parameter", "message": "start must be YYYY-MM-DD or RFC3339."} - 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" }