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
  • Integrations

    • Airtable Integration - Oil Price Database & Tracking
    • Excel Add-in - Latest Oil Prices as Refreshable Formulas
    • Google Sheets Integration
    • Looker Studio Integration
    • Make (Integromat) Integration - Visual Oil Price Automation
    • n8n Integration - Self-Hosted Oil Price Automation
    • Notion Integration - Oil Price Dashboards & Databases
    • Power BI Integration
    • Tableau Integration
    • Zapier Integration - Automate Oil Price Data Workflows

Excel Add-in (Preview)

Latest energy prices in your spreadsheet as refreshable formulas:

=OILPRICE.PRICE("BRENT_CRUDE_USD")

The add-in is in preview. It is not listed in Microsoft AppSource — it installs by uploading a manifest file (sideloading), and setup takes about 2 minutes. You need an OilPriceAPI account and your API key (Dashboard → API Keys).

Platform status

PlatformStatus
Excel for MacVerified — Excel for Mac 16.110.2 on macOS passed the recorded preview runtime smoke on 2026-07-03: sideload, key save/test, PRICE, GET, cell-reference recalculation, and diagnostics.
Excel on the webUnverified — an install path exists (below) but no runtime smoke is recorded for it yet.
Excel desktop on WindowsUnverified — install paths exist (below) but no runtime smoke is recorded for them yet.

Only Mac has a recorded receipt. This table is updated as each platform's runtime smoke is recorded — until then, treat the web and Windows paths as at-your-own-risk preview.


Install — Excel desktop on Mac (verified)

One line in Terminal, then restart Excel:

mkdir -p ~/Library/Containers/com.microsoft.Excel/Data/Documents/wef && curl -fsSL https://oilpriceapi.github.io/excel-energy-addin/manifest.xml -o ~/Library/Containers/com.microsoft.Excel/Data/Documents/wef/oilprice-manifest.xml

Then Insert → My Add-ins → OilPrice (under Developer Add-ins). Open the OilPrice pane, paste your API key, Save Key, then Test Key.

Install — Excel on the web (unverified)

  1. Download the add-in file: manifest.xml (right-click → Save link as… if it opens in the browser).
  2. Open your workbook in Excel at office.com.
  3. Home tab → Add-ins → More Add-ins.
  4. My Add-ins tab → Upload My Add-in (top-left of the dialog).
  5. Select the downloaded manifest.xml → Upload.
  6. Click the OilPrice ribbon button, paste your API key, Save Key, then Test Key.

Install — Excel desktop on Windows (unverified)

If your company uses Microsoft 365 (simplest — no scripts):

  1. admin.microsoft.com → Settings → Integrated apps → Upload custom apps.

  2. App type Office Add-in → Provide link to manifest file:

    https://oilpriceapi.github.io/excel-energy-addin/manifest.xml
    
  3. Assign to yourself (or your team), finish, and restart Excel. The add-in appears automatically (allow up to a few hours the first time).

Personal machine with admin rights: download and double-click install-windows.cmd, approve the administrator prompt, restart Excel, then Insert → My Add-ins → Shared Folder → OilPrice. Desktop Excel on Windows cannot load the hosted manifest URL directly — it sideloads from a trusted local/shared catalog, which is what the script sets up.


Formulas

FormulaReturns
=OILPRICE.PRICE("BRENT_CRUDE_USD")Latest price as a bare number
=OILPRICE.PRICE(A1)Price for the code in cell A1 — recalculates when A1 changes
=OILPRICE.INFO("NATURAL_GAS_GBP")Spilled Field/Value table: price, currency, unit, source, timestamps, freshness
=OILPRICE.STATUS("BALTIC_CAPESIZE_INDEX")Freshness of the latest quote: current, stale, or another API-reported status
=OILPRICE.UNIT("NATURAL_GAS_GBP")Currency/unit of the quote, e.g. GBp/therm or USD/barrel
=OILPRICE.GET("/v1/prices/latest", "by_code=DIESEL_USD")A supported API endpoint (see the allowlist below), spilled into cells
=OILPRICE.CODES()Commodity code table (shorthand for GET on /v1/commodities)

Commodity codes match the API — see the full commodity list for what your plan includes.

OILPRICE.INFO

PRICE deliberately returns a bare number so it charts and aggregates. INFO is its companion: a two-column Field/Value table with code, price, currency, unit, formatted, source, source_description, as_of, collected_at, data_status, stale, and age_days — everything needed to interpret the number. A value like NATURAL_GAS_GBP = 142.19 is pence per therm, not USD; INFO (or UNIT) is how you know.

OILPRICE.STATUS

Returns the API's freshness verdict for the latest quote — current, stale, or another API-reported status — so stale data is distinguishable from fresh in the worksheet. Data cadence varies by source, market hours, and dataset; refresh timing follows Excel recalculation.

OILPRICE.GET supported endpoints

OILPRICE.GET is allowlisted, not open: it accepts only the GET endpoints below. Any other path returns #UNSUPPORTED_ENDPOINT in the cell. The file of record is ENDPOINT_CATALOG in the add-in source.

