Live Commodity Prices API - Real Time Market Insights

Our Live Commodity Prices API provides commodity market live rates, covering a wide spectrum of commodities—from common agricultural goods like sugar commodity price, coffee commodity prices, soybean commodity price and cotton commodity price to energy and metals. Whether you're building a trading dashboard, financial report, or consumer-facing app, we'll provide you with real time commodities prices for the markets that matter most to your users.

By delivering instant commodity prices reliably, our API enables businesses and developers to build applications that require real-time insights into commodity trends. With the support of custom quote currency, you can display the commodity prices in any supported currency like USD, EUR, or more, so your data is always presented in the context that matters most to your audience.

10K Free Credits, No Credit Card Required

Features

Real-Time Commodity Updates

Stay ahead of market shifts with lightning-fast access to live commodity prices. By specifying the updates parameter, you can control how frequently your data refreshes, ensuring you always have the most current information on commodities.

Multiple Symbols Data

Query dozens of commodities at once—track today silver and gold rate, agricultural commodity prices, key metal commodity prices and much more. One comma‑separated symbols parameter gives a comprehensive data in a single response.

User-Defined Quote Currency

Transform raw commodity values into a currency of your choice. By setting your own default quote currency, you gain more control over how prices are displayed, simplifying comparisons and helping streamline your analytical processes.

Documentation

API Endpoint

GET

https://api.apifreaks.com/v1.0/commodity/rates/latest

Test
LANGUAGE
Python
PHP
Java
Node
Ruby

API Request

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)

ParameterRequiredTypeDefaultDescription
symbolsYesArray-Comma separated list of desired commodities symbols.
updatesYesString-Exchange rates update period. Possible values are: (1) 10m - 10 minutes update (2) 1m - 1 minute update
quoteNoStringDefault quote currency is the market currency of commodity.Specifies the target currency for the exchange rate.

View the full list of supported symbols by visiting here.

For all allowed quote values, visit here, and explore the fiat currencies.

API Response

FieldTypeRequirementDescription
successBooleanMandatory
API request success indicator. "true" for successful requests.
timestampNumberMandatory
Unix timestamp indicating when the response was generated.
ratesMapMandatory
Map containing rate data for all the requested commodities.
metadataMapMandatory
Map containing detailed information for all the requested commodities.
metadata.[SYMBOL]MapMandatory
Map containing detailed information for the specified commodity.
metadata.[SYMBOL].unitStringMandatory
Unit of the respective commodity.
metadata.[SYMBOL].quoteStringMandatory
Quote currency of the respective commodity.

HTTP Error Codes

HTTP StatusReasons
404
(1) The quote currency is invalid, please visit the documentation for a list of valid quote currencies (2) The symbol is not supported, please visit the documentation for a list of supported symbols

How-To-Guides

Live Commodity Prices

To get the latest commodity rates, call the endpoint by providing the updates and symbols query parameters. The response will be commodity rates of all the provided symbols.

$ curl 'https://api.apifreaks.com/v1.0/commodity/rates/latest?apikey=API-KEY&updates=1m&symbols=WTIOIL,XAU'
#Response { "success": true, "timestamp": 1703866777, "rates": { "WTIOIL": 72.29, "XAU": 2066.98 }, "metaData": { "XAU": { "unit": "T.oz", "quote": "USD" }, "WTIOIL": { "unit": "Bbl", "quote": "USD" } } }}

Live Commodity Rates by Specifying Update Period

For real time commodities prices, pass the updates query parameter to get the commodity rates that are updated after a specific period. The possible values are 10m, and 1m, which will return commodity rates updated every 10 minutes and 1 minute respectively in our database.

# Get exchange rates that get updated every 10 minutes.
$ curl 'https://api.apifreaks.com/v1.0/commodity/rates/latest?apikey=API-KEY&updates=10m&symbols=WTIOIL,XAU'

Live Commodity Rates of Desired Commodities

Pass the symbols query parameter that is comma separated list of commodity symbols whose rates are required. The response will be the rates of the desired commodities.

$ curl 'https://api.apifreaks.com/v1.0/commodity/rates/latest?apikey=API-KEY&updates=1m&symbols=PL,ZW'
#Response { "success": true, "timestamp": 1744813445, "rates": { "PL": 976.6, "ZW": 559.7 }, "metadata": { "PL": { "unit": "T.oz", "quote": "USD" }, "ZW": { "unit": "Bu", "quote": "USD" } } }

Change Quote Currency

Pass the quote query parameter to get the commodity quotations in the desired currency.

$ curl 'https://api.apifreaks.com/v1.0/commodity/rates/latest?apikey=API-KEY&updates=1m&symbols=PL,ZW&quote=EUR'
#Response { "success": true, "timestamp": 1744813652, "rates": { "PL": 859.457, "ZW": 492.564 }, "metadata": { "PL": { "unit": "T.oz", "quote": "EUR" }, "ZW": { "unit": "Bu", "quote": "EUR" } } }

Pricing

To use the Live 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.

ServiceCredits
10-Minute Rates Updates30 credit
1-Minute Rates Updates35 credits
Symbols 1 credit per symbol

For example:

$ curl 'https://api.apifreaks.com/v1.0/commodity/rates/latest?updates=10m&symbols=XAU,HG'

For a successful response from the above request, total of 32 credits will be charged: 30 credits for 10 minutes updates, and 2 credits for the 2 symbols.

If invalid symbols are provided along with valid values, then API will return successful response with 2xx status code but only the valid symbols will be returned. No credits will be deducted for the invalid symbols and any credits charged 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