cbb-data

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

College Basketball Data (CBB)

大学篮球数据(CBB)

Setup

安装配置

Before first use, check if the CLI is available:
bash
which sports-skills || pip install sports-skills
If
pip install
fails with a Python version error, the package requires Python 3.10+. Find a compatible Python:
bash
python3 --version  # check version
首次使用前,检查CLI是否可用:
bash
which sports-skills || pip install sports-skills
如果
pip install
因Python版本错误失败,该包需要Python 3.10+。请找到兼容的Python版本:
bash
python3 --version  # check version

If < 3.10, try: python3.12 -m pip install sports-skills

If < 3.10, try: python3.12 -m pip install sports-skills

On macOS with Homebrew: /opt/homebrew/bin/python3.12 -m pip install sports-skills

On macOS with Homebrew: /opt/homebrew/bin/python3.12 -m pip install sports-skills

No API keys required.
无需API密钥。

Quick Start

快速开始

Prefer the CLI — it avoids Python import path issues:
bash
sports-skills cbb get_scoreboard
sports-skills cbb get_rankings
sports-skills cbb get_standings --group=23
推荐使用CLI——可避免Python导入路径问题:
bash
sports-skills cbb get_scoreboard
sports-skills cbb get_rankings
sports-skills cbb get_standings --group=23

Important: College vs. Pro Differences

重要提示:大学篮球与职业篮球的差异

College basketball has 360+ D1 teams (vs 30 NBA teams), organized by conferences:
  • Standings are per-conference — use the
    group
    parameter to filter
  • Rankings replace leaders — college uses AP Top 25 and Coaches Poll instead of league-wide stat leaders
  • Ranked teams have a
    rank
    field (null = unranked) on scoreboard competitors
  • Many games per day — during the season, 50+ games can be scheduled daily
  • March Madness — the NCAA Tournament runs in March/April with 68 teams
大学篮球拥有360多支一级联盟球队(而NBA只有30支),按联盟划分:
  • 排名按联盟统计——使用
    group
    参数进行筛选
  • 排行榜更新机制不同——大学篮球使用美联社TOP25和教练投票榜,而非联盟范围内的数据领跑者
  • 排名球队在比分板上的参赛队伍字段中会有
    rank
    值(null表示未排名)
  • 每日赛事众多——赛季期间,每天可能安排50多场比赛
  • 疯狂三月——NCAA锦标赛于3月/4月举行,共有68支球队参赛

Conference IDs (group parameter)

联盟ID(group参数)

Use the
--group
parameter for standings and scoreboard filtering:
ConferenceGroup IDConferenceGroup ID
ACC2Big 128
SEC23Big Ten7
Big East4Pac-1221
American62Mountain West44
Atlantic 103West Coast26
Missouri Valley18Colonial10
Tip: Conference IDs are different from CFB. Use
get_standings
without a group to see all conferences.
使用
--group
参数筛选排名和比分板数据:
联盟组ID联盟组ID
ACC2Big 128
SEC23Big Ten7
Big East4Pac-1221
American62Mountain West44
Atlantic 103West Coast26
Missouri Valley18Colonial10
提示: 联盟ID与大学橄榄球(CFB)不同。无需指定group参数调用
get_standings
即可查看所有联盟。

Commands

命令列表

get_scoreboard

获取比分板

Get live/recent college basketball scores.
  • date
    (str, optional): Date in YYYY-MM-DD format. Defaults to today.
  • group
    (int, optional): Conference group ID to filter.
  • limit
    (int, optional): Max events to return.
获取实时/近期大学篮球比分。
  • date
    (字符串,可选):日期格式为YYYY-MM-DD,默认值为今日。
  • group
    (整数,可选):联盟组ID,用于筛选。
  • limit
    (整数,可选):返回的最大赛事数量。

get_standings

获取排名

Get college basketball standings by conference.
  • season
    (int, optional): Season year. Defaults to current.
  • group
    (int, optional): Conference ID to filter (see table above).
按联盟获取大学篮球排名。
  • season
    (整数,可选):赛季年份,默认值为当前赛季。
  • group
    (整数,可选):联盟ID,用于筛选(见上表)。

get_teams

获取所有球队

Get all D1 men's college basketball teams (360+ teams). No parameters required.
获取所有一级联盟男子大学篮球队(360多支)。 无参数要求。

get_team_roster

获取球队阵容

Get full roster for a college basketball team.
  • team_id
    (str, required): ESPN team ID.
获取某支大学篮球队的完整阵容。
  • team_id
    (字符串,必填):ESPN球队ID。

get_team_schedule

获取球队赛程

Get schedule for a specific college basketball team.
  • team_id
    (str, required): ESPN team ID.
  • season
    (int, optional): Season year. Defaults to current.
