sebrave/laravel-carbon-intensity

Wrapper for UK National Grid Carbon Intensity API

Installs: 5

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/sebrave/laravel-carbon-intensity

dev-main 2021-07-23 07:49 UTC

This package is auto-updated.

Last update: 2025-10-23 16:59:07 UTC


README

This Laravel package helps you work with the UK National Grid's Carbon Intensity Forecasting API.

You can read more about the API at their website: https://carbonintensity.org.uk

Installation

You can install the package via composer:

composer require sebrave/laravel-carbon-intensity

Usage

$api = new \Sebrave\LaravelCarbonIntensity\LaravelCarbonIntensity();

// Get current forecast
$api->get();

// Get forecast for a Carbon date
$api->getByDate(now());

// Get forecast for first part of a UK postcode
$api->getByPostcode('EC1V');

// Get a breakdown by fuel type
$api->getBreakdown();

Testing

composer test

License

The MIT License (MIT). Please see License File for more information.