Rates and markets endpoint
Yield curves
Government yield curves with slopes and tenor nodes, straight from official bond data.
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/curves/usd"
import os
import requests
response = requests.get(
"https://api.fxmacrodata.com/v1/curves/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/curves/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/curves/{currency} Get curve analytics by currency
An active Individual subscription and API key are required for every request.
Returns a currency-level curve view from official-source government bond tenor nodes. Use view=nodes for raw node snapshots, view=slopes for curve-slope and inversion analytics, or view=forwards for derived forward-rate segments.
Curve Families:
- Supported values:
government_nominal.
Metrics:
- Supported values:
spot.
Views:
- Supported values:
nodes,slopes,forwards.
Authentication:
- Requires an Individual or Business API key via
?api_key=<key>orX-API-Key.
Parameters
| Name | In | Type | Details |
|---|---|---|---|
| currencyRequired | path | string | Currency code Allowed: 28 currencies. |
| curve_family | query | string | Official curve family to return. Allowed: government_nominal. Default: government_nominal. |
| metric | query | string | Curve metric to return. Allowed: spot. Default: spot. |
| view | query | string | Curve view to return: nodes, slopes, or forwards. Allowed: nodes, slopes, forwards. Default: nodes. |
| method | query | string | Forward derivation method used when view=forwards. Allowed: derived_from_spot_nodes. Default: derived_from_spot_nodes. |
| date | query | string | Optional target date YYYY-MM-DD. The endpoint returns the latest available node per maturity up to this date, using a recent lookback window. |
| 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. |
| max_staleness_days | query | integer | Maximum reference-date age; defaults to 7 with as_of, otherwise 60. |
| require_common_date | query | boolean | Require all populated curve nodes to share a reference date; defaults true with as_of. |
| 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 | |
| currency | string | |
| curve_family | string | |
| view | string | |
| metric | string | |
| method | string | |
| requested_date | string | |
| as_of | string | |
| node_count | integer | |
| slope_count | integer | |
| inverted_count | integer | |
| segment_count | integer | |
| sources[] | 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 | |
| data_quality.commodity_coverage | object | |
| data_quality.commodity_coverage.scope | string | |
| data_quality.commodity_coverage.requested_start | string | |
| data_quality.commodity_coverage.requested_end | string | |
| data_quality.commodity_coverage.available_start | string | |
| data_quality.commodity_coverage.available_end | string | |
| data_quality.commodity_coverage.input_row_count | integer | |
| data_quality.commodity_coverage.row_count | integer | |
| data_quality.commodity_coverage.distinct_date_count | integer | |
| data_quality.commodity_coverage.duplicate_date_row_count | integer | |
| data_quality.commodity_coverage.excluded_weekend_row_count | integer | |
| data_quality.commodity_coverage.invalid_date_row_count | integer |
Works well with
Endpoints people use alongside Yield curves
The whole API
All 24 endpoint guides
Rates and markets