hero

OilpriceAPI Docs

Access real-time oil prices, historical data, and market analytics through OilpriceAPI's developer-friendly REST API. Live WTI & Brent Crude data with 99.9% uptime.

Get Started →

# Real-Time Oil Price Data API Documentation

# Overview

Access comprehensive oil and energy price data through our enterprise-grade REST API. Built for developers, data scientists, and financial analysts.

Key Features

  • Real-time price updates every 5 minutes
  • Historical data for WTI, Brent Crude, and more
  • Multiple currency support (USD, EUR, GBP)
  • 99.9% uptime guarantee
  • Developer-friendly documentation

# Quick Integration

curl https://api.oilpriceapi.com/v1/prices/latest \
-H 'Authorization: Token YOUR_API_KEY'

Data Coverage

Crude Oil: WTI, Brent, Dubai
Natural Gas: Henry Hub, TTF, NBP
Currencies: USD, EUR, GBP pairs
Market Data: Spot prices, daily averages

View Full API Reference →
Why Choose OilpriceAPI?

Enterprise-grade reliability
Comprehensive market coverage
Simple REST API design
Detailed technical documentation
Flexible integration options

## Oil Products

### BRENT_CRUDE_USD

### WTI_USD
- **Name**: West Texas Intermediate Crude Oil
- **Category**: Oil
- **Description**: WTI Crude Oil
- **Unit**: Barrel (bbl)
- **Currency**: USD
- **Price Range**: $0-200
- **Multiplier**: 100 (for internal storage)
- **Usage**: `by_code=WTI_USD`
- **Aliases**: `WTI_CRUDE_USD`
- **Market**: NYMEX
- **Trading Hours**: Sunday-Friday 6:00 PM - 5:00 PM ET

## Natural Gas

### NATURAL_GAS_USD
- **Market**: NYMEX
- **Contract Size**: 10,000 MMBtu
- **Trading Hours**: Sunday-Friday 6:00 PM - 5:00 PM ET

## Supported Commodities

### Crude Oil
- **WTI (WTI_USD)**
  - Light sweet crude oil benchmark for Americas
  - Traded on NYMEX
  - Priced in USD per barrel
  - Also available as `WTI_CRUDE_USD`

- **Brent (BRENT_CRUDE_USD)**
  - Light sweet crude oil from North Sea
  - Global oil benchmark
  - Priced in USD per barrel
  - Used for ~2/3 of global oil pricing

- **Dubai (DUBAI_CRUDE_USD)**
  - Medium sour crude oil
  - Benchmark for Persian Gulf exports to Asia
  - Priced in USD per barrel
  - Key spot market indicator

### Natural Gas
- **Henry Hub (NATURAL_GAS_USD)**
  - North American benchmark
  - Priced in USD per MMBtu
  - NYMEX futures delivery point
  - Trading Hours: Sunday-Friday 6:00 PM - 5:00 PM ET

- **UK NBP (NATURAL_GAS_GBP)**
  - UK's National Balancing Point
  - Priced in GBP per therm
  - Europe's most liquid gas trading point
  - Virtual trading location

- **Dutch TTF (DUTCH_TTF_EUR)**
  - Continental Europe's main gas hub
  - Priced in EUR per MWh
  - Virtual trading facility
  - Key European benchmark

### Other Commodities
- **Coal (COAL_USD)**
  - API2 CIF ARA Coal benchmark
  - Priced in USD per metric ton
  - Northwest Europe import price
  - Delivery to Amsterdam-Rotterdam-Antwerp

- **Gold (GOLD_USD)**
  - Spot gold price
  - Priced in USD per troy ounce
  - Global safe-haven asset
  - Physical and financial instrument

### Currency Pairs
- **GBP/USD**
  - British Pound to US Dollar rate
  - Known as "Cable"
  - Major forex pair
  - Historical significance

- **EUR/USD**
  - Euro to US Dollar rate
  - World's most traded pair
  - Known as "Fiber"
  - Represents largest economies

## Technical Details

### Price Updates
- Real-time updates every 5 minutes
- All timestamps in UTC (ISO 8601)
- Prices updated during market hours
- Historical data available up to 1 year

### Data Format
- JSON response format
- Standardized error codes
- Multiplier applied for internal storage
- Currency-specific formatting

### API Endpoints
- Latest prices: `/v1/prices/latest`
- Historical data:
  - Daily: `/v1/prices/past_day`
  - Weekly: `/v1/prices/past_week`
  - Monthly: `/v1/prices/past_month`
  - Yearly: `/v1/prices/past_year`

## Usage Notes

1. All prices are returned in their display currency (USD, GBP, or EUR as specified)
2. Internal storage uses integer units (multiplied by the specified multiplier)
3. Validation ranges are enforced on all price updates
4. Historical data is available through various endpoints:
   - `/v1/prices/past_day`
   - `/v1/prices/past_week`
   - `/v1/prices/past_month`
   - `/v1/prices/past_year`
5. Rate limits apply to all endpoints (see Rate Limiting section)
6. All timestamps are in UTC (ISO 8601 format)
7. Prices are updated during market trading hours

## Error Handling

The API returns standard HTTP status codes:

- 200: Success
- 400: Bad Request (invalid parameters)
- 401: Unauthorized (invalid API key)
- 429: Too Many Requests (rate limit exceeded)
- 500: Internal Server Error

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155