Energy Prices API - Dart/Flutter Client
Energy Prices returns the latest daily closing spot price for WTI and Brent crude, Henry Hub natural gas and US gasoline, diesel, heating oil, propane and jet fuel benchmarks, with the previous close, the daily change and the 52-week high and low. Convert to barrels, gallons, liters, MMBtu, therms or MWh, ask for several benchmarks at once, or pull a daily or weekly history.
This is the Dart/Flutter client for the Energy Prices API.
Installation
Add this to your pubspec.yaml:
dependencies:
apiverve_energyprices: ^1.2.5
Then run:
dart pub get
# or for Flutter
flutter pub get
Usage
import 'package:apiverve_energyprices/apiverve_energyprices.dart';
void main() async {
final client = EnergypricesClient('YOUR_API_KEY');
try {
final response = await client.execute({
'benchmark': 'wti',
'unit': 'gallon',
'date': '2025-06-13',
'history': 'daily',
'days': 30
});
print('Status: ${response.status}');
print('Data: ${response.data}');
} catch (e) {
print('Error: $e');
}
}
Response
{
"status": "ok",
"error": null,
"data": {
"count": 1,
"date": "2026-11-11",
"prices": [
{
"benchmark": "wti",
"name": "WTI Crude Oil",
"product": "crude oil",
"location": "Cushing, OK",
"currency": "USD",
"unit": "barrel",
"nativeUnit": "barrel",
"price": 89.62,
"date": "2026-11-11",
"previousClose": 89.62,
"previousDate": "2026-11-10",
"change": 0,
"changePercent": 0,
"changeDirection": "unchanged",
"high52w": 114.58,
"high52wDate": "2026-04-07",
"low52w": 55.44,
"low52wDate": "2025-12-16"
}
]
}
}
API Reference
- API Home: Energy Prices API
- Documentation: docs.apiverve.com/ref/energyprices
Authentication
All requests require an API key. Get yours at apiverve.com.
License
MIT License - see LICENSE for details.
Built with Dart for APIVerve
Libraries
- apiverve_energyprices
- Energy Prices API client for Dart/Flutter