College Basketball DataCollege Basketball Data
  • CollegeBasketballData.com
  • Get API Key
  • Legacy Swagger UI
  • Getting Started
  • Official libraries
  • API Reference
Helpful links
  • CBBD
  • Get API key
  • Access tiers
Official libraries
  • Python
  • TypeScript
  • R
  • API source
Other resources
  • Rad Sports Analytics
  • Football
  • CBB Starter Pack

A Rad Sports Analytics platform.

xdiscordgithub
Python quickstartTypeScript quickstartR quickstart
powered by Zudoku
Official libraries

Python quickstart

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

Install the package

TerminalCode
python -m pip install cbbd

Set your key outside source code:

TerminalCode
export CBBD_API_KEY='your-api-key'

Retrieve games

This example retrieves the same Duke games as GET /games?season=2024&team=Duke:

Code
import os import cbbd from cbbd.rest import ApiException configuration = cbbd.Configuration( access_token=os.environ['CBBD_API_KEY'], ) try: with cbbd.ApiClient(configuration) as api_client: games_api = cbbd.GamesApi(api_client) games = games_api.get_games(season=2024, team='Duke') if games: print(games[0]) except ApiException as error: print(f'College Basketball 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 25, 2026
TypeScript quickstart
On this page
  • Install the package
  • Retrieve games