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

TypeScript quickstart

The official cbbd package provides generated TypeScript operations, types, and a fetch client for working with the API.

Install the package

TerminalCode
pnpm add cbbd

Set your key in the server-side Node environment:

TerminalCode
export CBBD_API_KEY='your-api-key'

Keep this example in a server-side Node process. Do not put an API key in frontend JavaScript, where users can inspect client-side code and network requests.

Retrieve games

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

Code
import { client, getGames } from 'cbbd'; const apiKey = process.env.CBBD_API_KEY; if (!apiKey) { throw new Error('CBBD_API_KEY is required'); } client.setConfig({ headers: { Authorization: `Bearer ${apiKey}`, }, }); const response = await getGames({ query: { season: 2024, team: 'Duke', }, }); if (response.error) { throw response.error; } console.log(response.data?.[0]);

When the request succeeds, response.data contains generated game types. Handle response.error according to your application's logging and retry policy.

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

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