Where can I get a diesel price API?
OilPriceAPI is a diesel price API: daily US per-state retail diesel, EU country retail diesel, and ULSD / ICE gasoil (10ppm) benchmarks over one REST endpoint, with a free tier and Python/JavaScript SDKs.
Pull a state's retail diesel average or a wholesale gasoil benchmark as JSON — useful for logistics, fuel-cost, and freight models.
US per-state retail diesel
Daily retail diesel averages by US state (DIESEL_RETAIL_STATE_<XX>_USD) for logistics and fuel-cost tooling.
EU country diesel
Weekly national retail diesel averages for EU countries (DIESEL_RETAIL_<CC>_EUR).
ULSD & gasoil benchmarks
Wholesale ULSD (ULSD_DIESEL_USD) and ICE/Singapore gasoil (10ppm) for procurement and hedging.
One REST endpoint
GET /v1/prices/latest?by_code=DIESEL_RETAIL_STATE_TX_USD — JSON, one API key.
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, Node.js, Go, and PHP.
Looking for UK petrol and diesel or EU country-average coverage? See the UK and European fuel price API guide.
Endpoints you'll use
GET /v1/prices/latest?by_code=DIESEL_RETAIL_STATE_TX_USDTexas retail diesel (daily state average).
GET /v1/prices/latest?by_code=GASOIL_USDICE gasoil (10ppm ULSD benchmark).
Frequently asked questions
Does the diesel API cover US states?
Yes — OilPriceAPI serves daily retail diesel averages for every US state (e.g. DIESEL_RETAIL_STATE_TX_USD), plus EU country diesel and wholesale ULSD/gasoil benchmarks.
What's the difference between retail and benchmark diesel?
Retail (per-state/country) is the pump-level daily average; ULSD/gasoil (e.g. GASOIL_USD, SINGAPORE_GASOIL_USD) are wholesale 10ppm benchmarks used for procurement and hedging. Both are available.
How fresh is the data?
US retail state series update daily, while EU country series update weekly; wholesale gasoil benchmarks update through the trading day. Read the source timestamp returned with each value.
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
diesel-price-api