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

TypeScript quickstart

Use the official TypeScript client

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

Install the package

TerminalCode
pnpm add cfbd

Set your key in the server-side Node environment:

TerminalCode
export CFBD_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 Michigan games as GET /games?year=2023&team=Michigan:

Code
import { client, getGames } from 'cfbd'; const apiKey = process.env.CFBD_API_KEY; if (!apiKey) { throw new Error('CFBD_API_KEY is required'); } client.setConfig({ headers: { Authorization: `Bearer ${apiKey}`, }, }); const response = await getGames({ query: { year: 2023, team: 'Michigan', }, }); 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 8, 2026
Python quickstart
On this page
  • Install the package
  • Retrieve games
TypeScript