Rates and markets endpoint
Commodities
Energy and precious-metals prices, the commodity side of currencies like CAD, NOK and AUD.
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/commodities/latest"
import os
import requests
response = requests.get(
"https://api.fxmacrodata.com/v1/commodities/latest",
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/commodities/latest", {
headers: { "X-API-Key": process.env.FXMACRODATA_API_KEY },
});
const payload = await response.json();
console.log(payload);
What it can do
2 routes in this endpoint
Get latest values for all commodity indicators
Use to fetch the latest stored value for every available commodity indicator in one call.
GET/v1/commodities/{indicator}Get commodity indicator data
Use for commodity time series such as precious metals where macro workflows need cross-asset context.
Example response
What comes back
A shortened example of the JSON this endpoint returns. Lists are cut to two rows here.
{
"currency": "COMM",
"indicator": "gold",
"source": "National Bank of Ukraine",
"source_url": "https://bank.gov.ua/en/markets/exchangerates",
"has_official_forecast": false,
"start_date": "2026-10-01",
"end_date": "2026-10-05",
"data": [
{
"date": "2026-10-05",
"val": 4182.862,
"announcement_date": "2026-10-02",
"announcement_timezone": "Europe/Kyiv",
"market_date": "2026-10-02",
"market_date_status": "publisher_setting_date",
"time_announced": false,
"publication_time_status": "unknown",
"source_series_id": "NBU:XAU:UAH/USD",
"source_value": 188168.98,
"source_unit": "UAH per troy ounce",
"conversion_rate": 44.9857,
"conversion_unit": "UAH per USD",
"cross_check_val": 4158.925,
"cross_check_divergence_pct": 0.576,
"cross_check_divergent": false
}
]
}
Reference
Parameters and response fields
GET /v1/commodities/latest Get latest values for all commodity indicators
An active Individual subscription and API key are required for every request.
Parameters
| Name | In | Type | Details |
|---|---|---|---|
| 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 |
|---|---|---|
| currency | string | |
| source | string | |
| as_of | string | Newest observation date across available indicators; this does not certify that every indicator is current. |
| is_stale | boolean | |
| stale_indicators[] | string[] | |
| freshness | object | |
| freshness.status | string | Aggregate freshness: current, partial, or failed. Inspect each indicator's date and quality for its own freshness. |
| freshness.configured_count | integer | |
| freshness.available_count | integer | |
| freshness.oldest_available_date | string | |
| freshness.newest_available_date | string | |
| freshness.stale_indicators[] | string[] | |
| freshness.unavailable_indicators[] | string[] | |
| freshness.source_failure_indicators[] | string[] | |
| freshness.unknown_freshness_indicators[] | string[] | |
| count | integer | |
| data[] | object[] | |
| data[].indicator | string | |
| data[].unit | string | |
| data[].frequency | string | |
| data[].has_official_forecast | boolean | |
| data[].last_updated | string | |
| data[].observation_date | string | Official observation date of latest; an alias of latest.date. |
| data[].latest_available_date | string | |
| data[].is_stale | boolean | |
| data[].data_lag_days | integer | |
| data[].ingest_status | object | |
| data[].ingest_status.state | string | |
| data[].ingest_status.last_attempt_at | string | |
| data[].ingest_status.last_success_at | string | |
| data[].ingest_status.latest_available_date | string | |
| data[].ingest_status.data_lag_days | integer | |
| data[].ingest_status.is_stale | boolean | |
| data[].ingest_status.error_code | string | |
| data[].data_quality | object | |
| data[].data_quality.source_freshness | string |
GET /v1/commodities/{indicator} Get commodity indicator data
An active Individual subscription and API key are required for every request.
Returns commodity and energy price observations with source provenance.
Supported indicators: crude_oil_inventories, crude_oil_stocks, distillate_inventories, distillate_stocks, gasoline_inventories, gasoline_stocks, gold, natural_gas, natural_gas_storage, natural_gas_storage_level, oil_brent, oil_wti, platinum, silver.
The supported-indicator list above is the complete list of indicators this endpoint serves.
Precious metals — official central-bank publications, USD/troy oz.
- Gold, silver, platinum (and palladium where listed above): National Bank of Ukraine official accounting prices of banking metals (https://bank.gov.ua/en/markets/exchangerates), converted to USD with the NBU official UAH/USD rate for the same official rate date.
dateis the official rate date andannouncement_dateis the Kyiv business day the NBU set it; no publication clock is asserted. The NBU sets each price on the working day before its rate date, so a row reflects the market of the day beforedate.market_dategives that day: use it, notdate, to line a price up with market events.market_date_statusispublisher_setting_datewhen the NBU recorded the day (July 2019 onward) andassumed_previous_publicationfor earlier rows, where it is the previous publication's rate date. Source: National Bank of Ukraine (https://bank.gov.ua/en/open-data). - Gold comparisons use the Narodowy Bank Polski calculated gold price (PLN per gram, converted with the same-date NBP USD mid rate). Cross-checks are best effort over the most recent 93 calendar days; where a comparison is available, rows carry
cross_check_divergence_pct. NBP rows (source_series_idstartingNBP:) are served only for dates the NBU did not supply. - These are official reference prices, not executable quotes or LBMA auction prices. Weekday-label coverage is included.
Energy prices
- WTI crude oil (
oil_wti): Plains Marketing posted purchase price in Texas, USD/barrel. - Brent crude oil (
oil_brent): Europe spot price, USD/barrel. - Natural gas (
natural_gas): Henry Hub spot price, USD/MMBtu.
Authentication: A professional API key is required. Supply it via ?api_key=<key> or the X-API-Key header.
Parameters
| Name | In | Type | Details |
|---|---|---|---|
| indicatorRequired | path | string | Commodity indicator slug Allowed: 14 indicators. |
| 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. |
| 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 |
|---|---|---|
| currency | string | |
| indicator | string | |
| source | string | |
| source_url | string | |
| provenance | object | Publisher and source lineage, shared by the market-data endpoints. |
| provenance.publisher | string | |
| provenance.publisher_url | string | |
| provenance.storage | string | Data provider label for the served series. Always FXMacroData. |
| provenance.source_store | string | Source series reference, when reported. |
| provenance.served_by | string | FXMacroData endpoint that serves this series. |
| provenance.timestamp_field | string | |
| provenance.value_field | string | |
| has_official_forecast | boolean | |
| last_updated | string | |
| latest_available_date | 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 | |
| data_quality.commodity_coverage.expected_weekday_label_count | integer |
Works well with
Endpoints people use alongside Commodities
The whole API
All 24 endpoint guides
Rates and markets