Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

yahoo-fantasy-api-demo

Yahoo! Fantasy Sports API demo using OAuth APIs

This repo will provides starter scripts and links to relevant documentation for interacting with the Yahoo! Fantasy Sports YDN APIs.

Documentation

The public documentation is somewhat outdated and still tries to link to OAuth1.0 guides, which is no longer supported. You can still use the public documentation to understand basic API structure, but you'll need to use the OAuth2 guide for authorization.

OAuth2 Flow

Endpoints

  • OAuth2 endpoint: https://fantasysports.yahooapis.com/fantasy/v2/...

Examples

OAuth2 PHP Scripts

This script demonstrates a very basic OAuth flows in PHP. They do not have any external dependencies, aside from PHP and Curl.

Get User's Teams

Usage

Make sure to have your CONSUMER_KEY and CONSUMER_SECRET handy.

% php oauth_get_teams.php <CONSUMER_KEY> <CONSUMER_SECRET> [game_keys]
  • CONSUMER_KEY: Your consumer key from your YDN application (set up as described in the OAuth2 Flow)
  • CONSUMER_SECRET: Corresponding consumer secret
  • game_keys: CSV of game codes or IDs.
    • Examples: nfl, nba,mlb,nfl, 370

Get Public Players Details

Usage

Just run the script with your keys. It'll fetch public NFL players details.

% php oauth_get_public_data.php <CONSUMER_KEY> <CONSUMER_SECRET>
  • CONSUMER_KEY: Your consumer key from your YDN application (set up as described in the OAuth2 Flow)
  • CONSUMER_SECRET: Corresponding consumer secret

About

Quick demo of interacting with the Yahoo! Fantasy Sports public OAuth API

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages