OilPriceAPI Docs
Quick Start
API Reference
  • SDKs and languages
  • Tutorials
  • Articles
  • Documentation directory
  • Quick reference
  • API explorer
  • FAQ
  • Changelog
  • Status
  • Dashboard
GitHub
Quick Start
API Reference
  • SDKs and languages
  • Tutorials
  • Articles
  • Documentation directory
  • Quick reference
  • API explorer
  • FAQ
  • Changelog
  • Status
  • Dashboard
GitHub
  • Interactive Explorer

    • Interactive API Explorer
  • Price Data

    • API Reference
    • Get Latest Prices
    • Historical Prices
    • Batch Prices
    • Excel Latest Price Gateway
    • Price Widget Endpoints
    • Price Utility Endpoints
    • Demo API (No Authentication)
    • Natural Gas Intelligence
  • Commodities

    • List Commodities
    • Get Commodity Details
    • Data Publication & Collection Schedules
  • AI Agents (MCP)

    • Get Market Brief
    • Subscriptions / Watches
    • Agent Subscriptions with MCP
  • Marine Fuels

    • Marine Fuel API
    • List Marine Fuel Ports
    • Get Port Details with Prices
    • Bunker Fuels
    • Maritime Fuels
  • Fuel Surcharges

    • Fuel Surcharge API
  • Premium Endpoints

    • All Prices API - One Call, All Commodities
    • Cushing Oil Storage Intelligence API
    • Drilling Intelligence API
    • Marine Fuels API
    • ICE Brent Futures API
    • Benchmark Close
    • Aviation Fuel Pilot
  • Spreads & Margins

    • Spreads & Margins
    • Crack Spreads
    • European Gasoil Crack
    • Basis Spreads
    • Refining Margins
    • Curve Structure
    • Physical Premiums
  • Market Indicators

    • Market Indicators
    • Fuel Switching
    • Price Context
    • Storage Analytics
    • CFTC Positioning
    • Congressional Trades
    • Market Annotations
  • Futures

    • Futures API
    • ICE Brent Futures
    • ICE WTI Futures
    • Continuous Futures (Brent, WTI)
    • ICE Gas Oil Futures
    • NYMEX Natural Gas Futures
    • ICE EUA Carbon Futures
    • EU Carbon Futures
    • TTF Gas Futures
    • LNG JKM Futures
    • UK Carbon Futures
  • Dark Data (Premium)

    • Energy Intelligence API
    • Rig Counts
    • Well Permits
    • Well Production Beta
    • Drilling Intelligence (Public)
    • Oil Inventories
    • OPEC Production
    • Drilling Productivity
    • Forecasts (STEO)
  • Well Production (Beta)

    • Well Production Data
    • Well Production API Reference
  • Analytics

    • Analytics API
  • Webhooks API

    • Webhooks API Reference
    • Webhook Endpoint Reference
  • Alerts

    • Price Alerts API
  • Account & Billing

    • Account API
    • API Keys
    • Subscriptions
    • Organizations

Price Widget Endpoints

Widget endpoints support lightweight dashboard and embeddable display workflows.

Endpoints

MethodEndpointPurpose
GET/v1/prices/widgetGeneral widget payload
GET/v1/prices/widget/dieselDiesel-focused widget payload
GET/v1/prices/widget/pingWidget health check

General Widget

curl "https://api.oilpriceapi.com/v1/prices/widget"

The payload is a fixed basket keyed by commodity, not wrapped in status/data, and it does not take by_code:

{
  "brent_crude_usd": 88.1,
  "wti_crude_usd": 83.44,
  "natural_gas_usd": 2.89,
  "diesel_usd": 4.34,
  "brent_change": -0.22,
  "wti_change": 0.0,
  "natgas_change": 0.0,
  "updated_at": "2026-08-30T16:31:03Z"
}

*_change is the 24-hour percentage move computed the same way as changes["24h"] on Latest Prices: it is null when no comparison price exists inside the permitted lookback, never a figure taken from an older row. diesel_usd has no change field. Responses are cached for 5 minutes.

Diesel Widget

curl "https://api.oilpriceapi.com/v1/prices/widget/diesel" \
  -H "Authorization: Token YOUR_API_KEY"

Use this for fleet, logistics, and fuel-surcharge widgets that need diesel-specific labeling.

Widget Ping

curl "https://api.oilpriceapi.com/v1/prices/widget/ping" \
  -H "Authorization: Token YOUR_API_KEY"

Use ping for lightweight monitoring of the widget service path. Do not use it as a substitute for the public API status page.

Data Rights

Widgets that display prices publicly can trigger display or redistribution review. Check Data Usage Policy before embedding price data in public pages, customer portals, or downstream products.

Error Cases

StatusWhen
400Invalid widget parameter
401Missing or invalid API key
402Quota exhausted or plan not enabled
429Rate limit exceeded
Last Updated: 9/5/26, 8:35 PM
Prev
Excel Latest Price Gateway
Next
Price Utility Endpoints