Games
Retrieve a list of games for today, or between a date range.
GET /games
Parameters
- start_date – (optional. defaults to beginning of today) The lower bound for selecting a range of games, must be paired with a end_date parameter. Format as specified in our Date & Time Formatting docs.
- end_date – (optional. required for start_date. defaults to end of today) The upper bound for selecting a range of games. start_date will default to beginning of day if not specified. Format as specified in our Date & Time Formatting docs.
- team_short_name – (optional) If you want games for only one particular team, pass in the team’s short name. Pair with the league_id_string in order to specify what league to look for the team in.
- league_id_string – (optional) Used for identifying what league the team you would like to find games for. Pair with the team_short_name parameter. See Identifying Games docs for more information.
Example
Get information about games happening today:
$ curl http://fanvibe.com/api/games.xml <?xml version="1.0" encoding="UTF-8"?> <games type="array"> <game> <id>108524</id> <competition_type>Regular Season</competition_type> <competition_status>scheduled</competition_status> <start_date>2010-09-28T16:05:00-07:00</start_date> <away_team> <team_id>3196</team_id> <team_name>Yankees</team_name> <team_picks>10</team_picks> </away_team> <home_team> <team_id>3194</team_id> <team_name>Orioles</team_name> <team_picks>2</team_picks> </home_team> </game> <game> <id>108525</id> <competition_type>Regular Season</competition_type> <competition_status>scheduled</competition_status> <start_date>2010-09-28T16:05:00-07:00</start_date> <away_team> <team_id>3187</team_id> <team_name>Diamondbacks</team_name> <team_picks>7</team_picks> </away_team> <home_team> <team_id>3176</team_id> <team_name>Pirates</team_name> <team_picks>1</team_picks> </home_team> </game> </games>
Or, get details for a single game by specifying the game id, like this:
$ curl http://fanvibe.com/api/games/178735.xml <game> <id>178735</id> <competition_type>Regular Season</competition_type> <competition_status>scheduled</competition_status> <start_date>2010-10-26T16:30:00-07:00</start_date> <has_checked_in>false</has_checked_in> <checkin_count>2</checkin_count> <shout_count>0</shout_count> <away_team> <team_id>3131</team_id> <team_name>Heat</team_name> <team_picks></team_picks> </away_team> <home_team> <team_id>3123</team_id> <team_name>Celtics</team_name> <team_picks>2</team_picks> </home_team> </game>
Or, get details for a single game by specifying the NBA id, like this:
$ curl http://fanvibe.com/api/games/0021000001.xml?id_type=NBA <game> <id>178735</id> <competition_type>Regular Season</competition_type> <competition_status>scheduled</competition_status> <start_date>2010-10-26T16:30:00-07:00</start_date> <has_checked_in>false</has_checked_in> <checkin_count>2</checkin_count> <shout_count>0</shout_count> <away_team> <team_id>3131</team_id> <team_name>Heat</team_name> <team_picks></team_picks> </away_team> <home_team> <team_id>3123</team_id> <team_name>Celtics</team_name> <team_picks>2</team_picks> </home_team> </game>
Next: Users →