Gas Price API for Developers
Get gas prices via REST API. Henry Hub, TTF, and LNG spot prices updated on a source-dependent cadence. 7-day free trial with 10,000 requests. SDKs available for Python, Node.js, and more.
7-day free trial/month • No credit card required • 5-minute setup
Quick Start - Get Natural Gas Prices
1. Get Current Natural Gas Price
curl -X GET https://api.oilpriceapi.com/v1/prices/latest \ -H "Authorization: Token YOUR_API_KEY" \ -H "Content-Type: application/json"
2. Response Example
{
"status": "success",
"data": {
"commodity": "NATURAL_GAS",
"symbol": "NG",
"price": 3.65,
"unit": "USD/MMBtu",
"timestamp": "2025-01-07T15:30:00Z",
"market": "NYMEX",
"contract": "Front Month",
"change_24h": 0.12,
"change_24h_percent": 3.40,
"delivery_point": "Henry Hub",
"last_trading_day": "2025-01-28"
}
}Natural Gas API Endpoints
/v1/prices/latestReturns the most recent natural gas price from Henry Hub futures
Query Parameters: commodity=NATURAL_GAS (optional)
/v1/prices/historicalRetrieve historical natural gas prices for analysis and charting
Parameters:
- • commodity: NATURAL_GAS
- • start_date: YYYY-MM-DD
- • end_date: YYYY-MM-DD
- • interval: minute, hour, day (default: day)
/v1/alerts/createSet up price alerts for natural gas price movements
{
"commodity": "NATURAL_GAS",
"condition": "above",
"threshold": 4.00,
"webhook_url": "https://your-app.com/webhook"
}/v1/natural-gas/storageProfessionalWeekly EIA natural gas storage data with seasonal analysis and inventory metrics (Professional subscribers only)
Response includes:
- • working_gas_bcf: Current storage levels
- • week_change_bcf: Weekly injection/withdrawal
- • five_year_avg_bcf: Historical average
- • surplus_deficit: Vs 5-year average
- • season_type: Injection/withdrawal season
wss://api.oilpriceapi.com/cableReal-time natural gas price updates via WebSocket (Professional plans and above)
// Subscribe to natural gas prices
{
"action": "subscribe",
"commodities": ["NATURAL_GAS"],
"auth": "YOUR_API_KEY"
}JavaScript Example
// Fetch current natural gas price
async function getNaturalGasPrice() {
const response = await fetch(
'https://api.oilpriceapi.com/v1/prices/latest',
{
headers: {
'Authorization': 'Token YOUR_API_KEY'
}
}
);
const data = await response.json();
console.log(`Natural Gas: $${data.data.price}/MMBtu`);
return data.data;
}
// Fetch storage intelligence (Professional)
async function getStorageData() {
const response = await fetch(
'https://api.oilpriceapi.com/v1/natural-gas/storage',
{
headers: {
'Authorization': 'Token YOUR_API_KEY'
}
}
);
const data = await response.json();
console.log(`Storage: ${data.data.working_gas_bcf} BCF`);
return data.data;
}Python Example
import requests
def get_natural_gas_price():
url = "https://api.oilpriceapi.com/v1/prices/latest"
headers = {
"Authorization": "Token YOUR_API_KEY"
}
response = requests.get(url, headers=headers)
data = response.json()
gas_price = data['data']['price']
print(f"Natural Gas: ${gas_price}/MMBtu")
return data['data']
# Get storage intelligence (Professional)
def get_storage_data():
url = "https://api.oilpriceapi.com/v1/natural-gas/storage"
headers = {
"Authorization": "Token YOUR_API_KEY"
}
response = requests.get(url, headers=headers)
data = response.json()
storage = data['data']['working_gas_bcf']
print(f"Storage: {storage} BCF")
return data['data']Natural Gas Market Data Features
Henry Hub Futures
Front month and forward curve pricing
Storage Data
EIA weekly storage report data and analysis
Weather Impact
Heating and cooling degree day correlations
API Rate Limits
| Plan | Requests/Month | Rate Limit | WebSocket |
|---|---|---|---|
| Free (7-day trial: 10,000) | 200 | 10/minute | - |
| Developer | 10,000 | 60/minute | - |
| Professional | 100,000 | 300/minute | |
| Scale | 1,000,000 | Custom |
Start Using Natural Gas Data Today
Build energy trading, analytics, and risk management applications with reliable natural gas price data updated on a source-dependent cadence.
7-day free trial with 10,000 requests • No credit card required