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 Utility Endpoints

These endpoints support specific product workflows around the core price API. Prefer /v1/prices/latest and /v1/prices/historical for new general-purpose integrations unless a workflow below matches your use case.

Endpoints

MethodEndpointPurpose
GET/v1/prices/crude-oilCrude-oil focused latest-price helper
GET/v1/prices/data-connectorConnector payload used by data-connector integrations
GET/v1/prices/historyAlias — serves /v1/prices/historical directly (no redirect)
GET/v1/prices/metricsPrice API metrics payload

/v1/prices/crude-oil

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

Returns a crude-focused price payload for WTI, Brent, and related crude benchmarks. Benchmarks resolve independently, so the payload can carry a per-benchmark error alongside successful ones (e.g. "brent": {"error": "No price data found"} while WTI resolves) — check each benchmark's entry before reading its price.

/v1/prices/data-connector

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

Used by connector workflows such as the Ship & Bunker connector. Treat the shape as integration-specific and pin your downstream parser to the fields you actually use.

Requires organization membership: an API key that does not belong to an organization receives 403 Forbidden with error code ORG_REQUIRED, regardless of plan. Contact support to have your account attached to an organization if your integration needs this endpoint.

/v1/prices/history

curl "https://api.oilpriceapi.com/v1/prices/history?by_code=WTI_USD&start_date=2026-01-01&end_date=2026-01-31" \
  -H "Authorization: Token YOUR_API_KEY"

/v1/prices/history is a direct-serve alias for the canonical Historical Prices endpoint: it runs the same action and returns the same 200 response — verified live, the two bodies are byte-identical for identical parameters. It exists so clients that guessed the singular path still work.

It used to answer with a 301 redirect; the near-miss aliases were changed to serve their canonical actions directly (api#7098) because the redirect rebuilt the caller's query string — including ?api_key= credentials — into the Location response header. There is no redirect to follow anymore, so -L is unnecessary (though harmless). Use /v1/prices/historical in new integrations.

/v1/prices/metrics

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

Returns price API metrics for monitoring and internal operational dashboards.

Do Not Use Yet

GET /v1/prices/export is intentionally not documented as a working endpoint here because the current backend issue list records a hard 500. Wait for the backend fix before building exports.

Error Cases

StatusWhen
400Missing required query parameter or invalid code
401Missing or invalid API key
402Quota exhausted
403ORG_REQUIRED — /v1/prices/data-connector called with a key that has no organization membership
429Rate limit exceeded
Last Updated: 9/11/26, 11:08 PM
Prev
Price Widget Endpoints
Next
Demo API (No Authentication)