Skip to content

Latest commit

 

History

History
573 lines (425 loc) · 20 KB

GamesApi.md

File metadata and controls

573 lines (425 loc) · 20 KB

cfbd.GamesApi

All URIs are relative to https://api.collegefootballdata.com

Method HTTP request Description
get_advanced_box_score GET /game/box/advanced Advanced box scores
get_calendar GET /calendar Season calendar
get_game_media GET /games/media Game media information and schedules
get_game_weather GET /games/weather Game weather information (Patreon only)
get_games GET /games Games and results
get_player_game_stats GET /games/players Player game stats
get_scoreboard GET /scoreboard Live game results (Patreon only)
get_team_game_stats GET /games/teams Team game stats
get_team_records GET /records Team records

get_advanced_box_score

BoxScore get_advanced_box_score(game_id)

Advanced box scores

Get advanced box score data

Example

from __future__ import print_function
import time
import cfbd
from cfbd.rest import ApiException
from pprint import pprint

# Configure API key authorization: ApiKeyAuth
configuration = cfbd.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = cfbd.GamesApi(cfbd.ApiClient(configuration))
game_id = 56 # int | Game id parameters

try:
    # Advanced box scores
    api_response = api_instance.get_advanced_box_score(game_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling GamesApi->get_advanced_box_score: %s\n" % e)

Parameters

Name Type Description Notes
game_id int Game id parameters

Return type

BoxScore

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_calendar

list[Week] get_calendar(year)

Season calendar

Get calendar of weeks by season

Example

from __future__ import print_function
import time
import cfbd
from cfbd.rest import ApiException
from pprint import pprint

# Configure API key authorization: ApiKeyAuth
configuration = cfbd.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = cfbd.GamesApi(cfbd.ApiClient(configuration))
year = 56 # int | Year filter

try:
    # Season calendar
    api_response = api_instance.get_calendar(year)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling GamesApi->get_calendar: %s\n" % e)

Parameters

Name Type Description Notes
year int Year filter

Return type

list[Week]

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_game_media

list[GameMedia] get_game_media(year, week=week, season_type=season_type, team=team, conference=conference, media_type=media_type, classification=classification)

Game media information and schedules

Game media information (TV, radio, etc)

Example

from __future__ import print_function
import time
import cfbd
from cfbd.rest import ApiException
from pprint import pprint

# Configure API key authorization: ApiKeyAuth
configuration = cfbd.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = cfbd.GamesApi(cfbd.ApiClient(configuration))
year = 56 # int | Year filter
week = 56 # int | Week filter (optional)
season_type = 'season_type_example' # str | Season type filter (regular, postseason, or both) (optional)
team = 'team_example' # str | Team filter (optional)
conference = 'conference_example' # str | Conference filter (optional)
media_type = 'media_type_example' # str | Media type filter (tv, radio, web, ppv, or mobile) (optional)
classification = 'classification_example' # str | Division classification filter (fbs/fcs/ii/iii) (optional)

try:
    # Game media information and schedules
    api_response = api_instance.get_game_media(year, week=week, season_type=season_type, team=team, conference=conference, media_type=media_type, classification=classification)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling GamesApi->get_game_media: %s\n" % e)

Parameters

Name Type Description Notes
year int Year filter
week int Week filter [optional]
season_type str Season type filter (regular, postseason, or both) [optional]
team str Team filter [optional]
conference str Conference filter [optional]
media_type str Media type filter (tv, radio, web, ppv, or mobile) [optional]
classification str Division classification filter (fbs/fcs/ii/iii) [optional]

Return type

list[GameMedia]

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_game_weather

list[GameWeather] get_game_weather(game_id=game_id, year=year, week=week, season_type=season_type, team=team, conference=conference, classification=classification)

Game weather information (Patreon only)

Weather information for the hour of kickoff

Example

from __future__ import print_function
import time
import cfbd
from cfbd.rest import ApiException
from pprint import pprint

# Configure API key authorization: ApiKeyAuth
configuration = cfbd.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = cfbd.GamesApi(cfbd.ApiClient(configuration))
game_id = 56 # int | Game id filter (required if no year) (optional)
year = 56 # int | Year filter (required if no game id) (optional)
week = 56 # int | Week filter (optional)
season_type = 'season_type_example' # str | Season type filter (regular, postseason, or both) (optional)
team = 'team_example' # str | Team filter (optional)
conference = 'conference_example' # str | Conference filter (optional)
classification = 'classification_example' # str | Division classification filter (fbs/fcs/ii/iii) (optional)

try:
    # Game weather information (Patreon only)
    api_response = api_instance.get_game_weather(game_id=game_id, year=year, week=week, season_type=season_type, team=team, conference=conference, classification=classification)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling GamesApi->get_game_weather: %s\n" % e)

Parameters

Name Type Description Notes
game_id int Game id filter (required if no year) [optional]
year int Year filter (required if no game id) [optional]
week int Week filter [optional]
season_type str Season type filter (regular, postseason, or both) [optional]
team str Team filter [optional]
conference str Conference filter [optional]
classification str Division classification filter (fbs/fcs/ii/iii) [optional]

Return type

list[GameWeather]

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_games

list[Game] get_games(year, week=week, season_type=season_type, team=team, home=home, away=away, conference=conference, division=division, id=id)

Games and results

Get game results

Example

from __future__ import print_function
import time
import cfbd
from cfbd.rest import ApiException
from pprint import pprint

# Configure API key authorization: ApiKeyAuth
configuration = cfbd.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = cfbd.GamesApi(cfbd.ApiClient(configuration))
year = 56 # int | Year/season filter for games
week = 56 # int | Week filter (optional)
season_type = 'regular' # str | Season type filter (regular or postseason) (optional) (default to regular)
team = 'team_example' # str | Team (optional)
home = 'home_example' # str | Home team filter (optional)
away = 'away_example' # str | Away team filter (optional)
conference = 'conference_example' # str | Conference abbreviation filter (optional)
division = 'division_example' # str | Division classification filter (fbs/fcs/ii/iii) (optional)
id = 56 # int | id filter for querying a single game (optional)

try:
    # Games and results
    api_response = api_instance.get_games(year, week=week, season_type=season_type, team=team, home=home, away=away, conference=conference, division=division, id=id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling GamesApi->get_games: %s\n" % e)

Parameters

Name Type Description Notes
year int Year/season filter for games
week int Week filter [optional]
season_type str Season type filter (regular or postseason) [optional] [default to regular]
team str Team [optional]
home str Home team filter [optional]
away str Away team filter [optional]
conference str Conference abbreviation filter [optional]
division str Division classification filter (fbs/fcs/ii/iii) [optional]
id int id filter for querying a single game [optional]

Return type

list[Game]

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_player_game_stats

list[PlayerGame] get_player_game_stats(year, week=week, season_type=season_type, team=team, conference=conference, category=category, game_id=game_id)

Player game stats

Player stats broken down by game

Example

from __future__ import print_function
import time
import cfbd
from cfbd.rest import ApiException
from pprint import pprint

# Configure API key authorization: ApiKeyAuth
configuration = cfbd.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = cfbd.GamesApi(cfbd.ApiClient(configuration))
year = 56 # int | Year/season filter for games
week = 56 # int | Week filter (optional)
season_type = 'regular' # str | Season type filter (regular or postseason) (optional) (default to regular)
team = 'team_example' # str | Team filter (optional)
conference = 'conference_example' # str | Conference abbreviation filter (optional)
category = 'category_example' # str | Category filter (e.g defensive) (optional)
game_id = 56 # int | Game id filter (optional)

try:
    # Player game stats
    api_response = api_instance.get_player_game_stats(year, week=week, season_type=season_type, team=team, conference=conference, category=category, game_id=game_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling GamesApi->get_player_game_stats: %s\n" % e)

Parameters

Name Type Description Notes
year int Year/season filter for games
week int Week filter [optional]
season_type str Season type filter (regular or postseason) [optional] [default to regular]
team str Team filter [optional]
conference str Conference abbreviation filter [optional]
category str Category filter (e.g defensive) [optional]
game_id int Game id filter [optional]

Return type

list[PlayerGame]

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_scoreboard

list[ScoreboardGame] get_scoreboard(classification=classification, conference=conference)

Live game results (Patreon only)

Get live game results

Example

from __future__ import print_function
import time
import cfbd
from cfbd.rest import ApiException
from pprint import pprint

# Configure API key authorization: ApiKeyAuth
configuration = cfbd.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = cfbd.GamesApi(cfbd.ApiClient(configuration))
classification = 'classification_example' # str | Classification filter (fbs, fcs, ii, or iii). Defaults to fbs. (optional)
conference = 'conference_example' # str | Conference abbreviation filter. (optional)

try:
    # Live game results (Patreon only)
    api_response = api_instance.get_scoreboard(classification=classification, conference=conference)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling GamesApi->get_scoreboard: %s\n" % e)

Parameters

Name Type Description Notes
classification str Classification filter (fbs, fcs, ii, or iii). Defaults to fbs. [optional]
conference str Conference abbreviation filter. [optional]

Return type

list[ScoreboardGame]

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_team_game_stats

list[TeamGame] get_team_game_stats(year, week=week, season_type=season_type, team=team, conference=conference, game_id=game_id, classification=classification)

Team game stats

Team stats broken down by game

Example

from __future__ import print_function
import time
import cfbd
from cfbd.rest import ApiException
from pprint import pprint

# Configure API key authorization: ApiKeyAuth
configuration = cfbd.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = cfbd.GamesApi(cfbd.ApiClient(configuration))
year = 56 # int | Year/season filter for games
week = 56 # int | Week filter (optional)
season_type = 'regular' # str | Season type filter (regular or postseason) (optional) (default to regular)
team = 'team_example' # str | Team filter (optional)
conference = 'conference_example' # str | Conference abbreviation filter (optional)
game_id = 56 # int | Game id filter (optional)
classification = 'classification_example' # str | Division classification filter (fbs/fcs/ii/iii) (optional)

try:
    # Team game stats
    api_response = api_instance.get_team_game_stats(year, week=week, season_type=season_type, team=team, conference=conference, game_id=game_id, classification=classification)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling GamesApi->get_team_game_stats: %s\n" % e)

Parameters

Name Type Description Notes
year int Year/season filter for games
week int Week filter [optional]
season_type str Season type filter (regular or postseason) [optional] [default to regular]
team str Team filter [optional]
conference str Conference abbreviation filter [optional]
game_id int Game id filter [optional]
classification str Division classification filter (fbs/fcs/ii/iii) [optional]

Return type

list[TeamGame]

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_team_records

list[TeamRecord] get_team_records(year=year, team=team, conference=conference)

Team records

Get team records by year

Example

from __future__ import print_function
import time
import cfbd
from cfbd.rest import ApiException
from pprint import pprint

# Configure API key authorization: ApiKeyAuth
configuration = cfbd.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = cfbd.GamesApi(cfbd.ApiClient(configuration))
year = 56 # int | Year filter (optional)
team = 'team_example' # str | Team filter (optional)
conference = 'conference_example' # str | Conference filter (optional)

try:
    # Team records
    api_response = api_instance.get_team_records(year=year, team=team, conference=conference)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling GamesApi->get_team_records: %s\n" % e)

Parameters

Name Type Description Notes
year int Year filter [optional]
team str Team filter [optional]
conference str Conference filter [optional]

Return type

list[TeamRecord]

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]