Prices

Get historical prices with pagination

Changed on

Retrieve historical price data with filtering and pagination

get/v1/prices

Request

  • Base URL
    https://api.oilpriceapi.com
  • Auth
    API key in header Authorization

Query parameters

by_codestring
Example:JET_FUEL_USD

Commodity code

by_type'spot_price' | 'daily_average_price'
Example:spot_price

Price type

pageinteger
Example:1

Page number for pagination

per_pageinteger
Example:100

Number of items per page

interval'raw' | 'hourly' | '1h' | 'daily' | '1d' | 'weekly' | '1w' | 'monthly' | '1m'
Example:daily

Aggregation interval. When set, returns one price per interval period instead of raw tick data.

Response

Historical price data

Example response

{
  "prices": [
    {
      "benchmark": {
        "id": "nymex_wti_front_month",
        "instrument_type": "front_month_futures",
        "quote_type": "indicative_last_price",
        "unit": "barrel",
        "contract_month": "2026-12",
        "roll_method": "explicit_contract_curve",
        "roll_signal": "volume"
      },
      "price": 75.42,
      "formatted": "$75.42",
      "currency": "USD",
      "code": "BRENT_CRUDE_USD",
      "contract_month": "2026-12",
      "created_at": "2025-01-20T10:30:00.000Z",
      "updated_at": "2025-01-20T10:30:00.000Z",
      "type": "spot_price",
      "change_24h": 0.74,
      "change_24h_percent": 1.25
    }
  ],
  "meta": {
    "current_page": 1,
    "total_pages": 10,
    "total_count": 250,
    "per_page": 25
  }
}

