Skip to content

REST API for real-time commodity futures prices — gold, silver, crude oil, natural gas, coffee, wheat, and 25+ more. Prices from CME, NYMEX, and CBOT in USD.

Notifications You must be signed in to change notification settings

omkarcloud/commodity-price-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

Commodity Price API

REST API for real-time commodity futures prices — gold, silver, crude oil, natural gas, coffee, wheat, and 25+ more. Prices from CME, NYMEX, and CBOT in USD.

Features

  • Real-time futures prices for 30+ commodities
  • Covers precious metals, energy, agriculture, and livestock
  • Prices sourced from CME, NYMEX, and CBOT exchanges
  • 5,000 requests/month on free tier
  • Example Response:
{
  "commodity_name": "Silver Futures",
  "exchange": "CME",
  "price_usd": 79.665,
  "updated_at": "2026-02-09T11:45:04+00:00"
}

Get API Key

Create an account at omkar.cloud to get your API key, and use it in requests. 5000 requests are free every month.

Quick Start

curl -X GET "https://commodity-price-api.omkar.cloud/commodity-price?name=silver" \
  -H "API-Key: YOUR_API_KEY"
{
  "commodity_name": "Silver Futures",
  "exchange": "CME",
  "price_usd": 79.665,
  "updated_at": "2026-02-09T11:45:04+00:00"
}

Installation

Python

pip install requests
import requests

response = requests.get(
    "https://commodity-price-api.omkar.cloud/commodity-price",
    params={"name": "silver"},
    headers={"API-Key": "YOUR_API_KEY"}
)

data = response.json()
print(f"{data['commodity_name']}: ${data['price_usd']} ({data['exchange']})")

Node.js

npm install axios
import axios from "axios";

const response = await axios.get("https://commodity-price-api.omkar.cloud/commodity-price", {
    params: { name: "silver" },
    headers: { "API-Key": "YOUR_API_KEY" }
});

console.log(`${response.data.commodity_name}: $${response.data.price_usd}`);

API Reference

Endpoint

GET https://commodity-price-api.omkar.cloud/commodity-price

Headers

Header Required Description
API-Key Yes API key from omkar.cloud/api-key

Parameters

Parameter Required Description
name Yes Commodity name (see supported commodities below)

Supported Commodities

Category Commodities
Precious Metals gold, silver, platinum, palladium, micro_gold, micro_silver
Energy crude_oil, brent_crude_oil, natural_gas, gasoline_rbob, heating_oil
Agriculture wheat, corn, soybean, soybean_oil, soybean_meal, oat, rough_rice, lumber, coffee, cocoa, sugar, cotton, orange_juice
Livestock live_cattle, feeder_cattle, lean_hogs, class_3_milk
Metals copper, aluminum

Response Fields

Field Type Description
commodity_name string Full futures contract name (e.g., "Silver Futures")
exchange string Trading exchange — CME, NYMEX, or CBOT
price_usd number Current futures price in USD
updated_at string ISO 8601 timestamp of last price update

Examples

Get gold price

response = requests.get(
    "https://commodity-price-api.omkar.cloud/commodity-price",
    params={"name": "gold"},
    headers={"API-Key": "YOUR_API_KEY"}
)

gold = response.json()
print(f"Gold: ${gold['price_usd']} on {gold['exchange']}")

Get crude oil price

response = requests.get(
    "https://commodity-price-api.omkar.cloud/commodity-price",
    params={"name": "crude_oil"},
    headers={"API-Key": "YOUR_API_KEY"}
)

oil = response.json()
print(f"WTI Crude: ${oil['price_usd']}")

Get natural gas price

response = requests.get(
    "https://commodity-price-api.omkar.cloud/commodity-price",
    params={"name": "natural_gas"},
    headers={"API-Key": "YOUR_API_KEY"}
)

gas = response.json()
print(f"Natural Gas: ${gas['price_usd']}")

Error Handling

response = requests.get(
    "https://commodity-price-api.omkar.cloud/commodity-price",
    params={"name": "gold"},
    headers={"API-Key": "YOUR_API_KEY"}
)

if response.status_code == 200:
    data = response.json()
elif response.status_code == 401:
    # Invalid API key
    pass
elif response.status_code == 429:
    # Rate limit exceeded
    pass

Rate Limits

Plan Price Requests/Month
Free $0 5,000
Starter $25 100,000
Grow $75 1,000,000
Scale $150 10,000,000

Questions? We have answers.

Reach out anytime. We will solve your query within 1 working day.

Contact Us on WhatsApp about Commodity Price API

Contact Us on Email about Commodity Price API

Releases

No releases published

Sponsor this project

Packages

No packages published