OilPriceAPI Docs
GitHub
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
    • Natural Gas Intelligence
  • Commodities

    • List Commodities
    • Get Commodity Details
  • 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
  • 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
    • 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
    • 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
    • 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

Batch Prices

Bulk lookup for multiple commodity codes in one request.

POST/v1/prices/batch

Request

curl -X POST "https://api.oilpriceapi.com/v1/prices/batch" \
  -H "Authorization: Token YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "codes": ["WTI_USD", "BRENT_CRUDE_USD", "NATURAL_GAS_USD"],
    "fields": ["price", "formatted", "currency", "created_at"]
  }'
FieldTypeRequiredDescription
codesarray[string]YesCommodity codes to fetch. Keep batches to the smallest set your workflow needs.
fieldsarray[string]NoOptional response field selection.
currencystringNoSupported output currency, for example USD, EUR, or GBP where conversion is enabled.

Response

{
  "status": "success",
  "data": {
    "prices": [
      {
        "code": "WTI_USD",
        "price": 74.52,
        "formatted": "$74.52",
        "currency": "USD",
        "created_at": "2026-07-15T14:30:00.000Z"
      }
    ],
    "missing_codes": []
  }
}

Error Cases

StatusWhen
400Missing codes, invalid code, or malformed JSON body
401Missing or invalid API key
402Quota exhausted or historical depth unavailable on the current plan
429Rate limit exceeded

Quota Notes

Batch pricing is quota-based, not feature-gated. The exact quota accounting can vary by account configuration, so production integrations should monitor X-RateLimit-* headers and treat 402 as a non-retryable plan/quota failure.

Related

  • Latest Prices
  • Currency Conversion
  • SDK Pagination and Error Handling
Last Updated: 7/16/26, 1:53 PM
Prev
Historical Prices
Next
Excel Latest Price Gateway