EndpointAllowed paths
API status/v1/status
Prices/v1/prices, /v1/prices/latest, /v1/prices/past_day, /v1/prices/past_week, /v1/prices/past_month, /v1/prices/past_year, /v1/prices/historical, /v1/prices/all, /v1/prices/all/health
Diesel prices/v1/diesel-prices
Rig counts/v1/rig-counts + /latest, /current, /historical, /trends, /summary
Storage/v1/storage + /cushing, /spr, /regional, /history/{code}
EIA oil inventories/v1/ei/oil_inventories + /latest, /summary, /by_product, /historical, /cushing, /{series}
OPEC production/v1/ei/opec_productions + /latest, /total, /by_country, /historical, /top_producers, /{country}
Bunker fuels/v1/bunker-fuels/all, /compare, /spreads/ports, /ports/{LOCODE}, /historical/{LOCODE}
Well production/v1/well-production/summary, /states, /states/{XX}, /pru/{id}, /wells/{id}, /top-producers, /cycle-time, /cycle-time/cohorts
Well permits/v1/ei/well-permits + /preview, /states, /states/{XX}, /latest, /summary, /by-state, /by-operator, /by-formation, /search, /{id}
Drilling intelligence/v1/drilling-intelligence + /latest, /summary, /trends, /frac-spreads, /well-permits, /duc-wells, /completions, /wells-drilled, /basin/{name}
Analytics/v1/analytics/performance, /statistics, /correlation, /trend, /spread, /forecast
Futures/v1/futures/{family} for ice-brent, ice-wti, ice-gasoil, natural-gas, eua-carbon — each optionally + /historical, /ohlc, /intraday, /spreads, /curve, /spread-history
Commodity catalog/v1/commodities, /v1/commodities/categories, /v1/commodities/{code}

Notes that matter in practice:

  • Your plan still applies. The allowlist is what the add-in will call, not what your key is entitled to — an endpoint outside your plan returns #UPGRADE_REQUIRED in the cell.
  • Never put credentials in the query string. A query containing key-like parameters (api_key, token, secret, …) is refused with #UNSUPPORTED_QUERY. The add-in sends your saved key in the request header.
  • past_week / past_month truncation. These endpoints return only the ~100 most recent intraday ticks (about a day). When that cap is hit the spilled table ends with a TRUNCATED: note row steering you to /v1/prices/historical with start_date/end_date for the full range.
  • Nested API fields spill as dot-named columns (e.g. port.code), so values stay usable in formulas and charts rather than appearing as JSON blobs.

Errors and recovery

Formula errors are plain worksheet strings (#CODE: message), never silent zeros. PRICE, STATUS, and UNIT return the error in the cell; GET and INFO return it as a one-row table.

Cell errorMeaningWhat to do
#AUTH_REQUIREDNo key saved for formulasOpen the OilPrice pane and save your key
#AUTH_INVALIDKey invalid or expiredReplace the key in the OilPrice pane
#UPGRADE_REQUIREDQuota reached, or the endpoint is outside your planReview your plan on the pricing page
#API_ACCESS_SUSPENDEDAccount suspendedContact support — do not rotate the key or assume an upgrade restores access
#EMAIL_CONFIRMATION_REQUIREDEmail not confirmedUse the confirmation link shown in the error
#ACCESS_DENIED403 for a reason the add-in could not verifyRun Test Key, then contact support if it persists
#RATE_LIMITEDRate limit hitThe error includes the retry time (from Retry-After / X-RateLimit-Reset) — wait, then retry
#INVALID_CODEBad commodity code or request parameterCheck the code — the message often suggests the right one
#NO_DATAAPI returned no matching dataCheck the commodity code or query
#UNSUPPORTED_ENDPOINTPath not on the GET allowlist aboveUse a supported endpoint
#UNSUPPORTED_QUERYCredential-like key in the query stringRemove it — the saved key is sent automatically
#TIMEOUTNo response within 15 secondsRetry, then use Test Key after checking service status
#OFFLINEThis device appears to be offlineReconnect, then retry
#NETWORK_OR_CORSBrowser or CORS policy blocked the requestCopy diagnostics and contact support — don't replace the key unless the pane says AUTH_INVALID
#SERVER_ERROR / #INVALID_RESPONSEAPI unavailable or returned an unreadable responseRetry once, then copy diagnostics and contact support
#NAME?Excel did not load the custom functionsClose Excel fully and reopen; on the web, remove and re-upload the manifest

Diagnostics

The OilPrice task pane has a Diagnostics section showing add-in version, Excel host, runtime support, network state, storage state, and the last request (result, HTTP status, duration, and request ID). Copy Diagnostics puts a support-ready summary on the clipboard — API keys are never stored in diagnostics or copied. When you email support@oilpriceapi.com, include the exact cell error text plus the copied diagnostics; never include your API key.

Starter workbook

A self-service starter workbook and no-manifest onboarding are planned — scope is tracked in website-clean#604.

Source

The add-in is open source: OilpriceAPI/excel-energy-addin — issues and feature requests welcome.

Last Updated: 9/5/26, 8:42 PM
Prev
Airtable Integration - Oil Price Database & Tracking
Next
Google Sheets Integration