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
    • 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
    • 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

List Commodities

Status: ✅ Available | 📋 Catalog

Get the full list of commodity codes available to your account with their details. Catalog availability can vary by dataset and plan.

GET/v1/commodities

Request

Headers

HeaderRequiredDescription
AuthorizationYesToken YOUR_API_KEY
AcceptNoapplication/json (default)

Query Parameters

ParameterTypeDescription
include_unavailablebooleanAlso list codes that are not backed by data, each with has_data: false and a reason (optional)

There are no server-side category, search, or active filters — to narrow the results, filter the returned array client-side. See Filtering client-side below.

Response

Success Response (200 OK)

data is an object with two keys: commodities (the array of commodity objects) and metadata (availability counts for the listing).

{
  "status": "success",
  "data": {
    "commodities": [
      {
        "code": "WTI_USD",
        "name": "West Texas Intermediate",
        "currency": "USD",
        "category": "crude_oil",
        "description": "West Texas Intermediate crude oil spot price",
        "unit": "barrel",
        "unit_description": "Price per barrel",
        "multiplier": 1,
        "validation": { "min": 0, "max": 500 },
        "price_change_threshold": 5.0,
        "data_source": null,
        "update_frequency": "realtime",
        "status": "available",
        "has_data": true,
        "sources": [
          {
            "label": "market_reporting",
            "role": "market_data",
            "publication": { "cadence": "continuous" },
            "collection": {
              "frequency": "sampled multiple times per hour on trading days"
            }
          }
        ]
      },
      {
        "code": "JET_FUEL_USD",
        "name": "Jet Fuel",
        "currency": "USD",
        "category": "refined_products",
        "description": "Kerosene-type jet fuel spot price",
        "unit": "gallon",
        "unit_description": "Price per gallon",
        "multiplier": 100,
        "validation": { "min": 1.5, "max": 8.0 },
        "price_change_threshold": 0.15,
        "data_source": null,
        "update_frequency": "weekday",
        "status": "available",
        "has_data": true,
        "sources": [
          {
            "label": "EIA",
            "role": "official_spot",
            "publication": { "cadence": "weekly_batch" },
            "collection": { "frequency": "daily at 21:00 UTC" }
          }
        ]
      }
    ],
    "metadata": {
      "availability": {
        "returned": 425,
        "unavailable_excluded": 101,
        "note": "101 codes are not backed by data (never published, withheld, or discontinued) and are excluded from this listing. Pass ?include_unavailable=true to list them with has_data: false and a reason."
      }
    }
  }
}

Response Fields

Each item in the data.commodities array has the following fields:

FieldTypeDescription
codestringCommodity code used in price requests (e.g. WTI_USD)
namestringHuman-readable name
currencystringQuote currency (USD, EUR, GBP, ...)
categorystringCategory slug (e.g. crude_oil, natural_gas)
descriptionstringLonger description of the instrument
unitstringUnit of measure (e.g. barrel, mmbtu)
unit_descriptionstringHuman-readable unit description
multipliernumberInternal storage multiplier (deprecated for client use)
validationobjectInternal sanity bounds (deprecated for client use): { "min": number, "max": number }
price_change_thresholdnumberInternal anomaly-flag threshold (deprecated for client use)
data_sourcestring | nullUnderlying source, when set
update_frequencystringObservation frequency of the series (e.g. daily, weekly, weekday, realtime, monthly). This is how often the source observes the market, not how often new values are published — superseded by sources[] and the publication schedules
statusstringAvailability status for the code (e.g. available)
has_databooleanWhether the code is backed by data you can actually fetch
sourcesarrayRolling out. Compact per-source cadence summary: label, role, publication.cadence, collection.frequency. Full publication/collection blocks live on GET /v1/commodities/{code}; human-readable schedules on the publication schedules page

When is a series updated?

update_frequency alone can mislead: a weekday series can still be published in weekly batches (EIA spot series are — typically Wednesdays, covering trading days through the prior Monday). Use the sources[] summary and the Data Publication & Collection Schedules page to see each source's publication cadence, typical lag, and how often we collect it.

