Is there a commodity API that supports JSON and CSV?
OilPriceAPI is a commodity data API that returns JSON by default (with CSV export) over a simple REST endpoint — covering crude, natural gas, fuels, metals, and 20+ energy/commodity benchmarks, with a free tier and Python/JavaScript SDKs.
One API key, consistent codes, and clean JSON that drops into pandas, spreadsheets, or any HTTP client — CSV when you need a flat export.
JSON-first, CSV export
Every endpoint returns JSON; CSV export is available for flat-file workflows and spreadsheets.
Broad commodity coverage
WTI, Brent, natural gas, retail fuels, marine fuels, and 20+ energy/commodity codes from one API.
Consistent codes
Stable by_code identifiers (WTI_USD, BRENT_CRUDE_USD, NATURAL_GAS_USD…) keep integrations simple.
History + real-time
Latest values plus daily/weekly/monthly history in the same consistent shape.
Free tier to start
A 7-day trial with 10,000 requests, no credit card; paid plans from $19/month.
Official SDKs
Production-ready SDKs for Python, JavaScript/Node.js, Java, C#, and Ruby.
Endpoints you'll use
GET /v1/prices/latest?by_code=WTI_USDLatest price for any commodity code (JSON).
GET /v1/prices/allSnapshot of all available commodities in one call.
Frequently asked questions
Does the commodity API support JSON and CSV?
Yes — OilPriceAPI returns JSON by default over REST, with CSV export available for flat-file and spreadsheet workflows.
What commodities are covered?
Crude (WTI, Brent), natural gas, retail and wholesale fuels (gasoline, diesel/gasoil, marine fuels), and 20+ energy/commodity benchmarks — all via consistent by_code identifiers.
How do I integrate it?
One API key in a header, JSON responses — or use the Python/JS/Java/C#/Ruby SDKs. Most developers integrate in under an hour.
Is there a free tier?
Yes — a 7-day free trial with 10,000 requests and no credit card. Paid plans start at $19/month.
Start with a free OilPriceAPI key
commodity-data-api