Prices

Get prices from the past 24 hours

Changed on

Intraday endpoint: every raw point recorded in the last 24 hours (or, with at=YYYY-MM-DD, for one exact observation day).

Endpoint selection rule

You wantUse
Intraday detail for a single day/v1/prices/past_day
A multi-day series, one point per day/v1/prices/historical (start_date, end_date, per_page)
The most recent page of raw points in a window/v1/prices/past_week, /v1/prices/past_month

past_week / past_month are capped at 100 raw points per page. For any series stored more often than it is assessed (all marine/bunker codes are hourly snapshots of a once-daily assessment), those 100 points cover only ~4-5 calendar days — use /v1/prices/historical for a full daily series.

Pagination applies to every response, including cache hits. Raw pages default to 100 points and are capped at 100; aggregated intervals default to 500 and are capped at 500. Set page to traverse the matching window. data.metadata.pagination reports page, applied per_page, total_count, total_pages, has_next, and truncated. truncated means this page contains fewer rows than the entire matching window; it does not claim the underlying historical data is complete. X-Total, X-Per-Page, X-Page, X-Total-Pages, and Link expose the same navigation facts. Supply authentication separately when following Link URLs; query credentials are omitted from those URLs.

get/v1/prices/past_day

Request

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

Query parameters

by_code'ALUMINUM_USD' | 'AMMONIA_USD' | 'ASPHALT_USD' | 'AZERI_LIGHT_USD' | 'BAKKEN_DUC_WELLS' | 'BAKKEN_FRAC_SPREADS' | 'BIODIESEL_USD' | 'BRENT_CRUDE_USD' | 'CANADA_RIG_COUNT' | 'CAPP_COAL_USD' | 'CME_COAL_USD' | 'COAL_USD' | 'COKING_COAL_USD' | 'COPPER_USD' | 'CUSHING_STORAGE' | 'DIESEL_USD' | 'DUBAI_CRUDE_USD' | 'DUTCH_TTF_EUR' | 'DUTCH_TTF_NATURAL_GAS_USD' | 'EAGLEFORD_DUC_WELLS' | 'EAGLEFORD_FRAC_SPREADS' | 'ETHANOL_USD' | 'ETHYLENE_USD' | 'EUR_USD' | 'USD_NOK' | 'EUR_NOK' | 'EU_CARBON_EUR' | 'UK_CARBON_GBP' | 'GASOLINE_RBOB_USD' | 'GASOLINE_USD' | 'GBP_USD' | 'GOLD_USD' | 'SILVER_USD' | 'GOLD_AM_USD' | 'GOLD_AM_GBP' | 'GOLD_AM_EUR' | 'GOLD_PM_USD' | 'GOLD_PM_GBP' | 'GOLD_PM_EUR' | 'SILVER_FIX_USD' | 'SILVER_FIX_GBP' | 'SILVER_FIX_EUR' | 'HEATING_OIL_USD' | 'HFO_380_USD' | 'ILLINOIS_COAL_USD' | 'INTERNATIONAL_RIG_COUNT' | 'IRON_ORE_USD' | 'JET_A1_NWE_USD' | 'JET_FUEL_USD' | 'JKM_LNG_USD' | 'LEAD_USD' | 'MGO_05S_USD' | 'METHANOL_USD' | 'NAPHTHA_USD' | 'NICKEL_USD' | 'NATURAL_GAS_GBP' | 'NATURAL_GAS_STORAGE' | 'NATURAL_GAS_USD' | 'NEWCASTLE_COAL_USD' | 'NORTH_DAKOTA_WELL_PERMITS' | 'NYMEX_APPALACHIAN_USD' | 'NYMEX_WESTERN_RAIL_USD' | 'OKLAHOMA_WELL_PERMITS' | 'PALLADIUM_USD' | 'PERMIAN_DUC_WELLS' | 'PERMIAN_FRAC_SPREADS' | 'POLYETHYLENE_USD' | 'POLYPROPYLENE_USD' | 'PLATINUM_USD' | 'PRB_COAL_USD' | 'TAPIS_CRUDE_USD' | 'TIN_USD' | 'TEXAS_WELL_PERMITS' | 'ULSD_DIESEL_USD' | 'URALS_CRUDE_USD' | 'URANIUM_USD' | 'UREA_USD' | 'US_RIG_COUNT' | 'VLSFO_USD' | 'WCS_CRUDE_USD' | 'WTI_USD' | 'ZINC_USD'
Example:JET_FUEL_USD

Commodity code or comma-separated commodity codes. Discover current codes with GET /v1/commodities.

by_type'spot_price' | 'daily_average_price'
Example:spot_price

Optional price-type filter.

atstring date
Example:2026-09-04

Exact observation day; omitted means the last 24 hours.

intervalstring
Example:hourly

Aggregation interval, such as raw, hourly, or daily.

pageinteger
Example:2

One-based page number.

per_pageinteger
Example:25

Requested size. Raw applies at most 100 (default 100); aggregated intervals apply at most 500 (default 500). Read the applied size in data.metadata.pagination.per_page.

by_sourcestring
Example:eia_api

Optional source identifier filter, or comma-separated identifiers.

Response

Past day price data

status'success' required

Example response

{
  "data": {
    "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": 68.58,
        "formatted": "$68.58",
        "currency": "USD",
        "code": "WTI_USD",
        "requested_code": "ASPHALT_USD",
        "alias_of": "BITUMEN_USD",
        "contract_month": "2026-12",
        "created_at": "2026-07-03T13:43:01.099Z",
        "updated_at": "2026-07-03T13:43:01.099Z",
        "type": "spot_price",
        "unit": "barrel",
        "source": "market_reporting",
        "observed_at": "2026-07-13T12:00:00.000Z",
        "source_date": "2026-07-13",
        "as_of": "2026-07-13T12:00:00.000Z",
        "collected_at": "2026-07-15T21:00:00.000Z",
        "ingested_at": "2026-07-15T21:00:00.000Z",
        "age_days": 2,
        "price_type": "spot_price",
        "data_status": "current",
        "freshness": {
          "status": "current",
          "age_seconds": 275,
          "expected_max_age_seconds": 1800
        },
        "changes": {
          "24h": {
            "amount": 0.72,
            "percent": 1.06,
            "previous_price": 67.86
          },
          "7d": {
            "amount": 0.72,
            "percent": 1.06,
            "previous_price": 67.86
          },
          "30d": {
            "amount": 0.72,
            "percent": 1.06,
            "previous_price": 67.86
          },
          "90d": {
            "amount": 0.72,
            "percent": 1.06,
            "previous_price": 67.86
          }
        }
      }
    ]
  }
}

Changes

    • info

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

    • info

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

    • breaking

      the response property /// became nullable for the status

    • info

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

    • info

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

    • info

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