With the Players API, you can obtain information from a collection of players simultaneously. To obtains general players information, the players collection can be qualified in the URI by a particular game, league or team. To obtain specific league or team related information, the players collection is qualified by the relevant league or team. Each element beneath the Players Collection will be a Player Resource
GET
| URI | Description | Sample |
|---|---|---|
http://fantasysports.yahooapis.com/fantasy/v2/league/{league_key}/players
|
Fetch all players within a league. |
|
http://fantasysports.yahooapis.com/fantasy/v2/leagues;league_keys={league_key1},{league_key2}/players
|
Fetch all players from the leagues {league_key1} and {league_key2} |
|
http://fantasysports.yahooapis.com/fantasy/v2/team/{team_key}/players
|
Fetch all players within a team. |
|
http://fantasysports.yahooapis.com/fantasy/v2/teams;team_keys={team_key1},{team_key2}/players
|
Fetch all players from the teams {team_key1} and {team_key2} |
|
http://fantasysports.yahooapis.com/fantasy/v2/players;player_keys={player_key1},{player_key2}
|
Fetch specific players {player_key1} and {player_key2} |
|
Any sub-resource valid for a player is a valid sub-resource under the players collection.
Any sub-resource for a collection of players is extracted using a URI like:
/players/{sub_resource}
OR
/players;player_keys={player_key1},{player_key2}/{sub_resource}
Multiple sub-resources can be extracted from players in the same URI using a format like:
/players;out={sub_resource_1},{sub_resource_2}
OR
/players;player_keys={player_key1},{player_key2};out={sub_resource_1},{sub_resource_2}
The players collection can have filters such as the following to obtain a subset of a players collection that satisfy the filtering condition. The filters can be combined to obtain a more restricted list of players.
| Filter parameter | Filter parameter values | Usage |
|---|---|---|
| position | Valid player positions |
/players;position=QB
NoteApplied only in a league's context |
| status |
A (all available players) FA (free agents only) W (waivers only) T (all taken players) K (keepers only) |
/players;status=A
NoteApplied only in a league's context |
| search |
player name |
/players;search=smith
NoteApplied only in a league's context |
| sort |
{stat_id} NAME (last, first) OR (overall rank) AR (actual rank) PTS (fantasy points) |
/players;sort=60
NoteApplied only in a league's context |
| sort_type |
season date (baseball, basketball, and hockey only) week (football only) lastweek (baseball, basketball, and hockey only) lastmonth |
/players;sort_type=season
NoteApplied only in a league's context |
| sort_season |
year |
/players;sort_type=season;sort_season=2010
NoteApplied only in a league's context |
| sort_date (baseball, basketball, and hockey only) |
YYYY-MM-DD |
/players;sort_type=date;sort_date=2010-02-01
NoteApplied only in a league's context |
| sort_week (football only) |
week |
/players;sort_type=week;sort_week=10
NoteApplied only in a league's context |
| start | Any integer 0 or greater |
/players;start=25
|
| count | Any integer greater than 0 |
/players;count=5
|