OilPriceAPI Google Sheets Add-on

March 8, 2026 ยท View on GitHub

Real-time oil & commodity price data directly in Google Sheets

๐ŸŽฏ Overview

This Google Sheets add-on brings live commodity prices to your spreadsheets:

  • Custom Functions: =OILPRICE("BRENT_CRUDE_USD")
  • Sidebar UI: Fetch and manage prices easily
  • Auto-Convert: Standardize all prices to $/MMBtu
  • Historical Data: Access 20+ years of daily prices

๐Ÿ“ฆ Features

Custom Functions

=OILPRICE("BRENT_CRUDE_USD")           // Returns latest Brent Crude price
=OILPRICE_HISTORY("WTI_USD", 30)       // Returns 30 days of WTI data
=OILPRICE_CONVERT("NATURAL_GAS_GBP")   // Returns price in $/MMBtu
  • API key management
  • Commodity selection (20+ commodities)
  • Fetch latest prices
  • Convert to $/MMBtu
  • Historical data charts
  • Usage tracking

Tier Detection

  • Free: 100 requests (lifetime)
  • Exploration: 10,000 requests/month + historical data
  • Production+: Higher limits + webhooks

๐Ÿš€ Installation

From Google Workspace Marketplace (Coming Soon)

  1. Open any Google Sheet
  2. Extensions โ†’ Add-ons โ†’ Get add-ons
  3. Search "OilPriceAPI Energy Prices"
  4. Click Install

For Development

  1. Open Google Sheets
  2. Extensions โ†’ Apps Script
  3. Copy code from Code.gs and Sidebar.html
  4. Save and refresh

๐Ÿ“– Quick Start

Step 1: Get API Key

Visit https://www.oilpriceapi.com/signup?utm_source=google_sheets&utm_medium=addin&utm_campaign=readme to get your free API key.

Step 2: Open Add-on

  1. Extensions โ†’ OilPriceAPI โ†’ Configure
  2. Enter your API key
  3. Click Save

Step 3: Use Custom Functions

In any cell, type:

=OILPRICE("BRENT_CRUDE_USD")

Step 4: Fetch Multiple Prices

  1. Extensions โ†’ OilPriceAPI โ†’ Fetch Prices
  2. Select commodities
  3. Click Fetch
  4. Data appears in "Data" sheet

๐ŸŽจ Example Dashboards

Energy Price Comparison

| Commodity       | Latest Price | $/MMBtu  | 30-Day Change |
|-----------------|--------------|----------|---------------|
| Brent Crude     | \$71.45       | \$12.32   | +2.3%         |
| WTI Crude       | \$66.20       | \$11.41   | +1.8%         |
| Natural Gas (US)| \$4.84        | \$4.84    | -3.2%         |
| UK Natural Gas  | ยฃ7.50        | \$99.30   | +15.7%        |

Historical Price Chart

  1. Fetch past year data
  2. Insert โ†’ Chart
  3. Select date and price columns
  4. Choose line chart

๐Ÿ’ฐ Pricing

Free Tier:

  • 100 requests (lifetime)
  • Real-time prices
  • 20+ commodities
  • Custom functions

Exploration ($15/mo):

  • 10,000 requests/month
  • Historical data access
  • Pandas integration (Python SDK)
  • Email support

Production ($45/mo):

  • 50,000 requests/month
  • Webhooks
  • Priority support
  • 99.9% uptime SLA

View Full Pricing

๐Ÿ› ๏ธ Development

Project Structure

google-sheets-energy-addin/
โ”œโ”€โ”€ Code.gs              # Main Apps Script code
โ”œโ”€โ”€ Sidebar.html         # Sidebar UI
โ”œโ”€โ”€ appsscript.json      # Project manifest
โ”œโ”€โ”€ README.md            # This file
โ””โ”€โ”€ docs/
    โ””โ”€โ”€ index.html       # GitHub Pages landing page

Testing Locally

  1. Open Google Apps Script editor
  2. Make changes to Code.gs or Sidebar.html
  3. Click Run โ†’ test function
  4. Debug in Apps Script console

Deployment

  1. Click Deploy โ†’ New deployment
  2. Type: Add-on
  3. Description: Version X.X.X
  4. Click Deploy

๐Ÿ“š Documentation

๐Ÿ› Known Issues

  • None currently

๐Ÿ”’ Privacy & Security

๐Ÿ“ž Support

Having issues?

๐ŸŽ“ Examples

Example 1: Build a Price Dashboard

  1. Create new sheet named "Dashboard"
  2. Add formulas:
    =OILPRICE("BRENT_CRUDE_USD")
    =OILPRICE("WTI_USD")
    =OILPRICE("NATURAL_GAS_USD")
    
  3. Format as table
  4. Add conditional formatting for price changes

Example 2: Historical Analysis

  1. Extensions โ†’ OilPriceAPI โ†’ Fetch Historical
  2. Select "Brent Crude" and "Past Year"
  3. Data appears in "Historical" sheet
  4. Create line chart to visualize trends

Example 3: Energy Cost Calculator

A1: Commodity       | B1: =OILPRICE("NATURAL_GAS_USD")
A2: Volume (MMBtu)  | B2: 1000
A3: Total Cost      | B3: =B1*B2

๐Ÿ† Why OilPriceAPI?

  • 98% Less Cost: Compared to Bloomberg Terminal
  • 20+ Commodities: Brent, WTI, Natural Gas, Coal, and more
  • 20 Years of Data: Daily historical prices since 2005
  • Production-Ready: Used by analysts, traders, and developers worldwide
  • Free Tier: 100 requests (lifetime), no credit card required

๐Ÿ“ License

MIT License - See LICENSE file for details

๐Ÿš€ Contributing

Contributions welcome! Please:

  1. Fork the repository
  2. Create feature branch
  3. Submit pull request

Built with โค๏ธ by OilPriceAPI

Website โ€ข Pricing โ€ข Docs โ€ข Support