Is there a gasoline price API?
OilPriceAPI is a gasoline price API: daily US per-state retail gasoline plus real-time RBOB wholesale (GASOLINE_RBOB_USD) over one REST endpoint, with a free tier and Python/JavaScript SDKs.
Get a state's pump-level retail average or the RBOB wholesale benchmark as JSON — for fuel-cost tools, retail analytics, and hedging.
US per-state retail gasoline
Daily retail gasoline averages for every US state (GASOLINE_RETAIL_STATE_<XX>_USD).
Real-time RBOB wholesale
RBOB gasoline (GASOLINE_RBOB_USD) updated through the trading day for hedging and spreads.
One REST endpoint
GET /v1/prices/latest?by_code=GASOLINE_RETAIL_STATE_CA_USD — JSON, one API key.
History included
Daily/weekly/monthly history for retail and RBOB series.
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=GASOLINE_RETAIL_STATE_CA_USDCalifornia retail gasoline (daily state average).
GET /v1/prices/latest?by_code=GASOLINE_RBOB_USDRBOB wholesale gasoline (real-time).
Frequently asked questions
Does the gasoline API cover US states?
Yes — OilPriceAPI serves daily retail gasoline averages for every US state (e.g. GASOLINE_RETAIL_STATE_CA_USD), plus real-time RBOB wholesale.
What's the difference between retail and RBOB?
Retail (per-state) is the pump-level daily average; RBOB (GASOLINE_RBOB_USD) is the wholesale gasoline futures benchmark used for hedging and crack spreads. Both are available.
How fresh is the gasoline data?
Per-state retail updates daily; RBOB wholesale updates through the trading day.
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
gasoline-price-api