Skip to main content

API Reference Overview

Browse our complete REST API endpoint directory organized by category. Simple JSON responses with powerful features for energy data integration.

Code
Token Auth
15+
API Endpoints
Time
Source Timestamps
JSON
Structured Errors

Choose the right path first

Not sure which endpoint family fits your workflow?

Use the workflow router to separate latest prices, historical rows, futures contracts, Excel, source-specific connector work, and plan-fit checks before building around an endpoint.

Open workflow router

What Makes Our API Different

Built for developers who need reliable energy market data without the complexity of traditional data vendors.

Fast & Reliable

Consistent JSON responses with source timestamps and freshness metadata where available. Enterprise accounts can include contractual support and data-source review.

Developer Friendly

Clean REST API with consistent JSON responses. Official SDKs for Python and Node.js. Comprehensive error handling and retry logic built-in.

Comprehensive Data

Commodity, futures, refined product, and drilling-intelligence endpoints organized by code and category. Availability, history, and display rights depend on the selected package and source.

Browse Endpoints by Category

Click on any endpoint to view detailed documentation including parameters, response schemas, and code examples.

Price Data Endpoints

Latest-available and historical commodity price data with timestamps

GET/v1/prices/latest

Returns latest-available prices for commodities or filtered by code/category, with timestamps when available.

Response: JSON object with price, currency, unit, change percentage, and timestamp
GET/v1/prices/{commodity_code}

Get the latest-available price for a specific commodity (e.g., WTI_USD, BRENT_CRUDE_USD, NATURAL_GAS_USD). Fast single-commodity lookups.

Example: /v1/prices/WTI_USD
GET/v1/prices/historical

Time-series data for backtesting and analysis. Query by date range (2014-present), interval (day/week/month), and commodity.

Parameters: start_date, end_date, by_code, interval
Understand historical row semantics
GET/v1/prices/by-category

Get all prices within a category (e.g., crude_oil, natural_gas, refined_products). Useful for building category-specific dashboards.

Categories: crude_oil, natural_gas, refined_products, metals

Futures Data Endpoints

Product-scoped futures routes with contract, source, and freshness metadata

GET/v1/futures/ice-brent

Current Brent crude futures curve with contract prices, volume, open interest, and source metadata where available.

Route family: add /historical, /ohlc, /intraday, /spreads, /curve, or /spread-history
GET/v1/futures/ice-brent/historical

Historical Brent futures data with 2+ years of OHLC data. Perfect for backtesting spread trading strategies.

Coverage: 500+ trading days with full OHLC + volume data
GET/v1/futures/ice-wti

Current WTI crude futures curve with contract-month metadata and trading statistics where available.

GET/v1/futures/natural-gas/historical

Historical natural gas futures data (Henry Hub). Essential for energy trading and risk analysis.

GET/v1/futures/ice-gasoil

ICE gasoil futures contract data. European diesel benchmark pricing.

GET/v1/futures/lng-jkm

JKM LNG 12-contract delayed/reference futures curve. When reference fallback is active, metadata reports coverage_status=full_curve_reference and source_semantics=delayed_reference_non_official.

Source note: Reference curve data, not official CME settlement data.

Drilling Intelligence Endpoints

U.S. rig counts, basin data, and production metrics

GET/v1/drilling-intelligence/rig-count

Weekly Baker Hughes rig count data by basin, state, and rig type. Leading indicator for production trends.

Updated: Every Friday after Baker Hughes release
GET/v1/drilling-intelligence/basins

Production basin analytics including Permian, Eagle Ford, Bakken, and more. Rig counts, production, and DUC well inventory.

GET/v1/drilling-intelligence/duc-wells

Drilled but uncompleted (DUC) well inventory by basin. Key metric for understanding production capacity.

Authentication & Utilities

Token management and account information

POST/v1/auth/token

Generate API tokens for authentication. Requires email and password credentials.

GET/v1/account/usage

Check your current API usage, remaining requests, and billing period information.

GET/v1/commodities

List all available commodities with codes, names, and categories. Use this to discover available data.

Consistent Response Format

Success Response

All successful requests return this structure

{
  "status": "success",
  "data": {
    "price": 0,
    "currency": "USD",
    "unit": "barrel",
    "change": null,
    "created_at": "2026-01-01T00:00:00Z"
  }
}

Error Response

Errors include descriptive messages and codes

{
  "status": "error",
  "error": {
    "code": "INVALID_API_KEY",
    "message": "API token is invalid",
    "details": "Check your token"
  }
}

Frequently Asked Questions

What format does the API return?

All endpoints return JSON responses with a consistent structure. Successful responses include a "status" field set to "success" and a "data" object containing the requested information. Errors return "status": "error" with detailed error information.

How do I authenticate API requests?

Use token-based authentication. Include your API token in the Authorization header as "Token YOUR_API_TOKEN" with every request. You can generate tokens from your dashboard after signing up.

What rate limits apply?

Rate limits depend on your current plan tier. Check the pricing page and account dashboard for current trial terms, plan limits, and package rights. Rate limit information is included in response headers (X-RateLimit-Remaining, X-RateLimit-Reset).

Are there SDKs available?

Yes! We provide official SDKs for Python and Node.js with full TypeScript support. Both SDKs handle authentication, error handling, and retry logic automatically.

Can I test the API for free?

Yes. Sign up for a free account to test the API before upgrading. See the pricing page for current trial terms and plan limits.

Where is the full API documentation?

Complete technical documentation with detailed parameter references, response schemas, and interactive examples is available at docs.oilpriceapi.com. This page provides a high-level overview and endpoint directory.

Ready to Start Building?

Get your API key and test latest-available commodity price endpoints.

No credit card required to start • Token authentication • JSON responses