Compare energy commodity prices across units and currencies using OilPriceAPI.
This Excel add-in allows analysts to:
- Fetch real-time energy commodity prices (Brent, WTI, Natural Gas, Coal, etc.)
- Convert prices to equivalent energy units ($/MBtu) for direct comparison
- Analyze price relationships across different commodities
- Export data for further analysis
✅ Real-time Price Fetching - Get latest spot prices from OilPriceAPI ✅ Energy Unit Conversions - Convert to $/MBtu using standard heat content factors ✅ Data Tab - Clean tabular view of raw commodity prices ✅ Process Tab - Converted prices for direct comparison ⏳ Dashboard Tab - Tufte-style visualizations (coming soon) ⏳ Multi-Currency - USD, EUR, GBP support (coming soon) ⏳ Historical Data - Time series analysis (coming soon)
- Microsoft Excel (2016 or later)
- OilPriceAPI key (get one free at oilpriceapi.com)
- Download the latest release
- Open Excel
- Go to Insert > Get Add-ins > Upload My Add-in
- Select the
manifest.xmlfile - The add-in will appear in the Home ribbon
- Open the Energy Price Comparison panel
- Enter your OilPriceAPI key in Settings
- Click "Save"
- Click "Test Connection" to verify
- Select commodities to fetch (Brent, WTI, Natural Gas, Coal)
- Click "Fetch Prices"
- A "Data" sheet will be created with raw prices
- Click "Convert to MBtu"
- A "Process" sheet will be created with converted prices
- Compare prices directly in $/MBtu
The add-in uses standard heat content factors:
| Commodity | Unit | Heat Content (MMBtu) |
|---|---|---|
| Crude Oil (Brent/WTI) | barrel | 5.8 |
| Natural Gas | Mcf | 1.037 |
| Coal (Bituminous) | tonne | 24 |
| Coal (Sub-bituminous) | tonne | 17 |
| LNG | tonne | 51.6 |
| Diesel/Gasoil | barrel | 5.77 |
| Gasoline | barrel | 5.05 |
Formula: Price per MBtu = Price per unit ÷ Heat content
- Brent Crude: $85.50/barrel
- Heat Content: 5.8 MMBtu/barrel
- Result: $14.74/MBtu
npm installnpm run buildnpm test
npm run test:coveragenpm run dev # Watch modeCurrent test coverage: 98.18%
- Conversion utilities: 100%
- API client: 97%
excel-energy-addin/
├── src/
│ ├── index.ts # Core Excel operations
│ └── utils/
│ ├── conversions.ts # Energy unit conversions
│ └── api-client.ts # OilPriceAPI client
├── tests/
│ └── unit/
│ ├── conversions.test.ts
│ └── api-client.test.ts
├── public/
│ ├── taskpane.html # UI
│ ├── taskpane.css # Styles
│ └── taskpane.js # UI logic
├── dist/ # Build output
├── manifest.xml # Excel add-in manifest
└── package.json
- Taskpane UI → User selects commodities
- API Client → Fetches prices from OilPriceAPI
- Data Sheet → Stores raw price data
- Conversion Utils → Calculates $/MBtu
- Process Sheet → Displays converted prices
- TypeScript - Type-safe development
- Office.js - Excel integration
- Webpack - Module bundling
- Jest - Unit testing
- OilPriceAPI - Real-time commodity prices
See GitHub Issues for full roadmap.
- Energy unit conversions
- API client with error handling
- Data and Process sheets
- Basic UI
- Multi-unit toggle (MBtu, GJ, kWh, toe)
- Multi-currency (USD, EUR, GBP)
- Historical exchange rates
- Tufte-style dashboard
- Sparklines
- Small multiples
- Relative value matrix
- Historical data analysis
- Forward curves
- Price alerts
- Scenario modeling
- Documentation: docs.oilpriceapi.com
- Issues: GitHub Issues
- Email: support@oilpriceapi.com
MIT License - Free for personal and commercial use
Contributions welcome! Please:
- Fork the repository
- Create a feature branch
- Add tests for new features
- Ensure 80%+ test coverage
- Submit a pull request
Built with ❤️ by the OilPriceAPI team
Special thanks to:
- Edward Tufte for design principles
- Microsoft Office.js team
- Open source contributors