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

R quickstart

The official cbbdr package provides R functions for querying the API and working with the returned college basketball data.

Install the package

Install the development version from GitHub:

Code
install.packages("devtools") devtools::install_github("cfbd/cbbd-r")

Store your API key

Load the package and run set_api_key():

Code
library(cbbdr) set_api_key()

Enter your API key when prompted. The package uses R's keyring package to store the credential securely across sessions instead of placing it in your source code.

Retrieve games

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

Code
games <- cbbdr::get_games( team = "Duke", season = 2024 ) utils::head(games, 1)

The package returns API data in analysis-friendly rectangular structures. Pass the same filters documented in the API reference to the corresponding cbbdr function.

See the official source repository for the complete function reference, installation details, and current package information.

Edit this page on GitHub
Last modified on August 25, 2026
TypeScript quickstart
On this page
  • Install the package
  • Store your API key
  • Retrieve games