danabrey / supernova-api
PHP API wrapper for supernovafantasyfootball.com
Requires
- php: ^7.4|^8.0
- ext-json: *
- spatie/data-transfer-object: ^2.8
- symfony/http-client: ^5.2|^6.0|^7.0
- symfony/property-access: ^5.2|^6.0|^7.0
- symfony/serializer: ^5.2|^6.0|^7.0
Requires (Dev)
- phpunit/phpunit: ^9.5
README
PHP library for interacting with the read-only Supernova Fantasy Football API.
Installation
composer require danabrey/supernova-api
Usage
Create an instance of the client
$client = new DanAbrey\SupernovaApi\SupernovaApiClient('api_key_here');
An API key is required to interact with the Supernova API. This must be passed into the client as the only argument.
$client->leagues('xxxxx')
where xxxxx is the user's email address for list of user's leagues basic info
$client->league(xxxxx)
where xxxxx is the league ID for league settings and franchise info
All methods return either a single instance, or an array of, objects that represent the data returned. e.g. SupernovaLeague
Note
It is your responsibility to abide by the terms of the Supernova API.
Running tests
./vendor/bin/phpunit tests