OilPriceAPI Docs
Quick Start
API Reference
  • SDKs and languages
  • Tutorials
  • Articles
  • Documentation directory
  • Quick reference
  • API explorer
  • FAQ
  • Changelog
  • Status
  • Dashboard
GitHub
Quick Start
API Reference
  • SDKs and languages
  • Tutorials
  • Articles
  • Documentation directory
  • Quick reference
  • API explorer
  • FAQ
  • Changelog
  • Status
  • Dashboard
GitHub
  • Interactive Explorer

    • Interactive API Explorer
  • Price Data

    • API Reference
    • Get Latest Prices
    • Historical Prices
    • Batch Prices
    • Excel Latest Price Gateway
    • Price Widget Endpoints
    • Price Utility Endpoints
    • Demo API (No Authentication)
    • Natural Gas Intelligence
    • Natural gas hub price codes
    • Energy News Feed
  • Commodities

    • List Commodities
    • Get Commodity Details
    • Code Aliases
    • Denmark diesel list prices (OK Danmark)
    • Data Publication & Collection Schedules
  • AI Agents (MCP)

    • Get Market Brief
    • Subscriptions / Watches
    • Agent Subscriptions with MCP
  • Marine Fuels

    • Marine Fuel API
    • List Marine Fuel Ports
    • Get Port Details with Prices
    • Bunker Fuels
    • Maritime Fuels
  • Fuel Surcharges

    • Fuel Surcharge API
  • Premium Endpoints

    • All Prices API - One Call, All Commodities
    • Cushing Oil Storage Intelligence API
    • Drilling Intelligence API
    • Marine Fuels API
    • ICE Brent Futures API
    • Aviation Fuel Pilot
  • Spreads & Margins

    • Spreads & Margins
    • Crack Spreads
    • European Gasoil Crack
    • Basis Spreads
    • Refining Margins
    • Curve Structure
    • Physical Premiums
  • Market Indicators

    • Market Indicators
    • Fuel Switching
    • Price Context
    • Storage Analytics
    • CFTC Positioning
    • Market Annotations
  • Futures

    • Futures API
    • ICE Brent Futures
    • WTI Futures
    • Continuous Futures (Brent, WTI)
    • ICE Gas Oil Futures
    • NYMEX Natural Gas Futures
    • ICE EUA Carbon Futures
    • EU Carbon Futures
    • TTF Gas Futures
    • LNG JKM Futures
    • UK Carbon Futures
  • Dark Data (Premium)

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

    • Well Production Data
    • Well Production API Reference
  • Analytics

    • Analytics API
  • Webhooks API

    • Webhooks API Reference
    • Webhook Endpoint Reference
  • Alerts

    • Price Alerts API
  • Scheduled Deliveries

    • Scheduled Deliveries API
  • Account & Billing

    • Account API
    • API Keys
    • Subscriptions
    • Organizations

Billing API

Overview

The Billing API allows you to manage your subscription, view invoices, and update payment methods programmatically. All billing is handled securely through Stripe.


Plans & Pricing

The table below is sourced from the billing source of truth, GET /billing/plans — generated at build time and refreshed live in your browser — so it never drifts from the product. If the request fails it falls back to the last committed values.

PlanPrice / moRequests / moRate limitHighlights
Developer$1910,00060 / rolling 60sReal-time prices, 1-year history, email support
Starter$4950,00060 / rolling 60sWebhooks, 5-year history
ProfessionalPopular$99250,00060 / rolling 60sFutures, WebSocket, market brief, priority support
Scale$2991,000,00060 / rolling 60sEverything in Professional + drilling intelligence, Slack support

Synced from the billing API (/billing/plans). Sign up or manage plans at oilpriceapi.com/pricing. Free tier: 50 requests/day. 7-day free trial with 10,000 requests.

Need a custom SLA or volume beyond Scale? Contact us for Enterprise.


Endpoints

Get Available Plans

GET /billing/plans

No API key is needed. The response has one row per Stripe price, so each plan appears once for monthly billing (interval: "month") and once for annual billing (interval: "year"). Prices are in cents.

Each row carries an entitlements object. It is resolved from the plan's configured Stripe price, not from marketing copy, and it is the same set of entitlements the API enforces:

FieldValues
request_limitMonthly request quota
history_depthlatest_only, one_year, five_year or unlimited
futures, websocket, webhooks, drilling_intelligence, well_permitstrue or false

The features.webhooks and features.websocket flags are derived from entitlements. Read entitlements when you need to know what a plan can access; features_list is display text.

