### Search Players API Example Source: https://github.com/cfbd/cfbd-python/blob/main/docs/PlayersApi.md Searches for players based on a search term, with optional filters for year, team, and position. This example shows the basic setup for API client configuration and authentication. ```python import time import os import cfbd from cfbd.models.player_search_result import PlayerSearchResult from cfbd.rest import ApiException from pprint import pprint configuration = cfbd.Configuration( host = "https://api.collegefootballdata.com" ) configuration = cfbd.Configuration( access_token = os.environ["BEARER_TOKEN"] ) ``` -------------------------------- ### Get Transfer Portal Data API Example Source: https://github.com/cfbd/cfbd-python/blob/main/docs/PlayersApi.md Retrieves transfer portal data for a specified year. This example demonstrates setting up the API client with Bearer token authentication and handling potential exceptions. ```python import time import os import cfbd from cfbd.models.player_transfer import PlayerTransfer from cfbd.rest import ApiException from pprint import pprint configuration = cfbd.Configuration( host = "https://api.collegefootballdata.com" ) configuration = cfbd.Configuration( access_token = os.environ["BEARER_TOKEN"] ) with cfbd.ApiClient(configuration) as api_client: api_instance = cfbd.PlayersApi(api_client) year = 56 try: api_response = api_instance.get_transfer_portal(year) print("The response of PlayersApi->get_transfer_portal:\n") pprint(api_response) except Exception as e: print("Exception when calling PlayersApi->get_transfer_portal: %s\n" % e) ``` -------------------------------- ### Instantiate RecruitHometownInfo from JSON and Dict Source: https://github.com/cfbd/cfbd-python/blob/main/docs/RecruitHometownInfo.md Demonstrates how to create a RecruitHometownInfo object from a JSON string or a dictionary, and how to convert it back to a dictionary. Ensure the JSON string is valid. ```python from cfbd.models.recruit_hometown_info import RecruitHometownInfo # TODO update the JSON string below json = "{}" # create an instance of RecruitHometownInfo from a JSON string recruit_hometown_info_instance = RecruitHometownInfo.from_json(json) # print the JSON string representation of the object print RecruitHometownInfo.to_json() # convert the object into a dict recruit_hometown_info_dict = recruit_hometown_info_instance.to_dict() # create an instance of RecruitHometownInfo from a dict recruit_hometown_info_from_dict = RecruitHometownInfo.from_dict(recruit_hometown_info_dict) ``` -------------------------------- ### Instantiate LiveGamePlay from JSON and Dict Source: https://github.com/cfbd/cfbd-python/blob/main/docs/LiveGamePlay.md Demonstrates how to create a LiveGamePlay object from a JSON string or a Python dictionary. It also shows how to convert the object back to a dictionary and then to a JSON string. ```python from cfbd.models.live_game_play import LiveGamePlay # TODO update the JSON string below json = "{}" # create an instance of LiveGamePlay from a JSON string live_game_play_instance = LiveGamePlay.from_json(json) # print the JSON string representation of the object print LiveGamePlay.to_json() # convert the object into a dict live_game_play_dict = live_game_play_instance.to_dict() # create an instance of LiveGamePlay from a dict live_game_play_from_dict = LiveGamePlay.from_dict(live_game_play_dict) ``` -------------------------------- ### Instantiate and Convert Matchup Model Source: https://github.com/cfbd/cfbd-python/blob/main/docs/Matchup.md Demonstrates how to create a Matchup object from a JSON string or a dictionary, and how to convert it back to JSON or a dictionary. Ensure the JSON string is valid. ```python from cfbd.models.matchup import Matchup # TODO update the JSON string below json = "{}" # create an instance of Matchup from a JSON string matchup_instance = Matchup.from_json(json) # print the JSON string representation of the object print Matchup.to_json() # convert the object into a dict matchup_dict = matchup_instance.to_dict() # create an instance of Matchup from a dict matchup_from_dict = Matchup.from_dict(matchup_dict) ``` -------------------------------- ### Get Team SRS Data Source: https://github.com/cfbd/cfbd-python/blob/main/docs/RatingsApi.md Retrieves historical Simple Rating System (SRS) data for a given year, team, or conference. This example demonstrates Bearer token authentication. ```python import time import os import cfbd from cfbd.models.team_srs import TeamSRS from cfbd.rest import ApiException from pprint import pprint configuration = cfbd.Configuration( access_token = os.environ["BEARER_TOKEN"] ) with cfbd.ApiClient(configuration) as api_client: api_instance = cfbd.RatingsApi(api_client) year = 56 team = 'team_example' conference = 'conference_example' try: api_response = api_instance.get_srs(year=year, team=team, conference=conference) print("The response of RatingsApi->get_srs:\n") pprint(api_response) except Exception as e: print("Exception when calling RatingsApi->get_srs: %s\n" % e) ``` -------------------------------- ### Get Game Media Information Source: https://github.com/cfbd/cfbd-python/blob/main/docs/GamesApi.md Retrieve media details for games, filtering by year, season type, week, team, conference, media type, and classification. This example demonstrates Bearer token authentication. ```python import time import os import cfbd from cfbd.models.division_classification import DivisionClassification from cfbd.models.game_media import GameMedia from cfbd.models.media_type import MediaType from cfbd.models.season_type import SeasonType from cfbd.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to https://api.collegefootballdata.com # See configuration.py for a list of all supported configuration parameters. configuration = cfbd.Configuration( host = "https://api.collegefootballdata.com" ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. # Configure Bearer authorization: apiKey configuration = cfbd.Configuration( access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with cfbd.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = cfbd.GamesApi(api_client) year = 56 # int | Required year filter season_type = cfbd.SeasonType() # SeasonType | Optional season type filter (optional) week = 56 # int | Optional week filter (optional) team = 'team_example' # str | Optional team filter (optional) conference = 'conference_example' # str | Optional conference filter (optional) media_type = cfbd.MediaType() # MediaType | Optional media type filter (optional) classification = cfbd.DivisionClassification() # DivisionClassification | Optional division classification filter (optional) try: api_response = api_instance.get_media(year, season_type=season_type, week=week, team=team, conference=conference, media_type=media_type, classification=classification) print("The response of GamesApi->get_media:\n") pprint(api_response) except Exception as e: print("Exception when calling GamesApi->get_media: %s\n" % e) ``` -------------------------------- ### ReturningProduction Model Usage Source: https://github.com/cfbd/cfbd-python/blob/main/docs/ReturningProduction.md Demonstrates how to use the ReturningProduction model, including creating instances from JSON and dictionaries, and converting them back. ```APIDOC ## ReturningProduction Model ### Description Represents the returning production statistics for a team in a given season. ### Properties - **season** (int) - The season year. - **team** (str) - The team identifier. - **conference** (str) - The conference the team belongs to. - **total_ppa** (float) - Total plays resulting in points added. - **total_passing_ppa** (float) - Total passing plays resulting in points added. - **total_receiving_ppa** (float) - Total receiving plays resulting in points added. - **total_rushing_ppa** (float) - Total rushing plays resulting in points added. - **percent_ppa** (float) - Percentage of plays resulting in points added. - **percent_passing_ppa** (float) - Percentage of passing plays resulting in points added. - **percent_receiving_ppa** (float) - Percentage of receiving plays resulting in points added. - **percent_rushing_ppa** (float) - Percentage of rushing plays resulting in points added. - **usage** (float) - Overall usage rate. - **passing_usage** (float) - Passing usage rate. - **receiving_usage** (float) - Receiving usage rate. - **rushing_usage** (float) - Rushing usage rate. ### Example Usage (Python) ```python from cfbd.models.returning_production import ReturningProduction # TODO update the JSON string below json_string = "{}" # Create an instance of ReturningProduction from a JSON string returning_production_instance = ReturningProduction.from_json(json_string) # Print the JSON string representation of the object print(ReturningProduction.to_json()) # Convert the object into a dict returning_production_dict = returning_production_instance.to_dict() # Create an instance of ReturningProduction from a dict returning_production_from_dict = ReturningProduction.from_dict(returning_production_dict) ``` ``` -------------------------------- ### TeamFPI Model Usage (Python) Source: https://github.com/cfbd/cfbd-python/blob/main/docs/TeamFPI.md Demonstrates how to instantiate and use the TeamFPI model from JSON and dictionary representations. Ensure you have the correct JSON string for instantiation. ```python from cfbd.models.team_fpi import TeamFPI # TODO update the JSON string below json = "{}" # create an instance of TeamFPI from a JSON string team_fpi_instance = TeamFPI.from_json(json) # print the JSON string representation of the object print TeamFPI.to_json() # convert the object into a dict team_fpi_dict = team_fpi_instance.to_dict() # create an instance of TeamFPI from a dict team_fpi_from_dict = TeamFPI.from_dict(team_fpi_dict) ``` -------------------------------- ### Get Returning Production Players API Example Source: https://github.com/cfbd/cfbd-python/blob/main/docs/PlayersApi.md Retrieves a list of players who are returning to production for a given year, optionally filtered by team and conference. Ensure the API client is properly configured with authentication. ```python import cfbd from pprint import pprint configuration = cfbd.Configuration( host = "https://api.collegefootballdata.com" ) with cfbd.ApiClient(configuration) as api_client: api_instance = cfbd.PlayersApi(api_client) year = 56 team = 'team_example' conference = 'conference_example' try: api_response = api_instance.get_returning_production(year=year, team=team, conference=conference) print("The response of PlayersApi->get_returning_production:\n") pprint(api_response) except Exception as e: print("Exception when calling PlayersApi->get_returning_production: %s\n" % e) ``` -------------------------------- ### Instantiate PlayerPPAChartItem from JSON and Dict Source: https://github.com/cfbd/cfbd-python/blob/main/docs/PlayerPPAChartItem.md Demonstrates creating a PlayerPPAChartItem instance from a JSON string or a Python dictionary. It also shows how to convert the object back to a dictionary or JSON string. ```python from cfbd.models.player_ppa_chart_item import PlayerPPAChartItem # TODO update the JSON string below json = "{}" # create an instance of PlayerPPAChartItem from a JSON string player_ppa_chart_item_instance = PlayerPPAChartItem.from_json(json) # print the JSON string representation of the object print PlayerPPAChartItem.to_json() # convert the object into a dict player_ppa_chart_item_dict = player_ppa_chart_item_instance.to_dict() # create an instance of PlayerPPAChartItem from a dict player_ppa_chart_item_from_dict = PlayerPPAChartItem.from_dict(player_ppa_chart_item_dict) ``` -------------------------------- ### Get Aggregated Team Recruiting Ratings Source: https://github.com/cfbd/cfbd-python/blob/main/docs/RecruitingApi.md Retrieves aggregated recruiting statistics by team and position grouping. Requires Bearer authentication. Optional filters include team, conference, recruit type, start year, and end year. ```python import time import os import cfbd from cfbd.models.aggregated_team_recruiting import AggregatedTeamRecruiting from cfbd.models.recruit_classification import RecruitClassification from cfbd.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to https://api.collegefootballdata.com # See configuration.py for a list of all supported configuration parameters. configuration = cfbd.Configuration( host = "https://api.collegefootballdata.com" ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. # Configure Bearer authorization: apiKey configuration = cfbd.Configuration( access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with cfbd.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = cfbd.RecruitingApi(api_client) team = 'team_example' # str | Optional team filter (optional) conference = 'conference_example' # str | Optional conference filter (optional) recruit_type = cfbd.RecruitClassification() # RecruitClassification | Optional recruit type filter, defaults to HighSchool (optional) start_year = 56 # int | Optional start year range, defaults to 2000 (optional) end_year = 56 # int | Optional end year range, defaults to current year (optional) try: api_response = api_instance.get_aggregated_team_recruiting_ratings(team=team, conference=conference, recruit_type=recruit_type, start_year=start_year, end_year=end_year) print("The response of RecruitingApi->get_aggregated_team_recruiting_ratings:\n") pprint(api_response) except Exception as e: print("Exception when calling RecruitingApi->get_aggregated_team_recruiting_ratings: %s\n" % e) ``` -------------------------------- ### Instantiate ScoreboardGameHomeTeam from JSON and Dict Source: https://github.com/cfbd/cfbd-python/blob/main/docs/ScoreboardGameHomeTeam.md Demonstrates creating a ScoreboardGameHomeTeam object from a JSON string or a Python dictionary. Also shows how to convert the object back to a dictionary or JSON string. ```python from cfbd.models.scoreboard_game_home_team import ScoreboardGameHomeTeam # TODO update the JSON string below json = "{}" # create an instance of ScoreboardGameHomeTeam from a JSON string scoreboard_game_home_team_instance = ScoreboardGameHomeTeam.from_json(json) # print the JSON string representation of the object print ScoreboardGameHomeTeam.to_json() # convert the object into a dict scoreboard_game_home_team_dict = scoreboard_game_home_team_instance.to_dict() # create an instance of ScoreboardGameHomeTeam from a dict scoreboard_game_home_team_from_dict = ScoreboardGameHomeTeam.from_dict(scoreboard_game_home_team_dict) ``` -------------------------------- ### Get Teams Source: https://github.com/cfbd/cfbd-python/blob/main/docs/TeamsApi.md Retrieves a list of all teams. This endpoint can be filtered by conference and year to get historical conference affiliations. ```APIDOC ## GET /teams ### Description Retrieves team information. This endpoint can be filtered by conference and year. ### Method GET ### Endpoint /teams ### Parameters #### Query Parameters - **conference** (str) - Optional - Filter by conference abbreviation. - **year** (int) - Optional - Filter by year to get historical conference affiliations. ### Response #### Success Response (200) - **List[Team]** - A list of team objects. ### Response Example ```json [ { "id": 101, "name": "Alabama Crimson Tide", "logos": [ "https://a.espncdn.com/i/teamlogos/ncaa/500/101.png" ] } ] ``` ``` -------------------------------- ### Instantiate AdvancedGameStatDefense from JSON and Dict Source: https://github.com/cfbd/cfbd-python/blob/main/docs/AdvancedGameStatDefense.md Demonstrates how to create an instance of AdvancedGameStatDefense from a JSON string or a Python dictionary. Also shows how to convert the object back to JSON or a dictionary. ```python from cfbd.models.advanced_game_stat_defense import AdvancedGameStatDefense # TODO update the JSON string below json = "{}" # create an instance of AdvancedGameStatDefense from a JSON string advanced_game_stat_defense_instance = AdvancedGameStatDefense.from_json(json) # print the JSON string representation of the object print AdvancedGameStatDefense.to_json() # convert the object into a dict advanced_game_stat_defense_dict = advanced_game_stat_defense_instance.to_dict() # create an instance of AdvancedGameStatDefense from a dict advanced_game_stat_defense_from_dict = AdvancedGameStatDefense.from_dict(advanced_game_stat_defense_dict) ``` -------------------------------- ### Install cfbd Python Package Source: https://github.com/cfbd/cfbd-python/blob/main/README.md Use pip to install the cfbd Python package. You may need root permissions. ```sh pip install cfbd ``` -------------------------------- ### Get Teams Source: https://github.com/cfbd/cfbd-python/blob/main/docs/TeamsApi.md Retrieves a list of all college football teams. ```APIDOC ## GET /teams ### Description Retrieves a list of all college football teams. ### Method GET ### Endpoint /teams ### Parameters #### Query Parameters - **year** (int) - Optional - Year - **conference** (str) - Optional - Conference name ### Response #### Success Response (200) - **List[Team]** - A list of Team objects. ### Authorization apiKey ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ``` -------------------------------- ### UserInfo Model Usage Source: https://github.com/cfbd/cfbd-python/blob/main/docs/UserInfo.md Demonstrates how to create a UserInfo instance from a JSON string, convert it to a dictionary, and create it from a dictionary. Ensure the JSON string is valid. ```python from cfbd.models.user_info import UserInfo # TODO update the JSON string below json = "{}" # create an instance of UserInfo from a JSON string user_info_instance = UserInfo.from_json(json) # print the JSON string representation of the object print UserInfo.to_json() # convert the object into a dict user_info_dict = user_info_instance.to_dict() # create an instance of UserInfo from a dict user_info_from_dict = UserInfo.from_dict(user_info_dict) ``` -------------------------------- ### Get Talent Source: https://github.com/cfbd/cfbd-python/blob/main/docs/TeamsApi.md Retrieves college football talent data. ```APIDOC ## GET /talent ### Description Retrieves college football talent data. ### Method GET ### Endpoint /talent ### Parameters #### Query Parameters - **year** (int) - Optional - Year - **organization_id** (int) - Optional - Organization ID ### Response #### Success Response (200) - **List[Talent]** - A list of Talent objects. ### Authorization apiKey ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ``` -------------------------------- ### GameMedia Model Usage Source: https://github.com/cfbd/cfbd-python/blob/main/docs/GameMedia.md Demonstrates how to create a GameMedia instance from a JSON string, convert it to a dictionary, and create a new instance from a dictionary. Ensure the JSON string is valid. ```python from cfbd.models.game_media import GameMedia # TODO update the JSON string below json = "{}" # create an instance of GameMedia from a JSON string game_media_instance = GameMedia.from_json(json) # print the JSON string representation of the object print GameMedia.to_json() # convert the object into a dict game_media_dict = game_media_instance.to_dict() # create an instance of GameMedia from a dict game_media_from_dict = GameMedia.from_dict(game_media_dict) ``` -------------------------------- ### Instantiate DraftPickHometownInfo from JSON and Dictionary Source: https://github.com/cfbd/cfbd-python/blob/main/docs/DraftPickHometownInfo.md Demonstrates how to create a DraftPickHometownInfo object from a JSON string or a Python dictionary. Also shows how to convert the object back to a JSON string or dictionary. ```python from cfbd.models.draft_pick_hometown_info import DraftPickHometownInfo # TODO update the JSON string below json = "{}" # create an instance of DraftPickHometownInfo from a JSON string draft_pick_hometown_info_instance = DraftPickHometownInfo.from_json(json) # print the JSON string representation of the object print DraftPickHometownInfo.to_json() # convert the object into a dict draft_pick_hometown_info_dict = draft_pick_hometown_info_instance.to_dict() # create an instance of DraftPickHometownInfo from a dict draft_pick_hometown_info_from_dict = DraftPickHometownInfo.from_dict(draft_pick_hometown_info_dict) ``` -------------------------------- ### Get Roster Source: https://github.com/cfbd/cfbd-python/blob/main/docs/TeamsApi.md Retrieves the roster for a given team and year. ```APIDOC ## GET /roster ### Description Retrieves the roster for a given team and year. ### Method GET ### Endpoint /roster ### Parameters #### Query Parameters - **team** (str) - Required - Team name or ID - **year** (int) - Required - Year ### Response #### Success Response (200) - **List[Player]** - A list of Player objects. ### Authorization apiKey ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ``` -------------------------------- ### Get Categories Source: https://github.com/cfbd/cfbd-python/blob/main/docs/StatsApi.md Retrieves a list of all available statistical categories for teams. ```APIDOC ## GET /stats/categories ### Description Retrieves a list of all available statistical categories for teams. ### Method GET ### Endpoint /stats/categories ### Parameters This endpoint does not require any parameters. ### Response #### Success Response (200) - **List[str]** - A list of statistical category names. ### Request Example ```python import cfbd configuration = cfbd.Configuration( access_token = os.environ["BEARER_TOKEN"] ) with cfbd.ApiClient(configuration) as api_client: api_instance = cfbd.StatsApi(api_client) try: api_response = api_instance.get_categories() pprint(api_response) except Exception as e: print("Exception when calling StatsApi->get_categories: %s\n" % e) ``` ``` -------------------------------- ### Recruit Model JSON Serialization and Deserialization Source: https://github.com/cfbd/cfbd-python/blob/main/docs/Recruit.md Demonstrates how to create a Recruit instance from a JSON string and convert it to a dictionary. Also shows how to create a Recruit instance from a dictionary and print its JSON representation. ```python from cfbd.models.recruit import Recruit # TODO update the JSON string below json = "{}" # create an instance of Recruit from a JSON string recruit_instance = Recruit.from_json(json) # print the JSON string representation of the object print Recruit.to_json() # convert the object into a dict recruit_dict = recruit_instance.to_dict() # create an instance of Recruit from a dict recruit_from_dict = Recruit.from_dict(recruit_dict) ``` -------------------------------- ### Get Teams ATS Source: https://github.com/cfbd/cfbd-python/blob/main/docs/TeamsApi.md Retrieves Against The Spread (ATS) data for teams. ```APIDOC ## GET /teams/ats ### Description Retrieves Against The Spread (ATS) data for teams. ### Method GET ### Endpoint /teams/ats ### Parameters #### Query Parameters - **year** (int) - Optional - Year - **team** (str) - Optional - Team name - **opponent** (str) - Optional - Opponent name ### Response #### Success Response (200) - **List[TeamATS]** - A list of TeamATS objects. ### Authorization apiKey ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ``` -------------------------------- ### Instantiate GameTeamStatsTeam from JSON and Dict Source: https://github.com/cfbd/cfbd-python/blob/main/docs/GameTeamStatsTeam.md Demonstrates creating a GameTeamStatsTeam object from a JSON string or a dictionary. Also shows how to convert the object back to a dictionary or JSON string. ```python from cfbd.models.game_team_stats_team import GameTeamStatsTeam # TODO update the JSON string below json = "{}" # create an instance of GameTeamStatsTeam from a JSON string game_team_stats_team_instance = GameTeamStatsTeam.from_json(json) # print the JSON string representation of the object print GameTeamStatsTeam.to_json() # convert the object into a dict game_team_stats_team_dict = game_team_stats_team_instance.to_dict() # create an instance of GameTeamStatsTeam from a dict game_team_stats_team_from_dict = GameTeamStatsTeam.from_dict(game_team_stats_team_dict) ``` -------------------------------- ### Instantiate and Convert BettingGame Source: https://github.com/cfbd/cfbd-python/blob/main/docs/BettingGame.md Demonstrates how to create a BettingGame object from a JSON string or a dictionary, and how to convert it back to JSON or a dictionary. Ensure the JSON string is valid. ```python from cfbd.models.betting_game import BettingGame # TODO update the JSON string below json = "{}" # create an instance of BettingGame from a JSON string betting_game_instance = BettingGame.from_json(json) # print the JSON string representation of the object print BettingGame.to_json() # convert the object into a dict betting_game_dict = betting_game_instance.to_dict() # create an instance of BettingGame from a dict betting_game_from_dict = BettingGame.from_dict(betting_game_dict) ``` -------------------------------- ### Get Win Probability Source: https://github.com/cfbd/cfbd-python/blob/main/docs/MetricsApi.md Retrieves the win probability for a specific game. ```APIDOC ## GET /win_probability ### Description Retrieves the win probability for a specific game. ### Method GET ### Endpoint /win_probability ### Parameters #### Query Parameters - **game_id** (int) - Required - The ID of the game for which to retrieve win probability. ### Response #### Success Response (200) - **List[PlayWinProbability]** - A list of PlayWinProbability objects representing the win probability at different stages of the game. ### Response Example ```json [ { "play_id": 12345, "home_win_prob": 0.65, "away_win_prob": 0.35, "home_poss": 0.5, "away_poss": 0.5 } ] ``` ### Authorization apiKey ``` -------------------------------- ### Venue Model Usage Source: https://github.com/cfbd/cfbd-python/blob/main/docs/Venue.md Demonstrates how to create a Venue instance from a JSON string, convert it to a dictionary, and create a Venue instance from a dictionary. Requires the Venue model to be imported. ```python from cfbd.models.venue import Venue # TODO update the JSON string below json = "{}" # create an instance of Venue from a JSON string venue_instance = Venue.from_json(json) # print the JSON string representation of the object print Venue.to_json() # convert the object into a dict venue_dict = venue_instance.to_dict() # create an instance of Venue from a dict venue_from_dict = Venue.from_dict(venue_dict) ``` -------------------------------- ### Get Play Types Source: https://github.com/cfbd/cfbd-python/blob/main/docs/PlaysApi.md Retrieves a list of available play types. ```APIDOC ## GET /play/types ### Description Retrieves available play types. ### Method GET ### Endpoint /play/types ### Parameters This endpoint does not need any parameter. ### Response #### Success Response (200) - **List[PlayType]** - A list of play types. ### Response Example { "example": "[\n {\n \"id\": 1,\n \"name\": \"Passer Rating\"\n }\n]" } ### Authorization apiKey ``` -------------------------------- ### Get Play Types Source: https://github.com/cfbd/cfbd-python/blob/main/docs/PlaysApi.md Retrieves a list of available play types. ```APIDOC ## GET /plays/types ### Description Retrieves available play types. ### Method GET ### Endpoint /plays/types ### Parameters This endpoint does not require any parameters. ### Response #### Success Response (200) - **List[PlayType]** - A list of available play types. ### Request Example ```python import cfbd from cfbd.rest import ApiException from pprint import pprint configuration = cfbd.Configuration( access_token = "YOUR_API_KEY" ) with cfbd.ApiClient(configuration) as api_client: api_instance = cfbd.PlaysApi(api_client) try: api_response = api_instance.get_play_types() pprint(api_response) except ApiException as e: print("Exception when calling PlaysApi->get_play_types: %s\n" % e) ``` ``` -------------------------------- ### TeamRecruitingRanking Model Usage (Python) Source: https://github.com/cfbd/cfbd-python/blob/main/docs/TeamRecruitingRanking.md Demonstrates how to create a TeamRecruitingRanking instance from a JSON string, convert it to a dictionary, and create a new instance from that dictionary. Ensure the JSON string is valid. ```python from cfbd.models.team_recruiting_ranking import TeamRecruitingRanking # TODO update the JSON string below json = "{}" # create an instance of TeamRecruitingRanking from a JSON string team_recruiting_ranking_instance = TeamRecruitingRanking.from_json(json) # print the JSON string representation of the object print TeamRecruitingRanking.to_json() # convert the object into a dict team_recruiting_ranking_dict = team_recruiting_ranking_instance.to_dict() # create an instance of TeamRecruitingRanking from a dict team_recruiting_ranking_from_dict = TeamRecruitingRanking.from_dict(team_recruiting_ranking_dict) ``` -------------------------------- ### Instantiate TeamSPSpecialTeams from JSON and Dict Source: https://github.com/cfbd/cfbd-python/blob/main/docs/TeamSPSpecialTeams.md Demonstrates creating a TeamSPSpecialTeams object from a JSON string or a dictionary. Includes converting the object back to JSON and a dictionary. ```python from cfbd.models.team_sp_special_teams import TeamSPSpecialTeams # TODO update the JSON string below json = "{}" # create an instance of TeamSPSpecialTeams from a JSON string team_sp_special_teams_instance = TeamSPSpecialTeams.from_json(json) # print the JSON string representation of the object print TeamSPSpecialTeams.to_json() # convert the object into a dict team_sp_special_teams_dict = team_sp_special_teams_instance.to_dict() # create an instance of TeamSPSpecialTeams from a dict team_sp_special_teams_from_dict = TeamSPSpecialTeams.from_dict(team_sp_special_teams_dict) ``` -------------------------------- ### Get Matchup Source: https://github.com/cfbd/cfbd-python/blob/main/docs/TeamsApi.md Retrieves historical matchup details for two given teams. ```APIDOC ## GET /teams/matchup ### Description Retrieves historical matchup details for two given teams. ### Method GET ### Endpoint /teams/matchup ### Parameters #### Query Parameters - **team1** (str) - Required - First team to compare - **team2** (str) - Required - Second team to compare - **min_year** (int) - Optional - Optional starting year - **max_year** (int) - Optional - Optional ending year ### Response #### Success Response (200) - **Matchup** - A Matchup object containing historical data. ### Authorization apiKey ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ``` -------------------------------- ### Instantiate TeamGamePredictedPointsAddedOffense from JSON and Dict Source: https://github.com/cfbd/cfbd-python/blob/main/docs/TeamGamePredictedPointsAddedOffense.md Demonstrates how to create an instance of TeamGamePredictedPointsAddedOffense from a JSON string or a Python dictionary, and how to convert it back to JSON or a dictionary. Ensure the JSON string is valid and properly formatted. ```python from cfbd.models.team_game_predicted_points_added_offense import TeamGamePredictedPointsAddedOffense # TODO update the JSON string below json = "{}" # create an instance of TeamGamePredictedPointsAddedOffense from a JSON string team_game_predicted_points_added_offense_instance = TeamGamePredictedPointsAddedOffense.from_json(json) # print the JSON string representation of the object print TeamGamePredictedPointsAddedOffense.to_json() # convert the object into a dict team_game_predicted_points_added_offense_dict = team_game_predicted_points_added_offense_instance.to_dict() # create an instance of TeamGamePredictedPointsAddedOffense from a dict team_game_predicted_points_added_offense_from_dict = TeamGamePredictedPointsAddedOffense.from_dict(team_game_predicted_points_added_offense_dict) ``` -------------------------------- ### Get Play Stats Source: https://github.com/cfbd/cfbd-python/blob/main/docs/PlaysApi.md Retrieve player-play associations with advanced filtering options. ```APIDOC ## GET /plays/stats ### Description Retrieve player-play associations (limit 2000) with advanced filtering options. ### Method GET ### Endpoint /plays/stats ### Parameters #### Query Parameters - **year** (int) - Optional - Season year - **week** (int) - Optional - Week number - **team** (string) - Optional - Team abbreviation - **gameId** (int) - Optional - Game Id filter - **athleteId** (int) - Optional - Athlete Id filter - **statTypeId** (int) - Optional - Play stat type Id filter - **seasonType** (string) - Optional - Type of season (e.g. regular, postseason) - **conference** (string) - Optional - Conference abbreviation ### Response #### Success Response (200) - **List[PlayStat]** - A list of play statistics. ### Request Example ```python import cfbd from cfbd.rest import ApiException from pprint import pprint configuration = cfbd.Configuration( access_token = "YOUR_API_KEY" ) with cfbd.ApiClient(configuration) as api_client: api_instance = cfbd.PlaysApi(api_client) try: api_response = api_instance.get_play_stats(year=2023, week=10, team="OSU", stat_type_id=5) pprint(api_response) except ApiException as e: print("Exception when calling PlaysApi->get_play_stats: %s\n" % e) ``` ``` -------------------------------- ### MatchupGame Model Usage - Python Source: https://github.com/cfbd/cfbd-python/blob/main/docs/MatchupGame.md Demonstrates how to create a MatchupGame instance from a JSON string and a dictionary, and how to convert it back to JSON or a dictionary. Ensure the JSON string is valid. ```python from cfbd.models.matchup_game import MatchupGame # TODO update the JSON string below json = "{}" # create an instance of MatchupGame from a JSON string matchup_game_instance = MatchupGame.from_json(json) # print the JSON string representation of the object print MatchupGame.to_json() # convert the object into a dict matchup_game_dict = matchup_game_instance.to_dict() # create an instance of MatchupGame from a dict matchup_game_from_dict = MatchupGame.from_dict(matchup_game_dict) ``` -------------------------------- ### Get Transfer Portal Source: https://github.com/cfbd/cfbd-python/blob/main/docs/PlayersApi.md Retrieves transfer portal data for a given year. ```APIDOC ## GET /players/transfer_portal ### Description Retrieves transfer portal data for a given year. ### Method GET ### Endpoint /players/transfer_portal ### Parameters #### Query Parameters - **year** (int) - Required - Year filter ### Response #### Success Response (200) - **List[PlayerTransfer]** - A list of player transfer data. ### Request Example ```python import cfbd configuration = cfbd.Configuration() with cfbd.ApiClient(configuration) as api_client: api_instance = cfbd.PlayersApi(api_client) year = 2021 try: api_response = api_instance.get_transfer_portal(year=year) print(api_response) except Exception as e: print("Exception when calling PlayersApi->get_transfer_portal: %s" % e) ``` ### Response Example ```json [ { "player": "John Doe", "school": "Old School", "transfer_school": "New School", "year": 2021, "position": "QB" } ] ``` ``` -------------------------------- ### AggregatedTeamRecruiting Model Usage Source: https://github.com/cfbd/cfbd-python/blob/main/docs/AggregatedTeamRecruiting.md Demonstrates how to instantiate AggregatedTeamRecruiting from JSON and dictionaries, and convert back. Ensure the JSON string is valid before parsing. ```python from cfbd.models.aggregated_team_recruiting import AggregatedTeamRecruiting # TODO update the JSON string below json = "{}" # create an instance of AggregatedTeamRecruiting from a JSON string aggregated_team_recruiting_instance = AggregatedTeamRecruiting.from_json(json) # print the JSON string representation of the object print AggregatedTeamRecruiting.to_json() # convert the object into a dict aggregated_team_recruiting_dict = aggregated_team_recruiting_instance.to_dict() # create an instance of AggregatedTeamRecruiting from a dict aggregated_team_recruiting_from_dict = AggregatedTeamRecruiting.from_dict(aggregated_team_recruiting_dict) ``` -------------------------------- ### Import cfbd Package Source: https://github.com/cfbd/cfbd-python/blob/main/README.md Import the cfbd package into your Python script after installation. ```python import cfbd ``` -------------------------------- ### ReturningProduction Model Usage Source: https://github.com/cfbd/cfbd-python/blob/main/docs/ReturningProduction.md Demonstrates how to create an instance of ReturningProduction from a JSON string, convert it to a dictionary, and create a new instance from that dictionary. Requires the ReturningProduction model to be imported. ```python from cfbd.models.returning_production import ReturningProduction # TODO update the JSON string below json = "{}" # create an instance of ReturningProduction from a JSON string returning_production_instance = ReturningProduction.from_json(json) # print the JSON string representation of the object print ReturningProduction.to_json() # convert the object into a dict returning_production_dict = returning_production_instance.to_dict() # create an instance of ReturningProduction from a dict returning_production_from_dict = ReturningProduction.from_dict(returning_production_dict) ``` -------------------------------- ### Get Scoreboard Source: https://github.com/cfbd/cfbd-python/blob/main/docs/GamesApi.md Retrieves live scoreboard data, with options to filter by classification and conference. ```APIDOC ## GET /scoreboard ### Description Retrieves live scoreboard data. ### Method GET ### Endpoint /scoreboard ### Parameters #### Query Parameters - **classification** (DivisionClassification) - Optional - Optional division classification filter - **conference** (str) - Optional - Optional conference filter ### Response #### Success Response (200) - **List[ScoreboardGame]** - A list of scoreboard games. ``` -------------------------------- ### Instantiate GamePlayerStatPlayer from JSON and Dict Source: https://github.com/cfbd/cfbd-python/blob/main/docs/GamePlayerStatPlayer.md Demonstrates creating a GamePlayerStatPlayer object from a JSON string or a dictionary, and converting it back to JSON or a dictionary. Ensure the JSON string is valid. ```python from cfbd.models.game_player_stat_player import GamePlayerStatPlayer # TODO update the JSON string below json = "{}" # create an instance of GamePlayerStatPlayer from a JSON string game_player_stat_player_instance = GamePlayerStatPlayer.from_json(json) # print the JSON string representation of the object print GamePlayerStatPlayer.to_json() # convert the object into a dict game_player_stat_player_dict = game_player_stat_player_instance.to_dict() # create an instance of GamePlayerStatPlayer from a dict game_player_stat_player_from_dict = GamePlayerStatPlayer.from_dict(game_player_stat_player_dict) ``` -------------------------------- ### Get Plays Source: https://github.com/cfbd/cfbd-python/blob/main/docs/PlaysApi.md Retrieve play-by-play data for a specified season and week, with advanced filtering. ```APIDOC ## GET /plays ### Description Retrieve play-by-play data for a specified season and week, with advanced filtering. ### Method GET ### Endpoint /plays ### Parameters #### Query Parameters - **year** (int) - Required - Season year - **week** (int) - Optional - Week number - **seasonType** (string) - Optional - Type of season (e.g. regular, postseason) - **team** (string) - Optional - Team abbreviation - **conference** (string) - Optional - Conference abbreviation - **offense** (string) - Optional - Offensive Team abbreviation - **defense** (string) - Optional - Defensive Team abbreviation - **gameId** (int) - Optional - Game Id filter ### Response #### Success Response (200) - **List[Play]** - A list of plays. ### Request Example ```python import cfbd from cfbd.rest import ApiException from pprint import pprint configuration = cfbd.Configuration( access_token = "YOUR_API_KEY" ) with cfbd.ApiClient(configuration) as api_client: api_instance = cfbd.PlaysApi(api_client) try: api_response = api_instance.get_plays(year=2023, week=10, team="OSU") pprint(api_response) except ApiException as e: print("Exception when calling PlaysApi->get_plays: %s\n" % e) ``` ``` -------------------------------- ### Drive Model Serialization and Deserialization Source: https://github.com/cfbd/cfbd-python/blob/main/docs/Drive.md Demonstrates how to create a Drive instance from a JSON string and convert it to a dictionary. Ensure the JSON string is valid and properly formatted. ```python from cfbd.models.drive import Drive # TODO update the JSON string below json = "{}" # create an instance of Drive from a JSON string drive_instance = Drive.from_json(json) # print the JSON string representation of the object print Drive.to_json() # convert the object into a dict drive_dict = drive_instance.to_dict() # create an instance of Drive from a dict drive_from_dict = Drive.from_dict(drive_dict) ``` -------------------------------- ### Get Play Stat Types Source: https://github.com/cfbd/cfbd-python/blob/main/docs/PlaysApi.md Retrieves a list of available play stat types. ```APIDOC ## GET /plays/stats/types ### Description Retrieves available play stat types. ### Method GET ### Endpoint /plays/stats/types ### Parameters This endpoint does not require any parameters. ### Response #### Success Response (200) - **List[PlayStatType]** - A list of available play stat types. ### Request Example ```python import cfbd from cfbd.rest import ApiException from pprint import pprint configuration = cfbd.Configuration( access_token = "YOUR_API_KEY" ) with cfbd.ApiClient(configuration) as api_client: api_instance = cfbd.PlaysApi(api_client) try: api_response = api_instance.get_play_stat_types() pprint(api_response) except ApiException as e: print("Exception when calling PlaysApi->get_play_stat_types: %s\n" % e) ``` ``` -------------------------------- ### Instantiate PregameWinProbability from JSON and Dict Source: https://github.com/cfbd/cfbd-python/blob/main/docs/PregameWinProbability.md Demonstrates how to create a PregameWinProbability object from a JSON string or a Python dictionary. Also shows how to convert the object back to a dictionary or JSON string. ```python from cfbd.models.pregame_win_probability import PregameWinProbability # TODO update the JSON string below json = "{}" # create an instance of PregameWinProbability from a JSON string pregame_win_probability_instance = PregameWinProbability.from_json(json) # print the JSON string representation of the object print PregameWinProbability.to_json() # convert the object into a dict pregame_win_probability_dict = pregame_win_probability_instance.to_dict() # create an instance of PregameWinProbability from a dict pregame_win_probability_from_dict = PregameWinProbability.from_dict(pregame_win_probability_dict) ``` -------------------------------- ### Get Live Plays Source: https://github.com/cfbd/cfbd-python/blob/main/docs/PlaysApi.md Queries live play-by-play data and advanced stats for a specific game. ```APIDOC ## GET /live/plays ### Description Queries live play-by-play data and advanced stats for a specific game. ### Method GET ### Endpoint /live/plays ### Parameters #### Query Parameters - **gameId** (int) - Required - Game Id filter ### Response #### Success Response (200) - **LiveGame** - Details of the live game plays. ### Request Example ```python import cfbd from cfbd.rest import ApiException from pprint import pprint configuration = cfbd.Configuration( access_token = "YOUR_API_KEY" ) with cfbd.ApiClient(configuration) as api_client: api_instance = cfbd.PlaysApi(api_client) game_id = 12345 try: api_response = api_instance.get_live_plays(game_id=game_id) pprint(api_response) except ApiException as e: print("Exception when calling PlaysApi->get_live_plays: %s\n" % e) ``` ``` -------------------------------- ### Instantiate GamePlayerStatCategories from JSON and Dict Source: https://github.com/cfbd/cfbd-python/blob/main/docs/GamePlayerStatCategories.md Demonstrates how to create a GamePlayerStatCategories object from a JSON string or a Python dictionary. Also shows how to convert the object back to a dictionary or JSON string. ```python from cfbd.models.game_player_stat_categories import GamePlayerStatCategories # TODO update the JSON string below json = "{}" # create an instance of GamePlayerStatCategories from a JSON string game_player_stat_categories_instance = GamePlayerStatCategories.from_json(json) # print the JSON string representation of the object print GamePlayerStatCategories.to_json() # convert the object into a dict game_player_stat_categories_dict = game_player_stat_categories_instance.to_dict() # create an instance of GamePlayerStatCategories from a dict game_player_stat_categories_from_dict = GamePlayerStatCategories.from_dict(game_player_stat_categories_dict) ``` -------------------------------- ### Get Team Records Source: https://github.com/cfbd/cfbd-python/blob/main/docs/GamesApi.md Retrieves historical team records, with options to filter by year, team, and conference. ```APIDOC ## GET /records ### Description Retrieves historical team records. ### Method GET ### Endpoint /records ### Parameters #### Query Parameters - **year** (int) - Optional - Year filter, required if team not specified - **team** (str) - Optional - Team filter, required if year not specified - **conference** (str) - Optional - Optional conference filter ### Response #### Success Response (200) - **List[TeamRecords]** - A list of team records. ```