FX endpoint
Official reference rates
Central-bank fixings and session-close reference rates, the official rate for valuation and settlement.
An active Individual subscription and API key are required for every request.
curl -H "X-API-Key: YOUR_API_KEY" \
"https://api.fxmacrodata.com/v1/fx/reference-rates/eur/usd"
import os
import requests
response = requests.get(
"https://api.fxmacrodata.com/v1/fx/reference-rates/eur/usd",
headers={"X-API-Key": os.environ["FXMACRODATA_API_KEY"]},
timeout=30,
)
response.raise_for_status()
print(response.json())
const response = await fetch("https://api.fxmacrodata.com/v1/fx/reference-rates/eur/usd", {
headers: { "X-API-Key": process.env.FXMACRODATA_API_KEY },
});
const payload = await response.json();
console.log(payload);
What it can do
5 routes in this endpoint
Get timestamped official FX reference rates
Returns official FX reference rates as published by each source, one row per source observation. Sources fix at different times of day (for example the ECB at 14:10 CET and the Federal Reserve H.10 at noon New York time), so one date can carry several rows for a pair, including inverse and cross-derived rows. Each row's `timestamp_utc`, `timestamp_type` and `source` identify which fix it is. `coverage.sources` lists every contributing source with its row count, date range and usual UTC fix times. For a single-fix daily series, pass `source` (and `native_only=true` to exclude derived rows).
GET/v1/fx/source-universeList public FX reference-rate pair universe
Use to inspect the public pair/source universe before requesting a reference-rate series.
GET/v1/fx/sourcesList public FX reference-rate sources
Use to list the official FX reference-rate sources available through FXMacroData.
GET/v1/fx/intraday-reference-rates/{base}/{quote}Get subscriber intraday FX reference rates
Use for intraday official reference-rate observations ordered by source observation time.
GET/v1/fx/session-rates/{base}/{quote}Get official FX session-close reference rates
For each date, returns the latest timed official reference observation on that date at or before the selected session close: Sydney 17:00 Australia/Sydney, Tokyo 18:00 Asia/Tokyo, London 17:00 Europe/London or New York 17:00 America/New_York. It is not a market price observed at the close. Official fixes are published during European and New York hours, so the London and New York rows for a pair are often the same fix, and Sydney and Tokyo rows exist only on dates when a source published before that close. `staleness_minutes` on each row is the time between the selected observation and the close; check it and `source` before treating a row as a closing price. `coverage.staleness_minutes` summarises it for the request.
Reference
Parameters and response fields
GET /v1/fx/reference-rates/{base}/{quote} Get timestamped official FX reference rates
An active Individual subscription and API key are required for every request.
Returns official FX reference rates as published by each source, one row per source observation. Sources fix at different times of day (for example the ECB at 14:10 CET and the Federal Reserve H.10 at noon New York time), so one date can carry several rows for a pair, including inverse and cross-derived rows. Each row's timestamp_utc, timestamp_type and source identify which fix it is. coverage.sources lists every contributing source with its row count, date range and usual UTC fix times. For a single-fix daily series, pass source (and native_only=true to exclude derived rows).
Parameters
| Name | In | Type | Details |
|---|---|---|---|
| baseRequired | path | string | Base currency code |
| quoteRequired | path | string | Quote currency code |
| date | query | string | Single reference date YYYY-MM-DD. Overrides start_date/end_date. |
| start_date | query | string | Start reference date YYYY-MM-DD, inclusive. Without end_date the window runs through the latest available date (today, UTC); page through long histories with limit and offset or page. |
| end_date | query | string | End reference date YYYY-MM-DD, inclusive. Without start_date only this date is returned. With neither start_date nor end_date, today's (UTC) reference date is returned. |
| source | query | string | Optional source id filter, for example ecb_eurofxref_daily. |
| timestamp_type | query | string | Optional timestamp type filter, for example fixing or published. |
| native_only | query | boolean | Return only rows published directly for the requested pair, excluding inverse and cross-derived rows. Default: false. |
| include_source_legs | query | boolean | Include derivation source legs when a rate is inverted or crossed. Default: true. |
| order | query | string | Result ordering. Allowed: timestamp_asc, timestamp_desc, date_asc, date_desc. Default: timestamp_asc. |
| limit | query | integer | Maximum rows to return. Maximum 100. Default: 100. |
| offset | query | integer | Number of rows to skip. Default: 0. |
| page | query | integer | One-based page number. |
| dataset_version | query | string | Pin first-page content version; 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
| Field | Type | Details |
|---|---|---|
| base | string | |
| quote | string | |
| start_date | string | |
| end_date | string | |
| timestamp_basis | string | |
| source_policy | object | Redistribution rules governing which rows the public endpoints serve. |
| source_policy.public_data_policy | string | |
| source_policy.request_time_upstream_fetches | boolean | Whether serving a request contacts the upstream publisher. Always false: responses come from FXMacroData's collected dataset. |
| source_policy.value_field | string | |
| source_policy.legacy_daily_forex_value_field | string | |
| pagination | object | Offset pagination state for one page of results. |
| pagination.limit | integer | |
| pagination.offset | integer | |
| pagination.returned_count | integer | |
| pagination.total_count | integer | |
| pagination.has_more | boolean | |
| pagination.next_offset | integer | |
| pagination.page_includes_latest_available | boolean | |
| data[] | object[] | |
| data[].date | string | |
| data[].reference_date | string | |
| data[].base | string | |
| data[].quote | string | |
| data[].pair | string | |
| data[].rate | number | |
| data[].timestamp_utc | string | |
| data[].timestamp_type | string | |
| data[].fixing_time_utc | string | |
| data[].published_at_utc | string | |
| data[].time_precision | string | |
| data[].source | object | How one observation was sourced. |
| data[].source.source_pair | string | |
| data[].source.is_derived | boolean | |
| data[].source.derived_from_source_legs | boolean | |
| data[].source.derivation_method | string | |
| data[].source.pair_consistency_check | string |
GET /v1/fx/source-universe List public FX reference-rate pair universe
No API key required.
Parameters
| Name | In | Type | Details |
|---|---|---|---|
| currency | query | string | Optional currency filter, for example USD. |
| source | query | string | Optional source id filter, for example ecb_eurofxref_daily. |
| 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
| Field | Type | Details |
|---|---|---|
| source_policy | object | Redistribution rules governing which rows the public endpoints serve. |
| source_policy.public_data_policy | string | |
| source_policy.request_time_upstream_fetches | boolean | Whether serving a request contacts the upstream publisher. Always false: responses come from FXMacroData's collected dataset. |
| source_policy.value_field | string | |
| source_policy.legacy_daily_forex_value_field | string | |
| currency | string | |
| source | string | |
| data[] | object[] | |
| data[].source | object | One official FX reference-rate source. |
| data[].source.id | string | |
| data[].source.name | string | |
| data[].source.authority_type | string | |
| data[].source.country_or_area | string | |
| data[].source.url | string | |
| data[].source.attribution_text | string | |
| data[].source.tier | string | |
| data[].source.is_official | boolean | |
| data[].source.is_aggregator | boolean | |
| data[].source.default_timezone | string | |
| data[].source.publication_frequency | string | |
| data[].source.native_pairs[] | string[] | Every pair the authority publishes, as documentation of the source. Not a list of requestable pairs; see served_pairs. |
| data[].source.native_pair_count | integer | |
| data[].source.served_pairs[] | string[] | The pairs from this source that the public FX endpoints serve. Only these pairs can be requested; a pair listed in native_pairs but not here returns no rows. |
| data[].source.served_pair_count | integer | |
| data[].source.serves_public_data | boolean | True when at least one pair from this source is served by the public FX endpoints (served_pair_count > 0). False means the source is listed for provenance only and no data from it can be requested. |
| data[].source.coverage_note | string | |
| data[].source.source_universe_endpoint | string | |
| data[].pair_count | integer | |
| data[].pairs[] | object[] | |
| data[].pairs[].pair | string | |
| data[].pairs[].availability | string | |
| data[].pairs[].anchor | string |
GET /v1/fx/sources List public FX reference-rate sources
No API key required.
Lists the official FX reference-rate sources and the pairs each one publishes. native_pairs documents what the authority publishes; only served_pairs are available from the public FX endpoints. Sources with serves_public_data: false (an empty served_pairs) are listed for provenance only and return no data. Use /v1/fx/source-universe for the requestable pair universe.
Parameters
| Name | In | Type | Details |
|---|---|---|---|
| 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
| Field | Type | Details |
|---|---|---|
| source_policy | object | Redistribution rules governing which rows the public endpoints serve. |
| source_policy.public_data_policy | string | |
| source_policy.request_time_upstream_fetches | boolean | Whether serving a request contacts the upstream publisher. Always false: responses come from FXMacroData's collected dataset. |
| source_policy.value_field | string | |
| source_policy.legacy_daily_forex_value_field | string | |
| sources[] | object[] | |
| sources[].id | string | |
| sources[].name | string | |
| sources[].authority_type | string | |
| sources[].country_or_area | string | |
| sources[].url | string | |
| sources[].attribution_text | string | |
| sources[].tier | string | |
| sources[].is_official | boolean | |
| sources[].is_aggregator | boolean | |
| sources[].default_timezone | string | |
| sources[].publication_frequency | string | |
| sources[].native_pairs[] | string[] | Every pair the authority publishes, as documentation of the source. Not a list of requestable pairs; see served_pairs. |
| sources[].native_pair_count | integer | |
| sources[].served_pairs[] | string[] | The pairs from this source that the public FX endpoints serve. Only these pairs can be requested; a pair listed in native_pairs but not here returns no rows. |
| sources[].served_pair_count | integer | |
| sources[].serves_public_data | boolean | True when at least one pair from this source is served by the public FX endpoints (served_pair_count > 0). False means the source is listed for provenance only and no data from it can be requested. |
| sources[].coverage_note | string | |
| sources[].source_universe_endpoint | string |
GET /v1/fx/intraday-reference-rates/{base}/{quote} Get subscriber intraday FX reference rates
An active Individual subscription and API key are required for every request.
Return subscriber-only timestamped intraday FX reference rates.
Parameters
| Name | In | Type | Details |
|---|---|---|---|
| baseRequired | path | string | Base currency code |
| quoteRequired | path | string | Quote currency code |
| start_time | query | date-time | Inclusive RFC 3339 timestamp. Defaults to 24 hours before end_time. |
| end_time | query | date-time | Inclusive RFC 3339 source timestamp. Defaults to the current time. |
| 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
| Field | Type | Details |
|---|---|---|
| pair | string | |
| start_time | string | |
| end_time | string | |
| data[] | object[] | |
| data[].timestamp | string | |
| data[].price | number | |
| data[].reference_date | string | |
| data[].timestamp_type | string | |
| data[].source | object | One official FX reference-rate source. |
| data[].source.id | string | |
| data[].source.name | string | |
| data[].source.authority_type | string | |
| data[].source.country_or_area | string | |
| data[].source.url | string | |
| data[].source.attribution_text | string | |
| data[].source.tier | string | |
| data[].source.is_official | boolean | |
| data[].source.is_aggregator | boolean | |
| data[].source.default_timezone | string | |
| data[].source.publication_frequency | string | |
| data[].source.native_pairs[] | string[] | Every pair the authority publishes, as documentation of the source. Not a list of requestable pairs; see served_pairs. |
| data[].source.native_pair_count | integer | |
| data[].source.served_pairs[] | string[] | The pairs from this source that the public FX endpoints serve. Only these pairs can be requested; a pair listed in native_pairs but not here returns no rows. |
| data[].source.served_pair_count | integer | |
| data[].source.serves_public_data | boolean | True when at least one pair from this source is served by the public FX endpoints (served_pair_count > 0). False means the source is listed for provenance only and no data from it can be requested. |
| data[].source.coverage_note | string | |
| data[].source.source_universe_endpoint | string | |
| data[].source_pair | string | |
| data[].derivation_method | string |
GET /v1/fx/session-rates/{base}/{quote} Get official FX session-close reference rates
An active Individual subscription and API key are required for every request.
For each date, returns the latest timed official reference observation on that date at or before the selected session close: Sydney 17:00 Australia/Sydney, Tokyo 18:00 Asia/Tokyo, London 17:00 Europe/London or New York 17:00 America/New_York. It is not a market price observed at the close. Official fixes are published during European and New York hours, so the London and New York rows for a pair are often the same fix, and Sydney and Tokyo rows exist only on dates when a source published before that close. staleness_minutes on each row is the time between the selected observation and the close; check it and source before treating a row as a closing price. coverage.staleness_minutes summarises it for the request.
Parameters
| Name | In | Type | Details |
|---|---|---|---|
| baseRequired | path | string | Base currency code |
| quoteRequired | path | string | Quote currency code |
| sessionRequired | query | string | Session close: sydney (17:00 Australia/Sydney), tokyo (18:00 Asia/Tokyo), london (17:00 Europe/London) or new_york (17:00 America/New_York). |
| date | query | string | Single reference date YYYY-MM-DD. Overrides start_date/end_date. |
| start_date | query | string | Start reference date YYYY-MM-DD, inclusive. Without end_date the window runs through the latest available date (today, UTC); page through long histories with limit and offset or page. |
| end_date | query | string | End reference date YYYY-MM-DD, inclusive. Without start_date only this date is returned. With neither start_date nor end_date, today's (UTC) reference date is returned. |
| order | query | string | Result ordering. Allowed: timestamp_asc, timestamp_desc, date_asc, date_desc. Default: date_asc. |
| limit | query | integer | Maximum rows to return. Maximum 100. Default: 100. |
| offset | query | integer | Number of rows to skip. Default: 0. |
| page | query | integer | One-based page number. |
| dataset_version | query | string | Pin first-page content version; 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
| Field | Type | Details |
|---|---|---|
| base | string | |
| quote | string | |
| session | string | |
| start_date | string | |
| end_date | string | |
| source_policy | object | Redistribution rules governing which rows the public endpoints serve. |
| source_policy.public_data_policy | string | |
| source_policy.request_time_upstream_fetches | boolean | Whether serving a request contacts the upstream publisher. Always false: responses come from FXMacroData's collected dataset. |
| source_policy.value_field | string | |
| source_policy.legacy_daily_forex_value_field | string | |
| pagination | object | Offset pagination state for one page of results. |
| pagination.limit | integer | |
| pagination.offset | integer | |
| pagination.returned_count | integer | |
| pagination.total_count | integer | |
| pagination.has_more | boolean | |
| pagination.next_offset | integer | |
| pagination.page_includes_latest_available | boolean | |
| data[] | object[] | |
| data[].date | string | |
| data[].reference_date | string | |
| data[].base | string | |
| data[].quote | string | |
| data[].pair | string | |
| data[].rate | number | |
| data[].timestamp_utc | string | |
| data[].timestamp_type | string | |
| data[].fixing_time_utc | string | |
| data[].published_at_utc | string | |
| data[].time_precision | string | |
| data[].source | object | How one observation was sourced. |
| data[].source.source_pair | string | |
| data[].source.is_derived | boolean | |
| data[].source.derived_from_source_legs | boolean | |
| data[].source.derivation_method | string | |
| data[].source.pair_consistency_check | string |
Works well with
Endpoints people use alongside Official reference rates
The whole API
All 24 endpoint guides
Rates and markets