Changes

    • breaking

      removed the enum value ALUMINUM_USD from the query request parameter by_code

    • breaking

      removed the enum value AMMONIA_USD from the query request parameter by_code

    • breaking

      removed the enum value ASPHALT_USD from the query request parameter by_code

    • breaking

      removed the enum value AZERI_LIGHT_USD from the query request parameter by_code

    • breaking

      removed the enum value BAKKEN_DUC_WELLS from the query request parameter by_code

    • breaking

      removed the enum value BAKKEN_FRAC_SPREADS from the query request parameter by_code

    • breaking

      removed the enum value BIODIESEL_USD from the query request parameter by_code

    • breaking

      removed the enum value BRENT_CRUDE_USD from the query request parameter by_code

    • breaking

      removed the enum value CANADA_RIG_COUNT from the query request parameter by_code

    • breaking

      removed the enum value CAPP_COAL_USD from the query request parameter by_code

    • breaking

      removed the enum value CME_COAL_USD from the query request parameter by_code

    • breaking

      removed the enum value COAL_USD from the query request parameter by_code

    • breaking

      removed the enum value COKING_COAL_USD from the query request parameter by_code

    • breaking

      removed the enum value COPPER_USD from the query request parameter by_code

    • breaking

      removed the enum value CUSHING_STORAGE from the query request parameter by_code

    • breaking

      removed the enum value DIESEL_USD from the query request parameter by_code

    • breaking

      removed the enum value DUBAI_CRUDE_USD from the query request parameter by_code

    • breaking

      removed the enum value DUTCH_TTF_EUR from the query request parameter by_code

    • breaking

      removed the enum value DUTCH_TTF_NATURAL_GAS_USD from the query request parameter by_code

    • breaking

      removed the enum value EAGLEFORD_DUC_WELLS from the query request parameter by_code

    • breaking

      removed the enum value EAGLEFORD_FRAC_SPREADS from the query request parameter by_code

    • breaking

      removed the enum value ETHANOL_USD from the query request parameter by_code

    • breaking

      removed the enum value ETHYLENE_USD from the query request parameter by_code

    • breaking

      removed the enum value EUR_NOK from the query request parameter by_code

    • breaking

      removed the enum value EUR_USD from the query request parameter by_code

    • breaking

      removed the enum value EU_CARBON_EUR from the query request parameter by_code

    • breaking

      removed the enum value GASOLINE_RBOB_USD from the query request parameter by_code

    • breaking

      removed the enum value GASOLINE_USD from the query request parameter by_code

    • breaking

      removed the enum value GBP_USD from the query request parameter by_code

    • breaking

      removed the enum value GOLD_AM_EUR from the query request parameter by_code

    • breaking

      removed the enum value GOLD_AM_GBP from the query request parameter by_code

    • breaking

      removed the enum value GOLD_AM_USD from the query request parameter by_code

    • breaking

      removed the enum value GOLD_PM_EUR from the query request parameter by_code

    • breaking

      removed the enum value GOLD_PM_GBP from the query request parameter by_code

    • breaking

      removed the enum value GOLD_PM_USD from the query request parameter by_code

    • breaking

      removed the enum value GOLD_USD from the query request parameter by_code

    • breaking

      removed the enum value HEATING_OIL_USD from the query request parameter by_code

    • breaking

      removed the enum value HFO_380_USD from the query request parameter by_code

    • breaking

      removed the enum value ILLINOIS_COAL_USD from the query request parameter by_code

    • breaking

      removed the enum value INTERNATIONAL_RIG_COUNT from the query request parameter by_code

    • breaking

      removed the enum value IRON_ORE_USD from the query request parameter by_code

    • breaking

      removed the enum value JET_A1_NWE_USD from the query request parameter by_code

    • breaking

      removed the enum value JET_FUEL_USD from the query request parameter by_code

    • breaking

      removed the enum value JKM_LNG_USD from the query request parameter by_code

    • breaking

      removed the enum value LEAD_USD from the query request parameter by_code

    • breaking

      removed the enum value METHANOL_USD from the query request parameter by_code

    • breaking

      removed the enum value MGO_05S_USD from the query request parameter by_code

    • breaking

      removed the enum value NAPHTHA_USD from the query request parameter by_code

    • breaking

      removed the enum value NATURAL_GAS_GBP from the query request parameter by_code

    • breaking

      removed the enum value NATURAL_GAS_STORAGE from the query request parameter by_code

    • breaking

      removed the enum value NATURAL_GAS_USD from the query request parameter by_code

    • breaking

      removed the enum value NEWCASTLE_COAL_USD from the query request parameter by_code

    • breaking

      removed the enum value NICKEL_USD from the query request parameter by_code

    • breaking

      removed the enum value NORTH_DAKOTA_WELL_PERMITS from the query request parameter by_code

    • breaking

      removed the enum value NYMEX_APPALACHIAN_USD from the query request parameter by_code

    • breaking

      removed the enum value NYMEX_WESTERN_RAIL_USD from the query request parameter by_code

    • breaking

      removed the enum value OKLAHOMA_WELL_PERMITS from the query request parameter by_code

    • breaking

      removed the enum value PALLADIUM_USD from the query request parameter by_code

    • breaking

      removed the enum value PERMIAN_DUC_WELLS from the query request parameter by_code

    • breaking

      removed the enum value PERMIAN_FRAC_SPREADS from the query request parameter by_code

    • breaking

      removed the enum value PLATINUM_USD from the query request parameter by_code

    • breaking

      removed the enum value POLYETHYLENE_USD from the query request parameter by_code

    • breaking

      removed the enum value POLYPROPYLENE_USD from the query request parameter by_code

    • breaking

      removed the enum value PRB_COAL_USD from the query request parameter by_code

    • breaking

      removed the enum value SILVER_FIX_EUR from the query request parameter by_code

    • breaking

      removed the enum value SILVER_FIX_GBP from the query request parameter by_code

    • breaking

      removed the enum value SILVER_FIX_USD from the query request parameter by_code

    • breaking

      removed the enum value SILVER_USD from the query request parameter by_code

    • breaking

      removed the enum value TAPIS_CRUDE_USD from the query request parameter by_code

    • breaking

      removed the enum value TEXAS_WELL_PERMITS from the query request parameter by_code

    • breaking

      removed the enum value TIN_USD from the query request parameter by_code

    • breaking

      removed the enum value UK_CARBON_GBP from the query request parameter by_code

    • breaking

      removed the enum value ULSD_DIESEL_USD from the query request parameter by_code

    • breaking

      removed the enum value URALS_CRUDE_USD from the query request parameter by_code

    • breaking

      removed the enum value URANIUM_USD from the query request parameter by_code

    • breaking

      removed the enum value UREA_USD from the query request parameter by_code

    • breaking

      removed the enum value USD_NOK from the query request parameter by_code

    • breaking

      removed the enum value US_RIG_COUNT from the query request parameter by_code

    • breaking

      removed the enum value VLSFO_USD from the query request parameter by_code

    • breaking

      removed the enum value WCS_CRUDE_USD from the query request parameter by_code

    • breaking

      removed the enum value WTI_USD from the query request parameter by_code

    • breaking

      removed the enum value ZINC_USD from the query request parameter by_code

    • info

      added the optional property // to the response with the status

    • info

      added the optional property // to the response with the status