konradbaron / fantasydata
PHP library for the Fantasy Data API
Installs: 44
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 1
Forks: 0
Open Issues: 0
Type:package
Requires
- guzzlehttp/guzzle: ~6.2
This package is not auto-updated.
Last update: 2025-04-28 02:37:46 UTC
README
PHP-FantasyData is a PHP library for the FantasyData API version 3. This library currently only contains wrappers for the Full NFL section, and the NBA Scores section of the API. Other sections are planned to be added in the future.
The API currently returns your data in two formats; JSON and XML.
Requirements
This library requires the use of Composer.
composer require konradbaron/fantasydata:dev-master
You must first register an account to receive an API key from FantasyData Portal. There is a free trial option, which limits the amount of API calls to 1K per month.
Example Usage
NFL
use KonradBaron\FantasyData\FantasyDataNFLPlayByPlay; $fd = new FantasyDataNFLPlayByPlay('YOUR_API_KEY'); echo $fd->playByPlay('json', '2016REG', 8, 'WAS');
NBA
use KonradBaron\FantasyData\FantasyDataNBAScores; $fd = new FantasyDataNBAScores('YOUR_API_KEY'); echo $fd->schedules('json', '2016');