Filtering client-side

The API returns the full catalog on every call. Filter data.commodities in your own code:

const res = await fetch("https://api.oilpriceapi.com/v1/commodities", {
  headers: { Authorization: "Token YOUR_API_KEY" },
});
const { data } = await res.json();
const commodities = data.commodities;

// Filter by category
const crudeOil = commodities.filter((c) => c.category === "crude_oil");

// Search by name or code (case-insensitive)
const query = "gas";
const matches = commodities.filter(
  (c) =>
    c.name.toLowerCase().includes(query) ||
    c.code.toLowerCase().includes(query),
);

Code Examples

Commodity Categories

Every item carries a category slug you can group or filter on. The catalog spans crude oil benchmarks, refined products, natural gas and LNG, coal, marine fuels, forex, metals, carbon, and upstream drilling intelligence. Common slugs include crude_oil and natural_gas. Because the API returns the full list, the simplest way to see the categories currently in use is to collect the distinct category values from the response:

const categories = [...new Set(data.commodities.map((c) => c.category))].sort();

Use Cases

1. Dynamic Price Dashboard

// Build a customizable dashboard
async function initializeDashboard() {
  const response = await fetch("https://api.oilpriceapi.com/v1/commodities", {
    headers: { Authorization: "Token YOUR_API_KEY" },
  });

  // The commodity array lives at data.commodities
  const { data } = await response.json();
  const commodities = data.commodities;

  // Let user select commodities to track
  const selectedCodes = await showCommodityPicker(commodities);

  // Start fetching prices for selected commodities
  startPriceUpdates(selectedCodes);
}

2. Validate User Input

def validate_commodity_request(requested_codes):
    """Validate commodity codes against the catalog."""

    response = requests.get(
        'https://api.oilpriceapi.com/v1/commodities',
        headers={'Authorization': 'Token YOUR_API_KEY'}
    )

    commodities = response.json()['data']['commodities']
    valid_codes = {c['code'] for c in commodities}

    invalid_codes = [code for code in requested_codes if code not in valid_codes]
    if invalid_codes:
        raise ValueError(f"Invalid commodity codes: {', '.join(invalid_codes)}")

    return True

3. Category-Based Analysis

// Analyze commodities by category (filter the full list client-side)
async function analyzeByCategory(category) {
  const response = await fetch("https://api.oilpriceapi.com/v1/commodities", {
    headers: { Authorization: "Token YOUR_API_KEY" },
  });

  const { data } = await response.json();
  const commodityCodes = data.commodities
    .filter((c) => c.category === category)
    .map((c) => c.code);

  // Fetch prices for all commodities in category
  const prices = await Promise.all(
    commodityCodes.map(async (code) => {
      const priceResponse = await fetch(
        `https://api.oilpriceapi.com/v1/prices/latest?by_code=${code}`,
        { headers: { Authorization: "Token YOUR_API_KEY" } },
      );
      return priceResponse.json();
    }),
  );

  // Calculate category statistics
  return calculateCategoryStats(prices);
}

Best Practices

  1. Cache commodity list - Commodity details rarely change, cache for 24 hours
  2. Validate before requesting - Always check valid codes before making price requests
  3. Filter client-side - The API returns the full list; filter data.commodities by category, name, or code in your own code
  4. Build a code map - Key the array by code for fast lookups
  5. Check publication cadence - Before alerting on "stale" data, check the code's publication schedule: batch-published series are days behind real time by design

Related Endpoints

  • GET /v1/prices/latest - Get current prices using these commodity codes
  • GET /v1/commodities/{code} - Full per-source publication/collection metadata for one commodity
  • Data Publication & Collection Schedules - When each source publishes and how often we collect
  • GET /v1/drilling-intelligence/summary - Drilling intelligence overview
  • GET /v1/marine-ports - Marine fuel port data
Last Updated: 7/22/26, 1:28 AM
Next
Get Commodity Details