What API has historical oil prices?

OilPriceAPI is a historical oil prices API: pull decades of WTI and Brent crude history — WTI goes back to 1983, 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.

40+ years of WTI history

WTI (WTI_USD) historical data goes back to 1983 — over four decades for long-horizon backtests.

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 plus 20+ other energy and commodity codes.

Clean JSON time series

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

Free tier to start

A 7-day trial with 10,000 requests, no credit card; paid plans from $49/month.

Official SDKs

Production-ready SDKs for Python, JavaScript/Node.js, Java, C#, and Ruby.

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 history goes back to 1983 — 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?

Yes — the 7-day free trial (10,000 requests, no credit card) includes historical endpoints; paid plans start at $49/month.