commodities

Get commodity indicator data

Returns commodity and energy price observations with source provenance.

Supported indicators: crude_oil_inventories, gold, natural_gas, natural_gas_storage, 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. date is the official rate date and announcement_date is the Kyiv business day the NBU set it; no publication clock is asserted. 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_id starting NBP:) 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 — sourced from the U.S. Energy Information Administration (https://api.eia.gov/v2/).

  • WTI crude oil (oil_wti): Cushing, OK spot price, USD/barrel.
  • Brent crude oil (oil_brent): Europe spot price, USD/barrel.
  • Natural gas (natural_gas): Henry Hub spot price, USD/MMBtu.

Query Parameters:

  • start_date: Earliest date to include (YYYY-MM-DD). Defaults to 365 days ago.
  • end_date: Latest date to include (YYYY-MM-DD). Defaults to today.

Authentication: A professional API key is required. Supply it via ?api_key=<key> or the X-API-Key header.

get/v1/commodities/{indicator}

Request

  • Base URL: https://api.fxmacrodata.com
  • URL: https://api.fxmacrodata.com/v1/commodities/{indicator}
  • Auth: one of:
    • none
    • API key in header X-API-Key
    • HTTP bearer

Path parameters

indicator'crude_oil_inventories' | 'gold' | 'natural_gas' | 'natural_gas_storage' | 'oil_brent' | 'oil_wti' | 'platinum' | 'silver' required

Commodity indicator slug

Example:crude_oil_inventories

Required path parameter. Commodity indicator slug Allowed values: crude_oil_inventories, gold, natural_gas, natural_gas_storage, oil_brent, oil_wti, platinum, silver.

Query parameters

start_datestring

Start date YYYY-MM-DD

Example:2025-01-01

Optional query parameter. Start date YYYY-MM-DD

end_datestring

End date YYYY-MM-DD

Example:2026-03-01

Optional query parameter. End date YYYY-MM-DD

limitinteger

Maximum rows to return. Defaults to 20. Maximum 100.

Example:20

Optional query parameter. Maximum rows to return. Defaults to 20. Maximum 100.

offsetinteger

Number of rows to skip after most-recent-first ordering.

Optional query parameter. Number of rows to skip after most-recent-first ordering.

pageinteger nullable

One-based page number. When supplied, it takes precedence over offset.

Example:1

Optional query parameter. One-based page number. When supplied, it takes precedence over offset.

api_keystring

Your Individual or Business API key

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.

Response

Time-series data for the requested commodity indicator.

currencystring required
indicatorstring required
sourcestring nullable
source_urlstring nullable
has_official_forecastboolean required
last_updatedstring nullable
latest_available_datestring nullable
start_datestring required
end_datestring required

Changes

No recorded changes to this operation across all 1 revision of this API.