API Documentation

Natural 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.

New accounts start with a 7-day Full API (except licensed datasets: aviation fuel pilot) trial with 10,000 requests and no credit card; when the trial ends, the account continues on the Free tier with 50 requests/day.

Looking for retail gasoline prices? See the gasoline price API.

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

GET/v1/prices/latest

Returns the most recent natural gas price from Henry Hub futures

Query Parameters: commodity=NATURAL_GAS (optional)

GET/v1/prices/historical

Retrieve 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)
POST/v1/alerts/create

Set up price alerts for natural gas price movements

{
  "commodity": "NATURAL_GAS",
  "condition": "above",
  "threshold": 4.00,
  "webhook_url": "https://your-app.com/webhook"
}
GET/v1/natural-gas/storageProfessional

Weekly 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
WSwss://api.oilpriceapi.com/cable

Real-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

Plan Request Allowances

PlanRequests
Free (after trial)50 requests/day
Developer10,000/month
Starter50,000/month
Professional250,000/month
Scale1,000,000/month

Plan features and endpoint access vary by tier. Check current pricing and plan features before choosing a tier.

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