Oil Price API
Get latest-available oil price data into your app quickly.
Example Response Format
Sample JSON shape returned by the API (values shown are placeholders)
{
"status": "success",
"data": {
"WTI": {
"price": 0,
"currency": "USD",
"unit": "barrel",
"timestamp": "2026-01-01T00:00:00Z"
},
"BRENT": {
"price": 0,
"currency": "USD",
"unit": "barrel",
"timestamp": "2026-01-01T00:00:00Z"
}
}
}No credit card required to start • Token authentication • JSON responses
Get API Key
Sign up for free and get your API token instantly. No credit card required.
Get Free API KeyMake Request
Use simple HTTP requests to get latest-available oil price data in JSON format.
GET /v1/prices/latestUse Data
Integrate timestamped oil price data into your trading app, dashboard, or analysis tool.
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": 0,
"currency": "USD",
"unit": "barrel",
"timestamp": "2026-01-01T00:00:00Z"
},
"BRENT": {
"price": 0,
"currency": "USD",
"unit": "barrel",
"timestamp": "2026-01-01T00:00: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/latestCurrent oil prices (WTI, Brent, etc.)
GET /v1/prices/WTISpecific commodity price data
GET /v1/prices/historicalHistorical price data
GET /v1/drilling-intelligenceRig counts & drilling data
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. See the pricing page for current trial terms and plan limits.
What programming languages are supported?
How much does the oil price API cost?
Current plan terms, usage limits, and package rights are maintained on the pricing page and in your account dashboard.
What data endpoints are available?
Core endpoints include /v1/prices/latest for latest-available prices, /v1/prices/historical for time-series data, /v1/futures for futures contracts, and /v1/drilling-intelligence for energy data.
How often is oil price data updated?
Freshness depends on the commodity, source, market hours, and package. Use timestamps and freshness metadata in API responses to evaluate the data returned for your use case.
Do you offer a free trial?
Yes. You can create a free account to test the API before upgrading. See the pricing page for current trial terms and plan limits.
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.
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."
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."
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."
James Patterson
Lead Engineer, Analytics Startup
Explore More Resources
Python SDK
Install our official Python SDK and start fetching oil prices in 3 lines of code.
Node.js SDK
TypeScript-ready Node.js SDK for building energy data applications.
Energy Data API
Access comprehensive energy market data including rig counts and drilling intelligence.
Brent Futures API
Get latest-available and historical Brent crude futures contract data.
Pricing Plans
View current package options and account limits on the pricing page.
Get Started Free
Create an account to test the API. No credit card required to start.
Ready to Start?
No credit card required to start • Token authentication • JSON responses