octopus_energy_api_client 1.0.0
octopus_energy_api_client: ^1.0.0 copied to clipboard
A client for accessing the Octopus Energy API. Please note that Client for Octopus Energy API is unofficial and not endorsed by Octopus Energy.
example/octopus_energy_api_client_example.dart
// ignore_for_file: unused_local_variable
import 'package:octopus_energy_api_client/v1.dart';
Future<void> main() async {
// Your Octopus Energy API key.
final apiKey = 'sk_live_...';
// Obtain an HTTP client that authenticates every request with your API key.
final client = clientViaApiKey(apiKey);
// Create the API client for the v1 API.
final api = OctopusEnergyApiClient(client: client);
// Call an endpoint.
final account = await api.accounts.getAccount('A-1234ABCD');
// Release the underlying HTTP resources when you are done.
client.close();
}