Commodity Fluctuation API
Know what changed, by how much, and when. Instantly.
Whether you're tracking gold, crude oil, or coffee beans, this API gives you accurate results. The Commodity Fluctuation API shows how prices moved over any time period-so you can tell the story behind the numbers. Just enter a date range and symbol. You'll get back the opening price, closing price, total change, and percent change. Send several commodities at once, including individual futures delivery months, and set the two dates as far apart as you like.
Features
Get clean fluctuation data
Just pass in the commodity symbol (like XAU for gold) and a start/end date. You'll get back the opening and closing prices, the exact price change, and the percentage movement over that range.
Works across all commodities
From agricultural goods to energy, metals to rare materials-use the same endpoint across every symbol. One consistent format. All sectors covered.
Ideal for historical insights
Pair the commodity fluctuation API with the time series API to show detailed daily movement, then use this endpoint to show summarized change over the full range.
No Limit on the Date Range
The two dates can be any distance apart, so you can compare last Monday with today or 1990 with this year. Every value comes back rounded to two decimals.
Futures Delivery Months
Measure how a specific contract month, likeWTIOIL-FUT-DEC27, moved over a range. Contract month history starts in October 2026, so use the continuous futures symbol for longer ranges.Monthly Commodities Handled for You
For commodities published monthly, the change is measured between the first day of the start month and the first day of the end month. You can pass normal dates and mix daily and monthly commodities in one request.
API Endpoint
How-To-Guides
How to Use Commodity Fluctuation API
To fetch fluctuation data:
Choose your commodity symbol (e.g. XAU, WTIOIL-SPOT, XAG) and set your start and end dates. As a result, you will get Starting price, Ending price, Absolute change and Percentage change.
$ curl -X 'GET' 'https://api.apifreaks.com/v2.0/commodity/fluctuation?apiKey=API-KEY&symbols=WTIOIL-SPOT%2CXAU%2CXAG&startDate=2024-01-01&endDate=2024-01-30'
# Response
{
"success": true,
"startDate": "2024-01-01",
"endDate": "2024-01-30",
"rates": {
"WTIOIL-SPOT": {
"startRate": 72.02,
"endRate": 77.72,
"change": 5.7,
"changePercent": 7.91
},
"XAG": {
"startRate": 23.81,
"endRate": 23.15,
"change": -0.66,
"changePercent": -2.77
},
"XAU": {
"startRate": 2063.63,
"endRate": 2036.27,
"change": -27.36,
"changePercent": -1.33
}
}
}
This makes the commodity fluctuation API ideal for dashboards, alerts, reports, or portfolio tools. Use it to flag volatility or summarize changes with clarity-no extra logic needed.
All numeric values are rounded to 2 decimal places. For monthly-updated commodities, the fluctuation is computed between the first day of the start month and the first day of the end month rather than the exact requested dates. There is no limit on the date range.
If a symbol can't be resolved, it's reported in an unresolved object alongside the resolved rates (as a 206 Partial Content response), sometimes with a suggestions array of close-match symbols - e.g. requesting ZW suggests ZW-SPOT and ZW-FUT.
Handle Mistyped Symbols
Send your symbol list as you have it. The response measures what it can and explains the rest.
$ curl -X 'GET' 'https://api.apifreaks.com/v2.0/commodity/fluctuation?apiKey=API-KEY&symbols=xau,wtioil-fut,zw,pl&startDate=2023-12-08&endDate=2023-12-13'
# Response
{
"success": true,
"startDate": "2023-12-08",
"endDate": "2023-12-13",
"rates": {
"WTIOIL-FUT": {
"startRate": 71.23,
"endRate": 69.83,
"change": -1.4,
"changePercent": -1.97
},
"XAU": {
"startRate": 2004.35,
"endRate": 2032.68,
"change": 28.33,
"changePercent": 1.41
},
"XPT": {
"startRate": 915.15,
"endRate": 937.3,
"change": 22.15,
"changePercent": 2.42
}
},
"unresolved": {
"ZW": {
"message": "Did you mean ZW-SPOT (Wheat Spot) or ZW-FUT (Wheat Futures)?",
"suggestions": [
"ZW-SPOT",
"ZW-FUT"
PL was measured as XPT, and ZW wasn't measured because it could mean wheat spot or wheat futures, so this response has a 206 status. If every symbol is valid but none has data in the range, the API returns a 404.
Frequently Asked Questions
unresolved. You're not charged for it. If none of the symbols have data in the range, the API returns a 404.WTIOIL-FUT-DEC27 has to start then or later. For a longer view of a futures price, use the continuous symbol, like WTIOIL-FUT.Pricing
To access the Commodity Fluctuation API, API credits are required. Credits are only deducted for successful requests (2xx status code). If a request returns a 4xx or 5xx status code, no credits will be charged, and any previously deducted credits will be refunded.
Each successful Commodity Fluctuation request costs 40 credits, plus 1 credit for each symbol included in the request.
If you provide both valid and invalid symbols, the API will return a successful 2xx response with only the valid symbols included. No credits are deducted for invalid symbols, and any credits charged for them will be refunded.
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.