Team resource

Description

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.

HTTP Operations Supported

  • GET

URIs

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}

Team key format

{game_key}.l.{league_id}.t.{team_id}

Example: pnfl.l.431.t.1 or 223.l.431.t.1

Sub-resources

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

http://fantasysports.yahooapis.com/fantasy/v2/team/223.l.431.t.9

stats Team statistical data and points.

Season stats: /fantasy/v2/team/{team_key}/stats

Week stats: /fantasy/v2/team/{team_key}/stats;type=week;week={week}

Here {week} is a non-zero integer, or current for the current week.

http://fantasysports.yahooapis.com/fantasy/v2/team/223.l.431.t.9/stats;type=week;week=2

standings Team rank, wins, losses, ties, and winning percentage (as well as divisional data if applicable).

/fantasy/v2/team/{team_key}/standings

http://fantasysports.yahooapis.com/fantasy/v2/team/223.l.431.t.9/standings

roster Team roster. Accepts a week parameter. Also accepts Players as a sub-resource (included by default)

Roster for a particular week: /fantasy/v2/team/{team_key}/roster;week={week}

Here {week} is a non-zero integer. If week is current, or isn't provided, defaults to current week.

http://fantasysports.yahooapis.com/fantasy/v2/team/223.l.431.t.9/roster;week=2 - The week 2 roster for team 223.l.431.t.9

draftresults List of players drafted by the team.

/fantasy/v2/team/{team_key}/draftresults

http://fantasysports.yahooapis.com/fantasy/v2/team/223.l.431.t.9/draftresults

matchups All the matchups this team has scheduled (for H2H leagues).

All matchups: /fantasy/v2/team/{team_key}/matchups

Particular weeks: /fantasy/v2/team/{team_key}/matchups;weeks=1,3,6

http://fantasysports.yahooapis.com/fantasy/v2/team/223.l.431.t.9/matchups;weeks=1,3,6

Sample XML

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

Table of Contents