The Team APIs allow you to retrieve information about a team within our fantasy games. The team is the basic unit for keeping
track of a roster of players, and can be managed by either one or two managers (the second manager being called a co-manager).
With the Team APIs, you can obtain team-related information, like the team name, managers, logos, stats and points, and rosters
for particular weeks. Teams only exist in the context of a particular League, although you can request a Team Resource as the base of your URI by using the global team_key. A particular user can only retrieve data about a team if that team is part of a private league of which the user is a member,
or if it's in a public league.
GET
http://fantasysports.yahooapis.com/fantasy/v2/team/{team_key}
Any sub-resource under a team is extracted using a URI like:
http://fantasysports.yahooapis.com/fantasy/v2/team/{team_key}/{sub_resource}
Multiple sub-resources can be extracted from team in the same URI using a format like:
http://fantasysports.yahooapis.com/fantasy/v2/team/{team_key};out={sub_resource_1},{sub_resource_2}
Default sub-resource:
metadata
| Name | Description | URI | Sample |
|---|---|---|---|
metadata
|
Includes team key, id, name, url, division ID, logos, and team manager information. |
/fantasy/v2/team/{team_key}/metadata
|
|
stats
|
Team statistical data and points. |
Season stats:
Week stats:
Here
|
|
standings
|
Team rank, wins, losses, ties, and winning percentage (as well as divisional data if applicable). |
|
|
roster
|
Team roster. Accepts a week parameter. Also accepts Players as a sub-resource (included by default) |
Roster for a particular week:
Here
|
|
draftresults
|
List of players drafted by the team. |
|
|
matchups
|
All the matchups this team has scheduled (for H2H leagues). |
All matchups:
Particular weeks:
|
|
http://fantasysports.yahooapis.com/fantasy/v2/team/223.l.431.t.1
http://fantasysports.yahooapis.com/fantasy/v2/team/223.l.431.t.1/matchups;weeks=1,5 - team's matchups for weeks 1 and 5 in a NFL H2H league
http://fantasysports.yahooapis.com/fantasy/v2/team/223.l.431.t.1/stats;type=season - team's season stats in a NFL H2H league
http://fantasysports.yahooapis.com/fantasy/v2/team/253.l.102614.t.10/stats;type=date;date=2011-07-06 - team's date stats in a MLB roto league