Skip to main content

apiverve_energyprices 1.2.6 copy "apiverve_energyprices: ^1.2.6" to clipboard
apiverve_energyprices: ^1.2.6 copied to clipboard

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, [...]

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.

pub package License: MIT

This is the Dart/Flutter client for the Energy Prices API.

Installation #

Add this to your pubspec.yaml:

dependencies:
  apiverve_energyprices: ^1.2.6

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 #

Authentication #

All requests require an API key. Get yours at apiverve.com.

License #

MIT License - see LICENSE for details.


Built with Dart for APIVerve

0
likes
120
points
66
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

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.

Homepage
Repository (GitHub)
View/report issues
Contributing

License

MIT (license)

Dependencies

http, http_parser

More

Packages that depend on apiverve_energyprices