The Commodity API gives you clean, accurate, and real-time pricing for over 130 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.
Bullions, Metals, energy, agriculture, industrial goods, livestock, and more — all under one endpoint.
Go back to 1990. Understand trends, not just today’s numbers.
$ pip install requests
Note that the response returned will only be in json format, so the query parameter format=xml won't work. (See details about the format parameter here)
Parameter | Required | Type | Default | Description |
---|---|---|---|---|
symbols | Yes | Array | - | Comma separated list of desired commodities symbols |
date | Yes | String | - | Date for which the rates are required. Format: YYYY-MM-DD |
View the full list of supported symbols by visiting here.
For a comprehensive view of the API response structure and detailed field descriptions, explore the interactive Response Table by clicking here.
HTTP Status | Reasons |
---|---|
400 | (1) Invalid Date Format (YYYY-MM-DD).
(2) Invalid Date: The provided date does not exist. |
404 | (1) No rate found for the specified date.
(2) The symbol is not supported, please visit the documentation for a list of supported symbols. |
#Response { "success": true, "date": "2025-01-10", "rates": { "WTIOIL": { "date": "2025-01-10", "open": 73.92, "high": 77.86, "low": 75.42, "close": 76.57 }, "XAU": { "date": "2025-01-10", "open": 2669.89, "high": 2697.87, "low": 2663.16, "close": 2685.61 } } }$ curl 'https://api.apifreaks.com/v1.0/commodity/rates/historical?symbols=WTIOIL%2CXAU&date=2025-01-10?apikey=API-KEY'
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.