API Freaks logoAPI Freaks logo
⌘K

    Documentation

  • Pricing

  • Resources

  • Tools

  • Contact us

⌘K
Sign InGet Started For Free
  • Overview
  • Documentation
  • How to Guides
  • Pricing
  • APIFreaks
  • Organization and Teams
  • Credits Usage API
  • IP Geolocation Lookup API
  • Bulk IP Geolocation Lookup
  • Domain WHOIS Lookup
  • IP WHOIS Lookup
  • ASN Lookup
  • Domain WHOIS Historical Lookup
  • Domain WHOIS Reverse Lookup
  • Bulk Domain WHOIS Lookup
  • DNS Lookup
  • Historical DNS Lookup
  • Reverse DNS Lookup
  • Bulk DNS Lookup
  • SSL Certificate Lookup
  • Domain Availability API
  • Bulk Domain Availability API
  • Screenshot API
  • Bulk Screenshot API
  • Currencies Exchange Rates API
  • Currency Converter API
  • Currency Time Series API
  • Currency Fluctuation API
  • Geolocalized Currency Converter
  • Live Commodity Prices
  • Commodity Historical Prices
  • Commodity Fluctuation API
  • Commodity Time Series API
  • Timezone Lookup
  • Timezone Converter
  • User Agent Parser
  • Bulk User Agent Parser
  • Astronomy API

Historical Commodity Prices, Delivered Simply.

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.

10K Free Credits, No Credit Card Required

Features

Instant Access to 130+ 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.

Documentation

API Endpoint

GET

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

Test
LANGUAGE
Python
PHP
Java
Node
Ruby
JavaScript
C#
$ pip install requests

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
dateYesString-Date for which the rates are required. Format: YYYY-MM-DD

View the full list of supported symbols by visiting here.

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 (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.

How-To-Guides

Retrieve Historical Commodity Prices

It's as simple as: Pick a symbol, choose a date, get the price.
Here's how it works:
Each commodity has a unique symbol. For example:
  • XAU is for Gold (USD per troy ounce)
  • WTIOIL is for Crude Oil (USD per barrel)
  • CC is for Cocoa (USD per metric ton)
Use any date since January 1, 1990 and you will be shown the results for the requested date point.
There's nothing else to configure. It's just reliable price history that works for people who need real answers — not just raw feeds.
$ curl -X 'GET' 'https://api.apifreaks.com/v1.0/commodity/rates/historical?symbols=WTIOIL%2CXAU&date=2025-01-10?apikey=API-KEY'
#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 } } }

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.

Price Estimation Calculator

Ready to get started?

Sign Up for Free

APIFreaks

API Catalog

  • Geolocation APIs
  • WHOIS APIs
  • DNS APIs
  • SSL APIs
  • Domain Availability APIs
  • Screenshot APIs
  • Currency APIs
  • Commodity APIs
  • Timezone APIs
  • User Agent APIs
  • Other APIs

Tools Catalog

  • Formatters & Beautifiers
  • Converters & Optimizers
  • Viewers & Validators

Docs

  • Documentation
  • Swagger Docs

Pricing & Accounts

  • Pricing
  • Sign up
  • Sign In

Company

  • About Us
  • Resources
  • Terms
  • Privacy

Copyright © 2024

Made in Pakistan