Get FX spot rates
Fetches daily FX spot rates between two currencies using official central-bank reference rates.
Path Parameters:
- base: Base currency code (e.g., AUD, USD).
- quote: Quote currency code (e.g., USD, EUR).
Query Parameters:
-
start_date: Optional. Start date YYYY-MM-DD. Defaults to 365 days ago.
-
end_date: Optional. End date YYYY-MM-DD. Defaults to today.
-
indicators: Optional. Comma-separated list of technical indicators to compute from the spot-rate series and include in the response. Pass all to include every supported indicator. Supported values: adx_14, atr_14, bollinger_bands, cci_20, donchian_20, ema_12, ema_20, ema_200, ema_26, ema_50, macd, macd_histogram, macd_signal, rsi_14, sma_20, sma_200, sma_50, stochastic_14_3, williams_r_14, all.
Daily reference OHLC:
- On qualifying dates, data[] also includes open, high, low, and close built from timestamped eligible reference observations. These are reference_observation_ohlc bars, not executable-market candles. Rows without at least four observations omit the OHLC fields.
FX source and derivation metadata:
- FX values are official reference rates collected by FXMacroData. USD-quoted pairs are the base series; inverse and cross pairs are derived from those legs when the publisher does not provide the requested pair directly.
- Responses include pair_metadata and row-level data[].source with direct_available, inverse_available, is_derived, derived_from_inverse, derived_from_cross, derived_from_source_legs, derivation_method, anchor_currency, source_pair, source_legs, and pair_consistency_check.
- Upstream FX source priority is BIS XRU daily USD exchange rates where available, then official national-bank daily sources, explicitly labelled EUR/CAD-derived daily crosses, official USD pegs, BIS monthly averages expanded to business days, IMF IFS monthly rates, and World Bank annual rates. Lower-frequency expansions are labelled with source_frequency and derivation_method; they are not presented as true daily fixings.
- data[].observation_datetime is the UTC midnight timestamp for the FX reference date. It is an observation-date marker, not a publication timestamp.
- XAU/USD and USD/XAU use the stored gold series: the National Bank of Ukraine official accounting price of gold divided by the NBU official UAH/USD rate for the same official rate date (Narodowy Bank Polski gold only for dates the NBU did not supply). Source: National Bank of Ukraine (https://bank.gov.ua/en/open-data). No publication clock or LBMA auction price is asserted. Weekday-label coverage is included.
Request
- Base URL: https://api.fxmacrodata.com
- URL: https://api.fxmacrodata.com/v1/forex/{base}/{quote}
- Auth: one of:
- none
- API key in header X-API-Key
- HTTP bearer
Path parameters
Base currency code
Required path parameter. Base currency code Allowed values: AUD, BRL, CAD, CHF, CNH, CNY, DKK, EUR, GBP, HUF, ILS, JPY, KRW, MYR, NGN, NOK, NZD, PEN, SEK, THB, TWD, USD.
Quote currency code
Required path parameter. Quote currency code Allowed values: AUD, BRL, CAD, CHF, CNH, CNY, DKK, EUR, GBP, HUF, ILS, JPY, KRW, MYR, NGN, NOK, NZD, PEN, SEK, THB, TWD, USD.
Query parameters
Start date YYYY-MM-DD
Optional query parameter. Start date YYYY-MM-DD
End date YYYY-MM-DD
Optional query parameter. End date YYYY-MM-DD
Maximum rows to return. Defaults to 20. Maximum 100.
Optional query parameter. Maximum rows to return. Defaults to 20. Maximum 100.
Number of rows to skip after most-recent-first ordering.
Optional query parameter. Number of rows to skip after most-recent-first ordering.
One-based page number. When supplied, it takes precedence over offset.
Optional query parameter. One-based page number. When supplied, it takes precedence over offset.
Comma-separated technical indicators to compute (e.g. sma_20,rsi_14,macd,bollinger_bands). Use 'all' to request every supported indicator.
Optional query parameter. Comma-separated technical indicators to compute (e.g. sma_20,rsi_14,macd,bollinger_bands). Use 'all' to request every supported indicator.
Pin the content version returned by the first page; changed history returns 409.
Optional query parameter. Pin the content version returned by the first page; changed history returns 409.
Your Individual or Business API key
Deprecated: legacy query-string API key. Still accepted so existing integrations keep working, but new integrations must send the key in the X-API-Key header (or Authorization: Bearer). A key is required for non-USD, paid-only, or full-history requests. Responses to requests authenticated this way carry a Deprecation header.
Response
Daily FX spot-rate series with optional computed technical indicators.
Changes
No recorded changes to this operation across all 1 revision of this API.