Skip to main content

Setup

Put them in your environment or .env; Data APIs covers the other ways.

Notes

  • Every 2xx response counts against the monthly quota; 4xx and 5xx do not.
  • Symbols are case-insensitive codes (XAU, WTIOIL-FUT, BRENTOIL-SPOT); list them with commoditypriceapi.symbols. Unrecognised symbols come back under ‘unresolved’ with status 206.
  • Each plan caps symbols per request; going over returns 402. Endpoints a plan does not include also return 402.
  • The quote currency parameter is ignored on the Basic and legacy Lite plans.

Endpoints

Get latest commodity prices

  • Prices may be delayed up to 10 minutes depending on the plan.

Get real-time price of one commodity

Get commodity prices on a date

  • Falls back to the last earlier rate; 404 RATE_NOT_FOUND when there is none.

Get commodity price time series

  • Standard, Advanced and Enterprise plans only; Basic gets 402.

Get commodity price change between dates

  • Standard, Advanced and Enterprise plans only; Basic gets 402. No range limit.

Get intraday commodity prices

  • Advanced and Enterprise plans only (402 otherwise, not counted).
  • At most 100 points per response; page with nextStartTime.
  • Only for symbols updated every second, minute or 10 minutes; others return 400.

List commodity symbols

Get API usage