Loading...
🔑
Enterprise Feature
API key management is available on the Enterprise plan.
Upgrade to access programmatic commodity data.
Enterprise
API Key Management
Access CommodityNode data programmatically. Your API key grants access to real-time prices, historical candles, and forecasts.
Rate Limits Enterprise
1,000
Requests / Day
3,600s
Cache TTL (/api/prices)
CSV + JSON
Export Formats
CORS
Cross-Origin Enabled
Rate limit headers: X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used on every response.
Your API Key Loading
Loading...
Generating a new key will invalidate your existing key immediately. Any integrations using the old key will stop working.
New Key Generated — Copy it now!
This key will not be shown again in full. Store it securely.
Available Endpoints
GET
/api/data?symbol=CL=F&period=3M
Historical OHLCV candle data. Periods: 1M, 3M, 6M, 1Y
GET
/api/data?type=prices
All current commodity prices
GET
/api/data?type=forecast&symbol=crude_oil
Commodity forecast data
GET
/api/export?symbol=CL=F&period=1Y&format=csv
Download OHLCV data as CSV or JSON file
GET
/api/prices
Public prices endpoint — no auth required, cached 1h
Code Examples
cURL
Python
JavaScript
# Fetch crude oil candles (3-month period)
curl -H "x-api-key: YOUR_API_KEY" \
"https://commoditynode.com/api/data?symbol=CL%3DF&period=3M"
# Download as CSV
curl -H "x-api-key: YOUR_API_KEY" \
"https://commoditynode.com/api/export?symbol=CL%3DF&period=1Y&format=csv" \
-o crude_oil_1y.csv
# All current prices (no auth)
curl "https://commoditynode.com/api/prices"
import requests
API_KEY = "YOUR_API_KEY"
BASE = "https://commoditynode.com"
headers = {"x-api-key": API_KEY}
# Fetch crude oil 3M candles
r = requests.get(
f"{BASE}/api/data",
headers=headers,
params={"symbol": "CL=F", "period": "3M"}
)
data = r.json()
print(f"Got {len(data['candles'])} candles for {data['name']}")
# Check rate limit remaining
print(r.headers.get("X-RateLimit-Remaining"))
# Download CSV
r2 = requests.get(
f"{BASE}/api/export",
headers=headers,
params={"symbol": "GC=F", "period": "1Y", "format": "csv"}
)
with open("gold_1y.csv", "wb") as f:
f.write(r2.content)
const API_KEY = 'YOUR_API_KEY';
const BASE = 'https://commoditynode.com';
// Fetch crude oil candles
const res = await fetch(
`${BASE}/api/data?symbol=CL%3DF&period=3M`,
{ headers: { 'x-api-key': API_KEY } }
);
const data = await res.json();
console.log(`${data.name}: ${data.candles.length} candles`);
console.log('Remaining:', res.headers.get('X-RateLimit-Remaining'));
// All prices (public, no key needed)
const prices = await fetch(`${BASE}/api/prices`)
.then(r => r.json());
console.log(prices.crude_oil?.price);