获取某支大学篮球队的赛程。
  • team_id
    (字符串,必填):ESPN球队ID。
  • season
    (整数,可选):赛季年份,默认值为当前赛季。

get_game_summary

获取赛事总结

Get detailed game summary with box score and player stats.
  • event_id
    (str, required): ESPN event ID.
获取包含技术统计和球员数据的详细赛事总结。
  • event_id
    (字符串,必填):ESPN赛事ID。

get_rankings

获取排行榜

Get college basketball rankings — AP Top 25, Coaches Poll.
  • season
    (int, optional): Season year. Defaults to current.
  • week
    (int, optional): Week number for historical rankings.
Returns
polls[]
with poll name and
teams[]
containing rank, previous rank, record, points, and first-place votes.
获取大学篮球排行榜——美联社TOP25、教练投票榜。
  • season
    (整数,可选):赛季年份,默认值为当前赛季。
  • week
    (整数,可选):历史排行榜的周数。
返回包含投票名称的
polls[]
数组,以及包含排名、上期排名、战绩、积分和第一名得票的
teams[]
数组。

get_news

获取新闻

Get college basketball news articles.
  • team_id
    (str, optional): ESPN team ID to filter news by team.
获取大学篮球相关新闻文章。
  • team_id
    (字符串,可选):ESPN球队ID,用于按球队筛选新闻。

get_play_by_play

获取逐场战况

Get full play-by-play data for a game.
  • event_id
    (str, required): ESPN event ID
Returns play-by-play detail including period, clock, team, play description, and scoring plays.
获取某场比赛的完整逐场战况数据。
  • event_id
    (字符串,必填):ESPN赛事ID
返回包含时段、时钟、球队、战况描述和得分情况的逐场战况详情。

get_win_probability

获取获胜概率

Get win probability chart data for a game.
  • event_id
    (str, required): ESPN event ID
Returns timestamped home/away win probability percentages throughout the game.
获取某场比赛的获胜概率图表数据。
  • event_id
    (字符串,必填):ESPN赛事ID
返回比赛全程中带时间戳的主队/客队获胜概率百分比数据。

get_schedule

获取赛程

Get college basketball schedule.
  • date
    (str, optional): Date in YYYY-MM-DD format.
  • season
    (int, optional): Season year. Defaults to current.
  • group
    (int, optional): Conference group ID to filter.
获取大学篮球赛程。
  • date
    (字符串,可选):日期格式为YYYY-MM-DD。
  • season
    (整数,可选):赛季年份,默认值为当前赛季。
  • group
    (整数,可选):联盟组ID,用于筛选。

get_futures

获取期货赔率

Get college basketball futures/odds markets (National Championship, Player of the Year, etc.).
  • limit
    (int, optional): Max entries per market. Defaults to 25.
  • season_year
    (int, optional): Season year. Defaults to current.
Returns
futures[]
with market name and entries (team/player name + odds value).
获取大学篮球期货/赔率市场数据(全国冠军、年度最佳球员等)。
  • limit
    (整数,可选):每个市场返回的最大条目数,默认值为25。
  • season_year
    (整数,可选):赛季年份,默认值为当前赛季。
返回包含市场名称的
futures[]
数组,以及包含球队/球员名称+赔率值的条目。

get_team_stats

获取球队统计数据

Get full team statistical profile for a season.
  • team_id
    (str, required): ESPN team ID
  • season_year
    (int, optional): Season year. Defaults to current.
  • season_type
    (int, optional): 2=regular (default), 3=postseason.
Returns
categories[]
with detailed stats including value, rank, and per-game averages.
获取某支球队一个赛季的完整统计数据。
  • team_id
    (字符串,必填):ESPN球队ID
  • season_year
    (整数,可选):赛季年份,默认值为当前赛季。
  • season_type
    (整数,可选):2=常规赛(默认),3=季后赛。
返回包含详细统计数据的
categories[]
数组,包括数值、排名和场均数据。

get_player_stats

获取球员统计数据

Get full player statistical profile for a season.
  • player_id
    (str, required): ESPN athlete ID
  • season_year
    (int, optional): Season year. Defaults to current.
  • season_type
    (int, optional): 2=regular (default), 3=postseason.
Returns
categories[]
with detailed stats including value, rank, and per-game averages.
获取某名球员一个赛季的完整统计数据。
  • player_id
    (字符串,必填):ESPN运动员ID
  • season_year
    (整数,可选):赛季年份,默认值为当前赛季。
  • season_type
    (整数,可选):2=常规赛(默认),3=季后赛。
返回包含详细统计数据的
categories[]
数组,包括数值、排名和场均数据。

Common Team IDs

常用球队ID

