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 Key2
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
Ready to Start?
1,000 free requests per month • No credit card required • Setup in under 5 minutes