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
Sidebar Features
- 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)
- Open any Google Sheet
- Extensions โ Add-ons โ Get add-ons
- Search "OilPriceAPI Energy Prices"
- Click Install
For Development
- Open Google Sheets
- Extensions โ Apps Script
- Copy code from
Code.gsandSidebar.html - 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
- Extensions โ OilPriceAPI โ Configure
- Enter your API key
- Click Save
Step 3: Use Custom Functions
In any cell, type:
=OILPRICE("BRENT_CRUDE_USD")
Step 4: Fetch Multiple Prices
- Extensions โ OilPriceAPI โ Fetch Prices
- Select commodities
- Click Fetch
- 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
- Fetch past year data
- Insert โ Chart
- Select date and price columns
- 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
๐ ๏ธ 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
- Open Google Apps Script editor
- Make changes to Code.gs or Sidebar.html
- Click Run โ test function
- Debug in Apps Script console
Deployment
- Click Deploy โ New deployment
- Type: Add-on
- Description: Version X.X.X
- Click Deploy
๐ Documentation
- API Reference: https://docs.oilpriceapi.com
- Custom Functions Guide: https://www.oilpriceapi.com/tools/sheets-functions
- Video Tutorials: https://www.youtube.com/oilpriceapi
- Support: support@oilpriceapi.com
๐ Known Issues
- None currently
๐ Privacy & Security
- API keys stored securely in user properties
- No data shared with third parties
- HTTPS encryption for all API calls
- Privacy Policy
- Terms of Service
๐ Support
Having issues?
- Email: support@oilpriceapi.com
- GitHub Issues: https://github.com/OilpriceAPI/google-sheets-addin/issues
- Documentation: https://www.oilpriceapi.com/tools/sheets-support
๐ Examples
Example 1: Build a Price Dashboard
- Create new sheet named "Dashboard"
- Add formulas:
=OILPRICE("BRENT_CRUDE_USD") =OILPRICE("WTI_USD") =OILPRICE("NATURAL_GAS_USD") - Format as table
- Add conditional formatting for price changes
Example 2: Historical Analysis
- Extensions โ OilPriceAPI โ Fetch Historical
- Select "Brent Crude" and "Past Year"
- Data appears in "Historical" sheet
- 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:
- Fork the repository
- Create feature branch
- Submit pull request
๐ Related Tools
- Python SDK: https://github.com/OilpriceAPI/python-sdk
- Node.js SDK: https://github.com/OilpriceAPI/oilpriceapi-node
- Excel Add-in: https://github.com/OilpriceAPI/excel-energy-addin
Built with โค๏ธ by OilPriceAPI