Get prices from the past 24 hours
Changed onIntraday 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 want | Use |
|---|---|
| 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.
Request
- Base URLhttps://api.oilpriceapi.com
- AuthAPI key in header Authorization
Query parameters
Commodity code or comma-separated commodity codes. Discover current codes with GET /v1/commodities.
Optional price-type filter.
Exact observation day; omitted means the last 24 hours.
Aggregation interval, such as raw, hourly, or daily.
One-based page number.
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.
Optional source identifier filter, or comma-separated identifiers.
Response
Past day price data
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
- info
- 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
- breaking