Games collection

Description

With the Games API, you can obtain information from a collection of games simultaneously. Each element beneath the Games Collection will be a Game Resource

HTTP Operations Supported

  • GET

URIs

URI Description Sample
http://fantasysports.yahooapis.com/fantasy/v2/games;game_keys={game_key1},{game_key2} Fetch specific games {game_key1} and {game_key2} nfl and mlb games:

http://fantasysports.yahooapis.com/fantasy/v2/games;game_keys=nfl,mlb

http://fantasysports.yahooapis.com/fantasy/v2/users;use_login=1/games Fetch all games for the logged in user all games for user:

http://fantasysports.yahooapis.com/fantasy/v2/users;use_login=1/games

http://fantasysports.yahooapis.com/fantasy/v2/users;use_login=1/games;game_keys={game_key1},{game_key2} Fetch specific games {game_key1} and {game_key2} that the logged in user owns teams in. nfl and mlb games for user:

http://fantasysports.yahooapis.com/fantasy/v2/users;use_login=1/games;game_keys=nfl,mlb

Any sub-resource valid for a game is a valid sub-resource under the games collection.

Any sub-resource for a collection of games is extracted using a URI like:

/games/{sub_resource}

OR

/games;game_keys={game_key1},{game_key2}/{sub_resource}

Multiple sub-resources can be extracted from games in the same URI using a format like:

/games;out={sub_resource_1},{sub_resource_2}

OR

/games;game_keys={game_key1},{game_key2};out={sub_resource_1},{sub_resource_2}

Filters

The games collection can have filters such as the following to obtain a subset of a games collection that satisfy the filtering condition. These filters can be combined to obtain a more restricted list of games. For instance, if you wanted only the 2011 version of the nfl game, you might filter by seasons=2011 and game_codes=nfl.

Filter parameter Filter parameter values Usage
is_available 1 to only show games currently in season /games;is_available=1
game_types full|pickem-team|pickem-group|pickem-team-list /games;game_types=full,pickem-team
game_codes Any valid game codes /games;game_codes=nfl,mlb
seasons Any valid seasons /games;seasons=2011,2012

Sub-resources

In addition to the sub-resources valid for a game resource, the following are valid sub-resources for a games collection.

Name Description URI Sample
teams Fetch teams owned by a user for one or more games.

/fantasy/v2/users;use_login=1/games/teams

OR

/fantasy/v2/users;use_login=1/games;game_keys={game_key1},{game_key2}/teams

all teams for user:

http://fantasysports.yahooapis.com/fantasy/v2/users;use_login=1/games/teams

Table of Contents