When users join a Fantasy Football, Baseball, Basketball, or Hockey draft and trade game, they are organized into leagues
with a limited number of friends or other Yahoo! users, with each user managing a Team. With the League API, you can obtain the league related information, like the league name, the number of teams, the draft
status, et cetera. Leagues only exist in the context of a particular Game, although you can request a League Resource as the base of your URI by using the global league_key
. A particular user can only retrieve data for private leagues of which they are a member, or for public leagues.
GET
http://fantasysports.yahooapis.com/fantasy/v2/league/{league_key}
Any sub-resource under a league is extracted using a URI like:
http://fantasysports.yahooapis.com/fantasy/v2/league/{league_key}/{sub_resource}
Multiple sub-resources can be extracted from league in the same URI using a format like:
http://fantasysports.yahooapis.com/fantasy/v2/league/{league_key};out={sub_resource_1},{sub_resource_2}
{game_key}.l.{league_id}
Example: pnfl.l.431
or 223.l.431
game_key
and league_id
is a lower case L (not the number 1).
Default sub-resource:
metadata
Name | Description | URI | Sample |
---|---|---|---|
metadata
|
Includes league key, id, name, url, draft status, number of teams, and current week information. |
/fantasy/v2/league/{league_key}/metadata
|
|
settings
|
League settings. For instance, draft type, scoring type, roster positions, stat categories and modifiers, divisions. |
/fantasy/v2/league/{league_key}/settings
|
|
standings
|
Ranking of teams within the league. Accepts Teams as a sub-resource, and includes team_standings data by default beneath the teams
|
/fantasy/v2/league/{league_key}/standings
|
|
scoreboard
|
League scoreboard. Accepts Matchups as a sub-resource, which in turn accept Teams as a sub-resource. Includes team_stats data by default.
|
Scoreboard for current week:
Scoreboard for a particular week:
|
|
teams
|
All teams in the league. |
/fantasy/v2/league/{league_key}/teams
|
|
players
|
The league's eligible players. |
/fantasy/v2/league/{league_key}/players
|
|
draftresults
|
Draft results for all teams in the league. |
/fantasy/v2/league/{league_key}/draftresults
|
|
transactions
|
League transactions -- adds, drops, and trades. |
/fantasy/v2/league/{league_key}/transactions
|
|
http://fantasysports.yahooapis.com/fantasy/v2/league/223.l.431
http://fantasysports.yahooapis.com/fantasy/v2/league/223.l.431/settings
http://fantasysports.yahooapis.com/fantasy/v2/league/223.l.431/standings
http://fantasysports.yahooapis.com/fantasy/v2/league/223.l.431/scoreboard