Skip to content

FX endpoint

FX spot history

Daily spot history for any pair, to line up each release with how the currency moved.

GET/v1/forex/{base}/{quote}
Individual API key required AI tool: forex

An active Individual subscription and API key are required for every request.

1Route
11Parameters
JSONResponse
curl -H "X-API-Key: YOUR_API_KEY" \
  "https://api.fxmacrodata.com/v1/forex/eur/usd"

What it can do

1 route in this endpoint

Example response

What comes back

A shortened example of the JSON this endpoint returns. Lists are cut to two rows here.

200 OK
{
  "base": "USD",
  "quote": "JPY",
  "source": "Official central-bank reference rates",
  "provenance": {
    "publisher": "Official central-bank reference rates",
    "storage": "FXMacroData",
    "timestamp_field": "date",
    "value_field": "val"
  },
  "pair_metadata": {
    "direct_available": true,
    "inverse_available": false,
    "derived_from_inverse": false,
    "derived_from_cross": false,
    "derived_from_source_legs": false,
    "is_derived": false,
    "derivation_method": "direct_original_pair",
    "source_pair": "USD/JPY",
    "source_legs": [
      {
        "pair": "USD/JPY",
        "source_provider": "BIS XRU",
        "source_name": "BIS XRU daily USD exchange rates",
        "source_url": "https://stats.bis.org/api/v2/data/dataflow/BIS/WS_XRU/1.0",
        "source_frequency": "daily"
      }
    ],
    "pair_consistency_check": "passed"
  },
  "data_quality": {
    "source_name": "Official central-bank reference rates",
    "source_type": "official",
    "is_derived": false,
    "datetime_field": "observation_datetime",
    "datetime_precision": "date",
    "source_legs": [
      {
        "pair": "USD/JPY",
        "source_provider": "BIS XRU",
        "source_frequency": "daily"
      }
    ]
  },
  ...

Reference

Parameters and response fields

GET /v1/forex/{base}/{quote} Get FX spot rates
Individual API key required

An active Individual subscription and API key are required for every request.

Fetches daily FX spot rates between two currencies using official central-bank reference rates.

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. The NBU sets each price on the working day before its rate date, so a gold row reflects the market of the day before date; market_date gives that day. Weekday-label coverage is included.

Parameters

NameInTypeDetails
baseRequired path string Base currency code Allowed: 62 currencies.
quoteRequired path string Quote currency code Allowed: 62 currencies.
start_date query string Start date YYYY-MM-DD
end_date query string End date YYYY-MM-DD
limit query integer Maximum rows to return. Defaults to 20. Maximum 100. Default: 20.
offset query integer Number of rows to skip after most-recent-first ordering. Default: 0.
page query integer One-based page number. When supplied, it takes precedence over offset.
indicators query string Comma-separated technical indicators to compute (e.g. sma_20,rsi_14,macd,bollinger_bands). Use 'all' to request every supported indicator.
dataset_version query string Pin the content version returned by the first page; changed history returns 409.
api_key query string 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.
lang query string Optional language for names and labels, for example es or pt-BR. A regional tag falls back to its base language, and a language that is not yet available returns English with Content-Language: en. Translated fields keep the English text in <field>_original and add a <field>_localized flag. Slugs, field names, codes, dates and values never change. Omit it for English.

Response fields

FieldTypeDetails
basestring
quotestring
sourcestring
provenanceobject
provenance.publisherstring
provenance.publisher_urlstring
provenance.storagestringData provider label for the served series. Always FXMacroData.
provenance.served_bystringFXMacroData endpoint that serves this series.
provenance.timestamp_fieldstring
provenance.value_fieldstring
pair_metadataobjectWhether the pair is served directly, inverted, or crossed via an anchor.
pair_metadata.source_pairstring
pair_metadata.is_derivedboolean
pair_metadata.direct_availableboolean
pair_metadata.inverse_availableboolean
pair_metadata.original_pair_availableboolean
pair_metadata.original_inverse_pair_availableboolean
pair_metadata.derived_from_inverseboolean
pair_metadata.derived_from_crossboolean
pair_metadata.derived_from_source_legsboolean
pair_metadata.derivation_methodstring
pair_metadata.anchor_currencystring
pair_metadata.derived_valueinteger
pair_metadata.pair_consistency_checkstring
pair_metadata.source_notestring
pair_metadata.source_legs[]object[]
pair_metadata.source_legs[].pairstring
pair_metadata.source_legs[].source_pairstring
pair_metadata.source_legs[].storage_pathstringRetained for compatibility. Always null.
pair_metadata.source_legs[].stored_sourcestringRetained for compatibility. Always null.
pair_metadata.source_legs[].source_providerstring
pair_metadata.source_legs[].source_namestring
pair_metadata.source_legs[].source_urlstring
pair_metadata.source_legs[].source_frequencystring
pair_metadata.source_legs[].source_typestring
pair_metadata.source_legs[].is_derivedboolean

Full schema in the API reference

Works well with

Endpoints people use alongside FX spot history

The whole API

All 24 endpoint guides

Open the endpoint map

AI Answer-Ready

Key Facts

Page
FX Spot Rates
Section
Documentation
Canonical URL
https://fxmacrodata.com/documentation/endpoints/fx-spot-rates
Source
FXMacroData editorial and official publisher references
Last Updated
See page metadata

Provenance And Trust

Cite the canonical URL and source field above. Where available, this page maps to official publisher releases and timestamped updates.

Quick Q&A

What is this page about? This page explains FX Spot Rates with directly usable context for trading, research, and API workflows.

What source should be cited? Use the canonical URL and the listed source field; cite official publisher references when available.

How fresh is this content? The last updated value above reflects the page metadata or latest available data timestamp.

Can this be used in AI assistants? Yes. This section is intentionally structured for retrieval and citation in chat assistants.

Prompt Packs

Use these in ChatGPT, Claude, Gemini, Mistral, Perplexity, or Grok for consistent source-aware outputs.