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

Spreads & Margins

Premium analytics endpoints for crack spreads, basis, refinery margin, curve structure, and physical premiums.

Access

Available on Developer and above, and during an active 7-day trial. Free-plan keys receive 403 with the message Calculated metrics require a paid plan (Developer and above).

Endpoints

FamilyEndpoints
Crack spreads/v1/spreads/crack, /historical, /all
European gasoil crack/v1/spreads/gasoil-crack
Basis/v1/spreads/basis, /historical, /all
Margins/v1/spreads/margin, /historical, /all
Curve structure/v1/spreads/curve-structure, /all
Physical premium/v1/spreads/physical-premium, /historical, /all

Common Parameters

ParameterTypeDescription
codestringSpread or market code where supported
datedateSnapshot date
start_date, end_datedateHistorical range (ISO 8601). from/to are not read; the default window is the last 30 days
limitintegerMaximum records

Common Response Shape

{
  "status": "success",
  "data": [
    {
      "code": "WTI_321_CRACK",
      "value": 24.15,
      "currency": "USD",
      "unit": "barrel",
      "period": "2026-07-15",
      "updated_at": "2026-07-15T14:30:00.000Z"
    }
  ]
}

Historical Coverage Fields

/v1/spreads/crack/historical returns two fields beside the series so you can see what was actually returned:

FieldDescription
coveragefrom, to, observations, and complete for the rows returned. period echoes what was requested; coverage describes what came back. Compare the two before assuming a widened window returned more data.
data_revised_atWhen the underlying price rows for the window were last modified. If it is later than the copy you hold, the history was restated — refetch.

Error Cases

StatusWhen
400Missing or invalid query parameter
401Missing or invalid API key
403Plan without calculated metrics (Free), or an expired trial
402Plan/quota issue

Data Rights

Spreads are derived analytics. Public display, redistribution, or downstream resale requires review under the Data Usage Policy.

Last Updated: 9/5/26, 8:35 PM
Next
Crack Spreads