Oil Price API Documentation - Quick Start in 5 Minutes | REST API
GitHub
GitHub
  • Interactive Explorer

    • Interactive API Explorer
  • Price Data

    • API Reference
    • Get Latest Prices
    • Historical Prices
  • Commodities

    • List Commodities
    • Get Commodity Details
  • Marine Fuels

    • List Marine Fuel Ports
    • Get Port Details with Prices
  • Premium Endpoints

    • All Prices API - One Call, All Commodities
    • Cushing Oil Storage Intelligence API
    • Drilling Intelligence API
    • Marine Fuels API
    • ICE Brent Futures API
  • Futures

    • Futures API
    • ICE Brent Futures
    • ICE WTI Futures
    • ICE Gas Oil Futures
    • NYMEX Natural Gas Futures
    • ICE EUA Carbon Futures
  • Dark Data (Premium)

    • Energy Intelligence API
    • Rig Counts
    • Well Permits
    • Oil Inventories
    • OPEC Production
    • Drilling Productivity
    • Forecasts (STEO)
  • Analytics

    • Analytics API
  • Account & Billing

    • Account API

Demo API (No Authentication)

Status: ✅ Available | ⚡ Real-time | 🆓 No API Key Required

Try the API instantly without signing up. Perfect for testing and exploring.

GET/v1/demo/prices

Overview

The demo endpoint provides instant access to real-time commodity prices without authentication. Use it to:

  • Test your integration before signing up
  • Explore API responses in the browser
  • Build quick prototypes

Limitations

FeatureDemo APIAuthenticated API
Rate Limit20/hourUp to 100k+/month
Commodities9220+
Historical Data❌✅
WebSocket❌✅ (Premium)

Available Commodities

  • BRENT_CRUDE_USD
  • WTI_USD
  • NATURAL_GAS_USD
  • GOLD_USD
  • EUR_USD
  • GBP_USD
  • HEATING_OIL_USD
  • GASOLINE_USD
  • DIESEL_USD

Response

{
  "status": "success",
  "data": {
    "prices": [
      {
        "code": "NATURAL_GAS_USD",
        "name": "Natural Gas (Henry Hub)",
        "price": 5.34,
        "currency": "USD",
        "updated_at": "2026-01-22T13:43:16Z",
        "change_24h": 7.04,
        "source": "OilPriceAPI"
      }
    ],
    "meta": {
      "demo_mode": true,
      "rate_limit": "20 requests per hour"
    }
  }
}

Response Fields

FieldTypeDescription
codestringCommodity identifier
namestringHuman-readable commodity name
pricenumberCurrent spot price
currencystringPrice currency (usually USD)
updated_atstringISO 8601 timestamp of last update
change_24hnumberPercentage change from 24 hours ago (e.g., 7.04 = +7.04%)
sourcestringAlways "OilPriceAPI" for demo

change_24h is a percentage

The change_24h field contains the percentage change from 24 hours ago, not the absolute dollar change. For example, 7.04 means the price increased by 7.04% in the last 24 hours.

Examples

# Get all demo prices
curl https://api.oilpriceapi.com/v1/demo/prices

# Get specific commodity (demo only supports free-tier commodities)
curl https://api.oilpriceapi.com/v1/demo/prices/WTI_USD
// JavaScript - No API key needed!
const response = await fetch("https://api.oilpriceapi.com/v1/demo/prices");
const data = await response.json();

data.data.prices.forEach((commodity) => {
  const changeDir = commodity.change_24h >= 0 ? "↑" : "↓";
  console.log(
    `${commodity.name}: $${commodity.price} ${changeDir}${Math.abs(commodity.change_24h)}%`,
  );
});
# Python - No API key needed!
import requests

response = requests.get('https://api.oilpriceapi.com/v1/demo/prices')
data = response.json()

for commodity in data['data']['prices']:
    change_dir = '↑' if commodity['change_24h'] >= 0 else '↓'
    print(f"{commodity['name']}: ${commodity['price']} {change_dir}{abs(commodity['change_24h'])}%")

Rate Limit Headers

X-RateLimit-Limit: 20
X-RateLimit-Remaining: 19
X-RateLimit-Reset: 1737557999
X-Demo-Mode: true

Ready for More?

Sign up for free to access:

  • 220+ commodities
  • Historical data
  • Higher rate limits
  • WebSocket streaming
Last Updated: 2/3/26, 1:30 AM