fx_markets

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.
get/v1/forex/{base}/{quote}

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'AUD' | 'BRL' | 'CAD' | 'CHF' | 'CNH' | 'CNY' | 'DKK' | 'EUR' | 'GBP' | 'HUF' | 'ILS' | 'JPY' | 'KRW' | 'MYR' | 'NGN' | 'NOK' | 'NZD' | 'PEN' | 'SEK' | 'THB' | 'TWD' | 'USD' required

Base currency code

Example:AUD

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'AUD' | 'BRL' | 'CAD' | 'CHF' | 'CNH' | 'CNY' | 'DKK' | 'EUR' | 'GBP' | 'HUF' | 'ILS' | 'JPY' | 'KRW' | 'MYR' | 'NGN' | 'NOK' | 'NZD' | 'PEN' | 'SEK' | 'THB' | 'TWD' | 'USD' required

Quote currency code

Example:AUD

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_datestring

Start date YYYY-MM-DD

Example:2026-01-01

Optional query parameter. Start date YYYY-MM-DD

end_datestring

End date YYYY-MM-DD

Example:2026-03-01

Optional query parameter. End date YYYY-MM-DD

limitinteger

Maximum rows to return. Defaults to 20. Maximum 100.

Example:20

Optional query parameter. Maximum rows to return. Defaults to 20. Maximum 100.

offsetinteger

Number of rows to skip after most-recent-first ordering.

Optional query parameter. Number of rows to skip after most-recent-first ordering.

pageinteger nullable

One-based page number. When supplied, it takes precedence over offset.

Example:1

Optional query parameter. One-based page number. When supplied, it takes precedence over offset.

indicatorsstring

Comma-separated technical indicators to compute (e.g. sma_20,rsi_14,macd,bollinger_bands). Use 'all' to request every supported indicator.

Example:sma_20,rsi_14,macd

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.

dataset_versionstring nullable

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.

api_keystring

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.

basestring required
quotestring required
sourcestring required
start_datestring required
end_datestring required
indicatorsobject nullable
daily_ohlc_basisobject nullable
technical_indicator_basisobject nullable
dataset_versionstring required
coverageobject required

Changes

No recorded changes to this operation across all 1 revision of this API.