What API has historical oil prices?

OilPriceAPI is a historical oil prices API: pull decades of WTI and Brent crude history — WTI spot goes back to 1986 and Brent to 1987, with intraday (hourly / raw-tick) crude back to 2019 — through hourly, daily, weekly, and monthly REST endpoints, with a free tier and Python/JavaScript SDKs.

Built for backtests, charts, and research — consistent JSON time series you can page through by interval.

Historical Oil Prices API capabilities

40+ years of WTI history

WTI spot (WTI_SPOT_USD) daily history goes back to 1986 — four decades for long-horizon backtests. The NYMEX front-month code WTI_USD starts in October 2019.

Intraday, hourly, daily, weekly, monthly

Choose the granularity per request — from raw intraday ticks and hourly (interval=1h) through daily, weekly, and monthly. Intraday crude history back to 2019.

WTI, Brent & more

Historical series for both crude benchmarks and other energy and commodity codes where available.

Clean JSON time series

Consistent, paginated JSON arrays that load straight into pandas, R, or a charting library.

Free tier to start

7-day trial · 10,000 requests · then Free plan: 50 requests/day, no expiry

Official SDKs

Production-ready SDKs for Python, Node.js, Go, and PHP.

Endpoints you'll use

GET /v1/prices/history/day?by_code=WTI_USD

Daily WTI history.

GET /v1/prices/history/week?by_code=BRENT_CRUDE_USD

Weekly Brent history.

GET /v1/prices/history/month?by_code=WTI_USD

Monthly WTI history for long-range charts.

GET /v1/prices/past_month?by_code=WTI_USD&interval=1h

Hourly (intraday) WTI for the past month. Use interval=raw for tick-level data on windows up to 30 days.

Frequently asked questions

How far back does the historical oil price data go?

OilPriceAPI's WTI spot history (WTI_SPOT_USD) goes back to 1986 — more than 40 years. Brent and other benchmarks also have multi-year history.

What intervals are available?

Raw intraday ticks, hourly (1h), daily, weekly, and monthly. Pass an interval parameter — e.g. /v1/prices/past_month?by_code=WTI_USD&interval=1h for hourly WTI. Raw tick-level data (interval=raw) is available for windows up to 30 days; hourly and coarser go back across the full history.

Do you have intraday / hourly historical crude oil data?

Yes. We collect intraday WTI and Brent (many points per day) and retain it back to 2019, so you can pull hourly historical crude (interval=1h) or raw tick-level series (interval=raw, windows up to 30 days) — not just daily closes. Example: /v1/prices/past_month?by_code=WTI_USD&interval=1h.

What format is the historical data?

JSON time series over a REST endpoint — easy to load into pandas, R, spreadsheets, or a charting library.

Is historical data available on the free tier?

New accounts can evaluate historical endpoints during the trial. Free plan: 50 requests/day, with no expiry. New accounts start with a 7-day trial: 10,000 requests, full API (except licensed datasets: aviation fuel pilot), no card. After the trial, you automatically continue on the Free plan. The Free plan is hard-capped and never billed. Historical access after the trial varies by series and account entitlement; see pricing for the current paid plans.