konradbaron/fantasydata

There is no license information available for the latest version (dev-master) of this package.

PHP library for the Fantasy Data API

dev-master 2018-08-03 19:28 UTC

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');