Looking to hire Laravel developers? Try LaraJobs

laravel-carbon-intensity maintained by sebrave

Description
Wrapper for UK National Grid Carbon Intensity API
Author
Last update
2021/07/23 09:49 (dev-main)
License
Downloads
5

Comments
comments powered by Disqus

Wrapper for UK National Grid Carbon Intensity API

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.