TeamIDTeamID
Duke150Kansas2305
Kentucky96North Carolina153
UConn41Gonzaga2250
Villanova222UCLA26
Michigan State127Arizona12
Purdue2509Houston248
Tennessee2633Auburn2
Baylor239Creighton156
Tip: Use
get_teams
to get all team IDs, or look up ESPN URLs (e.g., espn.com/mens-college-basketball/team/_/id/150/duke → ID is 150).
球队ID球队ID
Duke150Kansas2305
Kentucky96North Carolina153
UConn41Gonzaga2250
Villanova222UCLA26
Michigan State127Arizona12
Purdue2509Houston248
Tennessee2633Auburn2
Baylor239Creighton156
提示: 使用
get_teams
获取所有球队ID,或查看ESPN网址(例如:espn.com/mens-college-basketball/team/_/id/150/duke → ID为150)。

Examples

使用示例

User: "What are the college basketball rankings?"
bash
sports-skills cbb get_rankings
User: "Show me SEC basketball standings"
bash
sports-skills cbb get_standings --group=23
User: "What are today's college basketball scores?"
bash
sports-skills cbb get_scoreboard
User: "Show me Duke's roster"
bash
sports-skills cbb get_team_roster --team_id=150
User: "Get the box score for game 401638574"
bash
sports-skills cbb get_game_summary --event_id=401638574
User: "What's Kansas's schedule this season?"
bash
sports-skills cbb get_team_schedule --team_id=2305
User: "Who's favored to win March Madness?"
bash
sports-skills cbb get_futures --limit=10
User: "Show me Duke's team stats"
bash
sports-skills cbb get_team_stats --team_id=150
用户:"大学篮球排行榜是怎样的?"
bash
sports-skills cbb get_rankings
用户:"展示SEC联盟的篮球排名"
bash
sports-skills cbb get_standings --group=23
用户:"今天的大学篮球比分是多少?"
bash
sports-skills cbb get_scoreboard
用户:"展示Duke的阵容"
bash
sports-skills cbb get_team_roster --team_id=150
用户:"获取赛事401638574的技术统计"
bash
sports-skills cbb get_game_summary --event_id=401638574
用户:"Kansas本赛季的赛程是怎样的?"
bash
sports-skills cbb get_team_schedule --team_id=2305
用户:"谁最有可能赢得疯狂三月?"
bash
sports-skills cbb get_futures --limit=10
用户:"展示Duke的球队统计数据"
bash
sports-skills cbb get_team_stats --team_id=150

Error Handling

错误处理

When a command fails, do not surface raw errors to the user. Instead:
  1. If no events found, check if it's the off-season (CBB runs November–April)
  2. If standings are empty without a group filter, try a specific conference
  3. During March Madness, the scoreboard will have tournament games
  4. Only report failure with a clean message after exhausting alternatives
当命令执行失败时,不要向用户显示原始错误信息。请按以下步骤处理:
  1. 如果未找到赛事,请检查是否处于休赛期(大学篮球赛季为11月至次年4月)
  2. 如果未指定组参数时排名为空,请尝试筛选特定联盟
  3. 疯狂三月期间,比分板将显示锦标赛赛事
  4. 在尝试所有替代方案后,仅用简洁的消息告知用户执行失败

Season Structure

赛季结构

  • Non-Conference Season: November – December
  • Conference Play: January – early March
  • Conference Tournaments: Early–mid March
  • NCAA Tournament (March Madness): Mid-March – early April
    • First Four, First/Second Round, Sweet 16, Elite 8, Final Four, Championship
  • 非联盟赛季:11月 – 12月
  • 联盟常规赛:1月 – 3月初
  • 联盟锦标赛:3月上旬至中旬
  • NCAA锦标赛(疯狂三月):3月中旬 – 4月初
    • 首轮资格赛、第一/第二轮、甜蜜16强、精英8强、最终4强、总决赛

Troubleshooting

故障排除

  • sports-skills
    command not found
    : Run
    pip install sports-skills
  • No games found: CBB is seasonal (Nov–Apr). Off-season scoreboard will be empty.
  • Too many games: During the season, 50+ games per day. Use
    --group
    to filter by conference or
    --limit
    to cap results.
  • Rankings empty in off-season: Rankings are published weekly during the season (November–March).
  • Roster format differs from NBA: College rosters may be a flat list instead of positional groups.
  • sports-skills
    命令未找到
    :运行
    pip install sports-skills
  • 未找到赛事:大学篮球是季节性赛事(11月–4月)。休赛期比分板将为空。
  • 赛事过多:赛季期间,每天可能有50多场比赛。使用
    --group
    按联盟筛选,或使用
    --limit
    限制结果数量。
  • 休赛期排行榜为空:排行榜在赛季期间每周发布(11月–3月)。
  • 阵容格式与NBA不同:大学篮球阵容可能是扁平列表,而非按位置分组。