Historical Commodity Prices, Delivered Simply.
The Commodity API gives you clean, accurate, and real-time pricing for over 520 commodities - from crude oil and gold to wheat, cocoa, and copper. Whether you're forecasting markets or feeding financial dashboards, this API brings you every price point. Pick any date, and each commodity comes back with its open, high, low, and close, or the last earlier price and its date if the market was closed that day.
Features
Instant Access to 520+ Commodities
Bullions, Metals, energy, agriculture, industrial goods, livestock, and more - all under one endpoint.
30+ Years of Historical Data
Go back to 1990. Understand trends, not just today’s numbers.
Open, High, Low, and Close
Each commodity comes back with its opening, highest, lowest, and closing price for the day. For commodities published monthly, only the closing price is available, so readclose for those.The Last Available Price When a Day Has None
Weekends, holidays, and slow-publishing series all leave gaps. When a commodity has no price on the date you ask for, you get the last price before it, andrates.{symbol}.date shows the day that price is actually from.Daily Settlement for Futures Delivery Months
Individual futures months likeWTIOIL-FUT-DEC27 have one row per trading day, and their close is the exchange's daily settlement price, updated if the final figure differs from the preliminary one. Contract month history starts in October 2026, so use the continuous symbol, like WTIOIL-FUT, for anything older.History for Retired and Expired Symbols
A deprecated symbol keeps its history up to the deprecation date, and an expired futures month keeps its daily history up to expiry. Symbols are never reused, so old reports stay reproducible.
API Endpoint
How-To-Guides
Retrieve Historical Commodity Prices
It's as simple as: Pick a symbol, choose a date, get the price.- XAU is for Gold (USD per troy ounce)
- WTIOIL-SPOT is for SPOT Crude Oil (USD per barrel)
- CC is for Cocoa (USD per metric ton)
$ curl -X 'GET' 'https://api.apifreaks.com/v2.0/commodity/rates/historical?symbols=WTIOIL-SPOT%2CXAU&date=2025-01-10&apiKey=API-KEY'
# Response
{
"success": true,
"date": "2025-01-10",
"rates": {
"WTIOIL-SPOT": {
"date": "2025-01-10",
"open": 73.77,
"high": 77.16,
"low": 73.55,
"close": 75.97
},
"XAU": {
"date": "2025-01-10",
"open": 2669.93,
"high": 2697.85,
"low": 2663.61,
"close": 2689.44
}
}
}
Handle Mistyped Symbols
Send your symbol list as you have it. The response answers what it can and explains the rest.
$ curl -X 'GET' 'https://api.apifreaks.com/v2.0/commodity/rates/historical?apiKey=API-KEY&symbols=xau,wtioil-fut,zw,pl&date=2024-01-04'
# Response
{
"success": true,
"date": "2024-01-04",
"rates": {
"WTIOIL-FUT": {
"date": "2024-01-04",
"open": 72.28,
"high": 72.88,
"low": 72.21,
"close": 72.73
},
"XAU": {
"date": "2024-01-04",
"open": 2042.92,
"high": 2050.79,
"low": 2036.04,
"close": 2044.18
},
"XPT": {
"date": "2024-01-04",
"open": 972.4,
"high": 976.95,
"low": 953.25,
"close": 956.95
}
},
"unresolved": {
"ZW": {
"message": "Did you mean ZW-SPOT (Wheat Spot) or ZW-FUT (Wheat Futures)?",
"suggestions": [
The lowercase symbols were matched as usual. PL was answered as XPT, and ZW wasn't answered because it could mean wheat spot or wheat futures, so this response has a 206 status. If every symbol is valid but none has a price on or before the date, the API returns a 404.
Frequently Asked Questions
rates.{symbol}.date to see which day the price is from.close for those.WTIOIL-FUT-DEC27. Its close is the exchange's daily settlement, and its history stays available after the contract expires.Pricing
To use the Historical Commodity Prices API, API credits are required. We only charge for successful queries, defined by a 2xx status code. If a request results in a 4xx or 5xx status code, no credits will be deducted, and any credits already charged will be refunded.
For each successful request, 40 credits will be charged as a base fee, plus 1 additional credit per commodity symbol requested.
Utilize the Credits Usage API to efficiently monitor your recent consumption of both one-off and subscription credits. This API provides a streamlined way to track and manage your credit usage, helping you stay informed about your remaining balance and optimize your resource allocation effectively.