OilPriceAPI Documentation
Real-time oil, gas, and energy commodity price data via REST API
Quick Start
1. Get API Key
Sign up at oilpriceapi.com/signup and get your API key from the dashboard.
2. Make Your First Request
curl "https://api.oilpriceapi.com/v1/prices/latest?by_code=WTI_USD" \
-H "Authorization: Token YOUR_API_KEY"
3. Response
{
"status": "success",
"data": {
"WTI_USD": {
"price": 78.45,
"change_24h": 1.05,
"timestamp": "2025-01-03T15:30:00Z"
}
}
}
Base URL
https://api.oilpriceapi.com/v1
Authentication
All requests require an API key in the Authorization header:
Authorization: Token YOUR_API_KEY
Core Endpoints
Method | Endpoint | Description |
---|---|---|
GET | /prices/latest | Latest commodity prices |
GET | /prices/past_day | Hourly prices (24h) |
GET | /prices/past_week | Daily prices (7d) |
GET | /prices/past_month | Daily prices (30d) |
GET | /commodities | List all commodities |
Documentation
- API Reference - Complete endpoint documentation
- Authentication Guide - Security and best practices
- Error Codes - Error handling reference
- Rate Limiting - Usage limits and optimization
Support
- Email: [email protected]
- Status: status.oilpriceapi.com