Futures
Premium

Get historical WTI futures data

Changed on

Canonical instrument-generic path (#4170). Legacy alias: /v1/futures/ice-wti/historical (identical response).

get/v1/futures/wti/historical

Request

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

Query parameters

contract_monthstring
Example:2026-09

Specific contract month (e.g., "2026-03")

fromstring date
Example:2026-09-01

Start of the window (ISO date). Omit both from and to for the last 30 days. from/to are the only window parameters this operation honours; period and days are discarded silently and were previously documented here in error. Verified against production 2026-10-09 (website-clean#2305).

tostring date
Example:2026-10-09

End of the window (ISO date). Defaults to today.

interval'daily' | 'weekly' | 'monthly'
Example:daily

Server-side aggregation. weekly and monthly replace trading_date with period_start/period_end and add avg_close and trading_days. hourly is rejected with 400 on this operation.

Response

Historical WTI futures data

statusstring

Example response

{
  "status": "success",
  "data": [
    {
      "contract_month": "M1",
      "price": 82.45
    }
  ]
}

Changes

    • breaking

      removed the enum value hourly from the query request parameter interval

    • warning

      deleted the query request parameter period

    • info

      added the new optional query request parameter from

    • info

      added the new optional query request parameter to

    • info

      added the non-success response with the status