Download the PHP package markmorgan/octopus-energy without Composer
On this page you can find all versions of the php package markmorgan/octopus-energy. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download markmorgan/octopus-energy
More information about markmorgan/octopus-energy
Files in markmorgan/octopus-energy
Package octopus-energy
Short Description Octopus Energy PHP SDK
License mit
Homepage https://github.com/mark-morgan/octopus-energy
Informations about the package octopus-energy
Octopus Energy PHP SDK
These PHP bindings provide convenient access to the Octopus Energy Restful API for PHP applications.
Note: Accounts and Quotes endpoints are not implemented in this SDK as they are only available to Partner Organisations.
Requirements
- An Octopus Energy account API Key (https://octopus.energy/dashboard/developer/)
- PHP >= 7.1
Installation
Install using composer
Usage
Initialisation
Before requesting data you will need to set your access credentials. This is done by initialising the OctopusEnergy Client:
Services
The SDK has services for Product
, Meter
, and Industry
functions. The best place to look for all the functions available is within the services themselves.
Product
Fetch all products (additional product filters available, see function signature):
Fetch a specific product from its product code:
Meter
Fetch info for a specific meter:
Fetch meter consumption:
Filter the consumption between specific dates:
Industry
Fetch information about Grid Supply Points:
Testing
You can run PHPUnit against the library by running composer install and then running phpunit. Before doing so, you'll need to copy the example.phpunit.xml to phpunit.xml and change the environment variables for your API and meter details.