Skip to main content

Quick Start Guide

Get oil price data in your app in 5 minutes. No complex setup, just simple HTTP requests.

1

Get API Key

Sign up for free and get your API token instantly. No credit card required.

Get Free API Key
2

Make Request

Use simple HTTP requests to get real-time oil price data in JSON format.

GET /v1/prices/latest
3

Use Data

Integrate real-time oil prices into your trading app, dashboard, or analysis tool.

Production Ready

Basic Oil Price Request

Get current WTI and Brent crude oil prices with a single request

Request:

curl https://api.oilpriceapi.com/v1/prices/latest \
-H 'Authorization: Token YOUR_API_TOKEN' \
-H 'Content-Type: application/json'

Response:

{
  "status": "success",
  "data": {
    "WTI": {
      "price": 73.52,
      "currency": "USD",
      "unit": "barrel",
      "change": "+1.2%",
      "timestamp": "2024-07-20T18:30:00Z"
    },
    "BRENT": {
      "price": 76.88,
      "currency": "USD",
      "unit": "barrel",
      "change": "+0.8%",
      "timestamp": "2024-07-20T18:30:00Z"
    }
  }
}

JavaScript/Node.js Integration

Ready-to-use JavaScript code for web apps and Node.js backends

const response = await fetch('https://api.oilpriceapi.com/v1/prices/latest', {
  headers: {
    'Authorization': 'Token YOUR_API_TOKEN',
    'Content-Type': 'application/json'
  }
});

const data = await response.json();
console.log('WTI Price:', data.data.WTI.price);
console.log('Brent Price:', data.data.BRENT.price);

Python Integration

Perfect for data analysis, trading algorithms, and research

import requests

headers = {
    'Authorization': 'Token YOUR_API_TOKEN',
    'Content-Type': 'application/json'
}

response = requests.get('https://api.oilpriceapi.com/v1/prices/latest', headers=headers)
data = response.json()

print(f"WTI Price: {data['data']['WTI']['price']}")
print(f"Brent Price: {data['data']['BRENT']['price']}")

Popular API Endpoints

Most commonly used endpoints to get started quickly

GET /v1/prices/latest

Current oil prices (WTI, Brent, etc.)

GET /v1/prices/WTI

Specific commodity price data

GET /v1/prices/historical

Historical price data

GET /v1/drilling-intelligence

Rig counts & drilling data

Trusted by Energy Professionals

"We integrated OilPriceAPI into our trading platform in less than 2 hours. The documentation is excellent and the API is fast and reliable."

MR

Michael Rodriguez

Senior Developer, Energy Trading Co

"Finally, a commodity data API that doesn't require a Bloomberg Terminal budget. Perfect for our algorithmic trading research."

SK

Dr. Sarah Kim

Quantitative Analyst, Hedge Fund

"The Python SDK saved us weeks of development time. Clean API design and excellent error handling out of the box."

JP

James Patterson

Lead Engineer, Analytics Startup

Frequently Asked Questions

How do I get started with the oil price API?

Sign up for a free account to receive your API token. Then make HTTP requests to our endpoints with your token in the Authorization header. You get 100 free lifetime requests to test the API.

What programming languages are supported?

Our REST API works with any language that can make HTTP requests. We provide official SDKs for Python and Node.js, plus code examples in many other languages.

How much does the oil price API cost?

We offer a free tier with 100 lifetime requests. Paid plans start at $15/month for 10,000 requests. Enterprise plans with unlimited requests start at $129/month.

What data endpoints are available?

Core endpoints include /v1/prices/latest for current prices, /v1/prices/historical for time-series data, /v1/futures for futures contracts, and /v1/drilling-intelligence for rig count data.

How often is oil price data updated?

Prices are updated every 1-5 minutes during trading hours. Data comes directly from official exchanges (NYMEX, ICE) and trading platforms. Historical data is available back to 2014.

Do you offer a free trial?

Yes! Every account includes 100 free lifetime API requests with no credit card required. This gives you plenty of requests to test the API and build your integration before upgrading.

What authentication method is used?

We use token-based authentication. Include your API token in the Authorization header as "Token YOUR_API_TOKEN" with every request. Tokens can be regenerated from your dashboard.

Can I get historical oil price data?

Yes! Use the /v1/prices/historical endpoint with start_date and end_date parameters. Historical data for all commodities is available dating back to 2014 with daily, weekly, or monthly intervals.

Ready to Start?

100 free requests • No credit card required • Setup in under 5 minutes