From a price check to a repeatable report
Put Waha–Henry Hub basis into your spreadsheet
Fetch both benchmark prices, subtract Henry Hub from Waha, and export a CSV with a separate source timestamp for each leg. Negative Waha prices and a negative basis are valid observations.
1. Download the Python integration
The script uses Python 3.9 or later with no extra packages. It writes a CSV only after both requests return valid prices and dated observations. Your key stays in your own environment.
Download waha_basis.pyRun the script on your computer or a trusted server. Keep the key out of shared workbooks and source control.
2. Connect your account and export
Set OILPRICEAPI_KEY in your environment, then run:
python3 waha_basis.py > waha-basis.csvEvaluation and paid access depend on your account and the requested series. A 401 response means the key needs attention; 402 or 403 requires checking entitlement; 429 requires waiting before retrying. The script reports failures without substituting a zero price.
3. Import the CSV into Excel or Google Sheets
Use your spreadsheet's CSV import. The file contains the export time, both source timestamps, Waha and Henry Hub prices in USD/MMBtu, and the calculated basis. With the default column order, the equivalent spreadsheet formula is =D2-E2.
Compare both timestamps against your workflow's freshness requirement before using the result. The two observations may come from different source periods; exporting them together does not make them simultaneous. A manual CSV import is a snapshot; rerun and import again when you need another observation.
Before extending this into a historical model
This integration fetches latest observations. For a backtest, verify the available history for both codes, align reporting dates, and retain missing periods rather than filling them with zero. Basis is Waha minus Henry Hub throughout this workflow; it is a price differential, not a pipeline-capacity measurement.
Review date ranges, intervals, and historical access