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.

10K Free Credits, No Credit Card Required

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.

Documentation

API Endpoint

GET

https://api.apifreaks.com/v1.0/commodity/fluctuation

Test
LANGUAGE
Python
PHP
Java
Node
Ruby
$ pip install requests

API Request

ParameterRequiredTypeDefaultDescription
symbolsYesArray-Comma separated list of desired commodities symbols.
startDateYesString-Start Date for the fluctuation. Format: YYYY-MM-DD
endDateYesString-End Date for the fluctuation. Format: YYYY-MM-DD

View the full list of supported symbols by visiting here.

NOTE: The maximum difference between the start and end date is 30 days.

API Response

For a comprehensive view of the API response structure and detailed field descriptions, explore the interactive Response Table by clicking here.

HTTP Error Codes

HTTP StatusReasons
400
(1) Invalid date format specified for start or end date. (2) Start date cannot be after end date. (3) Invalid Date: The provided date does not exist.
404
(1) No data found for the specified date range. (2) The symbol is not supported, please visit the documentation for a list of supported symbols.

How-To-Guides

How to Use Commodity Fluctuation API

To fetch fluctuation data:

Choose your commodity symbol (e.g. XAU, WTIOIL, XAG) and set your start and end dates. As a result, you will get Starting price, Ending price, Absolute change and Percentage change.

$ curl 'https://api.apifreaks.com/v1.0/commodity/fluctuation?apikey=API-KEY&symbols=WTIOIL%2CXAU%2CXAG&startDate=2024-01-01&endDate=2024-01-30'
#Response { "success": true, "startDate": "2024-01-01", "endDate": "2024-01-30", "rates": { "WTIOIL": { "startRate": 72.68, "endRate": 77.66, "change": 4.98, "changePercent": 6.85 }, "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.

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.

Price Estimation Calculator