FX endpoint
Rate differentials
The policy-rate gap between two currencies over time, the carry behind a pair.
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/rate_differentials/eur/usd"
import os
import requests
response = requests.get(
"https://api.fxmacrodata.com/v1/rate_differentials/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/rate_differentials/eur/usd", {
headers: { "X-API-Key": process.env.FXMACRODATA_API_KEY },
});
const payload = await response.json();
console.log(payload);
What it can do
1 route in this endpoint
Reference
Parameters and response fields
GET /v1/rate_differentials/{base}/{quote} Get pair rate differentials
An active Individual subscription and API key are required for every request.
Returns a historical differential between the base and quote currency using a shared rate measure. The endpoint aligns the two legs by date intersection and reports the spread in both percentage points and basis points.
Measures:
- Supported values:
auto,risk_free_rate,gov_bond_2y,gov_bond_10y,policy_rate. autoprefersrisk_free_rate, thengov_bond_2y, thenpolicy_rate.
Rate Types:
- Supported values:
spot,forward. spotcompares the selected shared rate measure.forwardderives each leg from government bond curve nodes, then aligns dates.
Authentication:
- Requires an Individual or Business API key via
?api_key=<key>orX-API-Key.
Parameters
| Name | In | Type | Details |
|---|---|---|---|
| baseRequired | path | string | Base currency code Allowed: 62 currencies. |
| quoteRequired | path | string | Quote currency code Allowed: 62 currencies. |
| measure | query | string | Shared rate measure to compare across the pair. Allowed: auto, risk_free_rate, gov_bond_2y, gov_bond_10y, policy_rate. Default: auto. |
| rate_type | query | string | Differential type: spot for shared rate measures, forward for derived curve segments. Allowed: spot, forward. Default: spot. |
| curve_family | query | string | Curve family used when rate_type=forward. Allowed: government_nominal. Default: government_nominal. |
| start_tenor_years | query | number | Start tenor in years when rate_type=forward. Default: 2.0. |
| end_tenor_years | query | number | End tenor in years when rate_type=forward. Default: 5.0. |
| start_date | query | string | Inclusive start date YYYY-MM-DD. Defaults to 365 days ago. |
| end_date | query | string | Inclusive end date YYYY-MM-DD. Defaults to today. |
| 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. |
| as_of | query | string | Explicit UTC information cutoff for verified vintage replay; date means start of day. |
| availability | query | string | Source-public or captured-value availability clock. Default: public. |
| 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 |
|---|---|---|
| research | object | |
| base | string | |
| quote | string | |
| rate_type | string | |
| measure_requested | string | |
| measure_used | string | |
| base_indicator | string | |
| quote_indicator | string | |
| curve_family | string | |
| start_tenor | string | |
| end_tenor | string | |
| forward_label | string | |
| start_date | string | |
| end_date | string | |
| matched_points | integer | |
| unit | string | |
| latest_spread | number | |
| latest_spread_bps | number | |
| latest_differential | number | |
| latest_differential_bps | number | |
| base_latest | number | |
| quote_latest | number | |
| sources | object | Publisher of each leg's rate. The spot path reports a single publisher name per leg; the curve and forward paths report the list of curve sources each leg was built from, so both shapes are declared. |
| sources.base | string | |
| sources.quote | string | |
| official_forward_source_support | object | How the official publisher makes forward rates available, if at all. |
| official_forward_source_support.source_type | string | |
| official_forward_source_support.source_note | string | |
| data_quality | object | |
| data_quality.source_freshness | string | |
| data_quality.source_monitoring_complete | boolean | |
| data_quality.known_source_gap | boolean | |
| data_quality.source_checked_at | integer | |
| data_quality.source_check_expires_at | integer | |
| data_quality.latest_published_period | string | |
| data_quality.source_permission_status | string |
Works well with
Endpoints people use alongside Rate differentials
The whole API
All 24 endpoint guides
Rates and markets