Response (one row shown):

{
  "status": "success",
  "data": {
    "plans": [
      {
        "id": "price_1TFvS4EKmJotBWfJbFJm0Mr5",
        "stripe_price_id": "price_1TFvS4EKmJotBWfJbFJm0Mr5",
        "name": "Developer",
        "amount": 1900,
        "formatted_amount": "$19.00",
        "currency": "usd",
        "interval": "month",
        "api_request_limit": 10000,
        "lookup_key": "developer_monthly",
        "entitlements": {
          "request_limit": 10000,
          "history_depth": "one_year",
          "futures": false,
          "websocket": false,
          "webhooks": false,
          "drilling_intelligence": false,
          "well_permits": false
        },
        "features": {
          "requests_per_month": 10000,
          "support_level": "email",
          "api_keys": 3,
          "webhooks": false,
          "websocket": false
        },
        "tier_names": {
          "current": "developer",
          "display": "Developer"
        },
        "features_list": [
          "10,000 API requests per month",
          "1-year historical data (where available)",
          "Email support",
          "3 API keys"
        ]
      }
    ]
  }
}

Fields not shown above (description, price, metadata, interval_count and the rest of features) are also returned. Plans that are no longer sold are not listed. Subscribers on a retired price keep it and are not repriced.

Get Current Subscription

GET /billing/subscriptions/current

Response:

{
  "subscription": {
    "id": "sub_123",
    "plan": "professional",
    "status": "active",
    "current_period_start": "2025-01-01T00:00:00Z",
    "current_period_end": "2025-02-01T00:00:00Z",
    "cancel_at_period_end": false,
    "usage": {
      "requests_used": 45000,
      "requests_limit": 250000,
      "percent_used": 18
    }
  }
}

Create Subscription

POST /billing/subscriptions

Request Body:

{
  "plan_id": "professional",
  "billing_period": "monthly"
}

Change Plan

POST /billing/subscriptions/change_plan

Request Body:

{
  "new_plan_id": "professional"
}

Plan changes are prorated. Upgrades take effect immediately; downgrades take effect at the next billing period.

Cancel Subscription

POST /billing/subscriptions/cancel

Cancels at end of current billing period. You retain access until then.

Reactivate Subscription

POST /billing/subscriptions/reactivate

Reactivates a subscription scheduled for cancellation.


Payment Methods

List Payment Methods

GET /billing/payment_methods

Update Payment Method

PATCH /billing/payment_methods/update

Request Body:

{
  "payment_method_id": "pm_card_visa_123"
}

Create Setup Intent

POST /billing/intents/setup

Returns a Stripe Setup Intent for adding a new payment method.


Invoices

List Invoices

GET /billing/invoices

Response:

{
  "invoices": [
    {
      "id": "inv_123",
      "amount": 7900,
      "currency": "usd",
      "status": "paid",
      "period_start": "2025-01-01",
      "period_end": "2025-01-31",
      "pdf_url": "https://invoice.stripe.com/..."
    }
  ]
}

Usage Tracking

Get Current Usage

GET /billing/usage

Response:

{
  "period": {
    "start": "2025-01-01T00:00:00Z",
    "end": "2025-02-01T00:00:00Z"
  },
  "requests": {
    "used": 45000,
    "limit": 250000,
    "remaining": 205000
  },
  "daily_breakdown": [
    { "date": "2025-01-15", "requests": 1500 },
    { "date": "2025-01-16", "requests": 1800 }
  ]
}

Customer Portal

For self-service billing management, redirect users to Stripe's Customer Portal:

POST /billing/customer-portal/sessions

Response:

{
  "url": "https://billing.stripe.com/session/..."
}

Redirect users to this URL for:

  • Update payment method
  • View invoice history
  • Download invoices
  • Cancel subscription

Credit Packs (Pay-as-you-go)

For users who exceed their monthly limits:

List Available Credit Packs

GET /billing/credit_packs

Purchase Credits

POST /billing/credit_purchases

Request Body:

{
  "pack_id": "10k_requests",
  "quantity": 1
}

Webhook Events

Subscribe to billing webhooks for real-time updates:

EventDescription
subscription.createdNew subscription started
subscription.updatedPlan changed
subscription.cancelledSubscription cancelled
invoice.paidPayment successful
invoice.payment_failedPayment failed
usage.limit_warning80% of limit reached
usage.limit_exceeded100% of limit reached

Questions?

Contact support@oilpriceapi.com for billing questions or custom Enterprise pricing.

Last Updated: 11/27/26, 6:48 PM