College Football DataCollege Football Data
  • CollegeFootballData.com
  • Get API Key
  • Legacy Swagger UI
  • Getting Started
  • Official libraries
  • Methodology and resources
  • API Reference
Helpful Links
  • CFBD
  • Patreon
  • Gumroad
Data + Code Packs
  • Starter Pack
  • Model Training Pack
  • AI Launchpad
  • AI Builder Pack
Other Resources
  • Rad Sports Analytics
  • Blog
  • Basketball

A Rad Sports Analytics platform.

xdiscordgithub
Python quickstartTypeScript quickstart
powered by Zudoku
Official libraries

Python quickstart

Use the official Python client

The official cfbd package provides generated Python clients and models for working with the API.

Install the package

TerminalCode
python -m pip install cfbd

Set your key outside source code:

TerminalCode
export CFBD_API_KEY='your-api-key'

Retrieve games

This example retrieves the same Michigan games as GET /games?year=2023&team=Michigan:

Code
import os import cfbd from cfbd.rest import ApiException configuration = cfbd.Configuration( access_token=os.environ['CFBD_API_KEY'], ) try: with cfbd.ApiClient(configuration) as api_client: games_api = cfbd.GamesApi(api_client) games = games_api.get_games(year=2023, team='Michigan') if games: print(games[0]) except ApiException as error: print(f'College Football Data API request failed: {error}')

The client returns a list of generated game model objects. Handle ApiException according to your application's logging and retry policy.

See the official source repository and the package on PyPI for the complete generated client reference and current package information.

Edit this page on GitHub
Last modified on August 8, 2026
TypeScript quickstart
On this page
  • Install the package
  • Retrieve games