nfl-data
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseNFL Data
NFL 数据工具
Setup
安装配置
Before first use, check if the CLI is available:
bash
which sports-skills || pip install sports-skillsIf fails (package not found or Python version error), install from GitHub:
pip installbash
pip install git+https://github.com/machina-sports/sports-skills.gitThe package requires Python 3.10+. If your default Python is older, use a specific version:
bash
python3 --version # check version首次使用前,检查CLI是否可用:
bash
which sports-skills || pip install sports-skills如果失败(包未找到或Python版本错误),请从GitHub安装:
pip installbash
pip install git+https://github.com/machina-sports/sports-skills.git该包要求Python 3.10及以上版本。如果你的默认Python版本较低,请使用指定版本:
bash
python3 --version # 检查版本If < 3.10, try: python3.12 -m pip install sports-skills
如果版本 < 3.10,尝试:python3.12 -m pip install sports-skills
On macOS with Homebrew: /opt/homebrew/bin/python3.12 -m pip install sports-skills
在使用Homebrew的macOS系统上:/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 nfl get_scoreboard
sports-skills nfl get_standings --season=2025
sports-skills nfl get_teamsPython SDK (alternative):
python
from sports_skills import nfl
scores = nfl.get_scoreboard({})
standings = nfl.get_standings({"params": {"season": "2025"}})推荐使用CLI——可避免Python导入路径问题:
bash
sports-skills nfl get_scoreboard
sports-skills nfl get_standings --season=2025
sports-skills nfl get_teamsPython SDK(替代方案):
python
from sports_skills import nfl
scores = nfl.get_scoreboard({})
standings = nfl.get_standings({"params": {"season": "2025"}})Choosing the Season
赛季选择规则
Derive the current year from the system prompt's date (e.g., → current year is 2026).
currentDate: 2026-02-16- If the user specifies a season, use it as-is.
- If the user says "current", "this season", or doesn't specify: The NFL season runs September–February. If the current month is March–August, use (upcoming season). If September–February, the active season started in the previous calendar year if you're in Jan/Feb, otherwise current year.
season = current_year - Never hardcode a season. Always derive it from the system date.
从系统提示的日期中提取当前年份(例如: → 当前年份为2026)。
currentDate: 2026-02-16- 如果用户指定赛季:直接使用用户指定的赛季。
- 如果用户说“当前”、“本赛季”或未指定:NFL赛季为9月至次年2月。如果当前月份为3-8月,使用(即将到来的赛季);如果当前月份为9-2月,若处于1-2月则活跃赛季起始于上一自然年,否则使用当前年份。
season = 当前年份 - 禁止硬编码赛季:始终从系统日期推导赛季。
Commands
命令列表
get_scoreboard
get_scoreboard
Get live/recent NFL scores.
- (str, optional): Date in YYYY-MM-DD format
date - (int, optional): Week number (1-18 regular season, 19-23 postseason)
week
Returns with game info, scores, status, and competitors.
events[]获取NFL实时/近期比分。
- (字符串,可选):日期格式为YYYY-MM-DD
date - (整数,可选):周数(常规赛1-18周,季后赛19-23周)
week
返回包含赛事信息、比分、状态和参赛队伍的数组。
events[]get_standings
get_standings
Get NFL standings by conference and division.
- (int, optional): Season year
season
Returns with AFC/NFC conferences, divisions, and team standings including W-L-T, PCT, PF, PA.
groups[]获取NFL分区及联盟排名。
- (整数,可选):赛季年份
season
返回包含AFC/NFC联盟、分区及球队排名(胜-负-平、胜率、得分、失分)的数组。
groups[]get_teams
get_teams
Get all 32 NFL teams. No parameters.
Returns with id, name, abbreviation, logo, and location.
teams[]获取全部32支NFL球队信息,无参数。
返回包含球队ID、名称、缩写、队徽和所在地的数组。
teams[]get_team_roster
get_team_roster
Get full roster for a team.
- (str, required): ESPN team ID (e.g., "12" for Broncos)
team_id
Returns with name, position, jersey number, height, weight, experience.
athletes[]获取指定球队的完整球员名单。
- (字符串,必填):ESPN球队ID(例如:Broncos的ID为"12")
team_id
返回包含球员姓名、位置、球衣号码、身高、体重、参赛经验的数组。
athletes[]get_team_schedule
get_team_schedule
Get schedule for a specific team.
- (str, required): ESPN team ID
team_id - (int, optional): Season year
season
Returns with opponent, date, score (if played), and venue.
events[]获取指定球队的赛程。
- (字符串,必填):ESPN球队ID
team_id - (整数,可选):赛季年份
season
返回包含对手、日期、比分(已完赛赛事)和场馆的数组。
events[]get_game_summary
get_game_summary
Get detailed box score and scoring plays.
- (str, required): ESPN event ID
event_id
Returns , , (passing/rushing/receiving stats), , and .
game_infocompetitorsboxscorescoring_playsleaders获取赛事详细技术统计和得分记录。
- (字符串,必填):ESPN赛事ID
event_id
返回、、(传球/冲球/接球数据)、和。
game_infocompetitorsboxscorescoring_playsleadersget_leaders
get_leaders
Get NFL statistical leaders (passing, rushing, receiving).
- (int, optional): Season year
season
Returns with leader rankings per stat category.
categories[]获取NFL数据领跑者(传球、冲球、接球)。
- (整数,可选):赛季年份
season
返回包含各数据类别排名的数组。
categories[]get_news
get_news
Get NFL news articles.
- (str, optional): Filter by team
team_id
Returns with headline, description, published date, and link.
articles[]获取NFL新闻资讯。
- (字符串,可选):按球队筛选
team_id
返回包含标题、摘要、发布日期和链接的数组。
articles[]get_play_by_play
get_play_by_play
Get full play-by-play data for a game.
- (str, required): ESPN event ID
event_id
Returns with play-by-play detail including down, distance, yard line, play description, and scoring plays.
drives[]获取赛事完整逐次进攻记录。
- (字符串,必填):ESPN赛事ID
event_id
返回包含进攻回合详情(档数、码数、码线位置、进攻描述、得分记录)的数组。
drives[]get_win_probability
get_win_probability
Get win probability chart data for a game.
- (str, required): ESPN event ID
event_id
Returns timestamped home/away win probability percentages throughout the game.
获取赛事获胜概率变化数据。
- (字符串,必填):ESPN赛事ID
event_id
返回赛事全程带时间戳的主客场获胜概率百分比数据。
get_schedule
get_schedule
Get NFL season schedule by week.
- (int, optional): Season year
season - (int, optional): Week number (1-18 regular season, 19-23 postseason)
week
Returns for the specified week/season.
events[]获取NFL赛季周赛程。
- (整数,可选):赛季年份
season - (整数,可选):周数(常规赛1-18周,季后赛19-23周)
week
返回指定周/赛季的数组。
events[]get_injuries
get_injuries
Get current NFL injury reports across all teams. No parameters.
Returns with per-team injury lists including player name, position, status (Out/Doubtful/Questionable/Day-To-Day), injury type, and detail.
teams[]获取全NFL球队当前伤病报告,无参数。
返回包含各球队伤病名单(球员姓名、位置、状态(缺席/存疑/每日观察)、伤病类型、详情)的数组。
teams[]get_transactions
get_transactions
Get recent NFL transactions (trades, signings, waivers).
- (int, optional): Max transactions to return. Defaults to 50.
limit
Returns with date, team, and description.
transactions[]获取NFL近期交易信息(转会、签约、弃权)。
- (整数,可选):返回的最大交易数量,默认50条。
limit
返回包含日期、球队和交易描述的数组。
transactions[]get_futures
get_futures
Get NFL futures/odds markets (Super Bowl winner, MVP, etc.).
- (int, optional): Max entries per market. Defaults to 25.
limit - (int, optional): Season year. Defaults to current.
season_year
Returns with market name and entries (team/player name + odds value).
futures[]获取NFL期货/赔率市场(超级碗冠军、MVP等)。
- (整数,可选):每个市场返回的最大条目数,默认25条。
limit - (整数,可选):赛季年份,默认为当前赛季。
season_year
返回包含市场名称和条目(球队/球员名称+赔率)的数组。
futures[]get_depth_chart
get_depth_chart
Get depth chart for a specific team.
- (str, required): ESPN team ID
team_id
Returns with offense/defense/special teams positions and player depth order.
charts[]获取指定球队的深度阵容图。
- (字符串,必填):ESPN球队ID
team_id
返回包含进攻/防守/特勤组位置及球员深度排序的数组。
charts[]get_team_stats
get_team_stats
Get full team statistical profile for a season.
- (str, required): ESPN team ID
team_id - (int, optional): Season year. Defaults to current.
season_year - (int, optional): 1=preseason, 2=regular (default), 3=postseason.
season_type
Returns (Passing, Rushing, Receiving, etc.) with detailed stats including value, rank, and per-game averages.
categories[]获取球队赛季完整统计数据。
- (字符串,必填):ESPN球队ID
team_id - (整数,可选):赛季年份,默认为当前赛季。
season_year - (整数,可选):1=季前赛,2=常规赛(默认),3=季后赛。
season_type
返回包含各数据类别(传球、冲球、接球等)的数组,包含详细数据、排名和场均数据。
categories[]get_player_stats
get_player_stats
Get full player statistical profile for a season.
- (str, required): ESPN athlete ID
player_id - (int, optional): Season year. Defaults to current.
season_year - (int, optional): 1=preseason, 2=regular (default), 3=postseason.
season_type
Returns with detailed stats including value, rank, and per-game averages.
categories[]获取球员赛季完整统计数据。
- (字符串,必填):ESPN球员ID
player_id - (整数,可选):赛季年份,默认为当前赛季。
season_year - (整数,可选):1=季前赛,2=常规赛(默认),3=季后赛。
season_type
返回包含各数据类别的数组,包含详细数据、排名和场均数据。
categories[]Team IDs (Common)
常用球队ID
| Team | ID | Team | ID |
|---|---|---|---|
| Cardinals | 22 | Rams | 14 |
| Falcons | 1 | Ravens | 33 |
| Bills | 2 | Bears | 3 |
| Panthers | 29 | Bengals | 4 |
| Cowboys | 6 | Browns | 5 |
| Broncos | 7 | Lions | 8 |
| Packers | 9 | Texans | 34 |
| Colts | 11 | Jaguars | 30 |
| Chiefs | 12 | Raiders | 13 |
| Chargers | 24 | Dolphins | 15 |
| Vikings | 16 | Patriots | 17 |
| Saints | 18 | Giants | 19 |
| Jets | 20 | Eagles | 21 |
| Steelers | 23 | 49ers | 25 |
| Seahawks | 26 | Buccaneers | 27 |
| Titans | 10 | Commanders | 28 |
| 球队 | ID | 球队 | ID |
|---|---|---|---|
| Cardinals | 22 | Rams | 14 |
| Falcons | 1 | Ravens | 33 |
| Bills | 2 | Bears | 3 |
| Panthers | 29 | Bengals | 4 |
| Cowboys | 6 | Browns | 5 |
| Broncos | 7 | Lions | 8 |
| Packers | 9 | Texans | 34 |
| Colts | 11 | Jaguars | 30 |
| Chiefs | 12 | Raiders | 13 |
| Chargers | 24 | Dolphins | 15 |
| Vikings | 16 | Patriots | 17 |
| Saints | 18 | Giants | 19 |
| Jets | 20 | Eagles | 21 |
| Steelers | 23 | 49ers | 25 |
| Seahawks | 26 | Buccaneers | 27 |
| Titans | 10 | Commanders | 28 |
Examples
使用示例
User: "What are today's NFL scores?"
bash
sports-skills nfl get_scoreboardUser: "Show me the AFC standings"
bash
sports-skills nfl get_standings --season=2025Then filter results for AFC conference.
User: "Who's on the Chiefs roster?"
bash
sports-skills nfl get_team_roster --team_id=12User: "How did the Super Bowl go?"
- Find the event_id from (Super Bowl = week 23)
get_scoreboard --week=23 - Call for full box score Alternatively, use
get_game_summary --event_id=<id>to find the event.get_schedule --week=23
User: "Who's injured on the Chiefs?"
bash
sports-skills nfl get_injuriesThen filter results for Kansas City Chiefs (team_id=12).
User: "Show me the Chiefs depth chart"
bash
sports-skills nfl get_depth_chart --team_id=12User: "What are the Super Bowl odds?"
bash
sports-skills nfl get_futures --limit=10User: "Show me Patrick Mahomes' stats this season"
bash
sports-skills nfl get_player_stats --player_id=3139477用户:“今天的NFL比分是多少?”
bash
sports-skills nfl get_scoreboard用户:“展示AFC联盟排名”
bash
sports-skills nfl get_standings --season=2025然后筛选AFC联盟的结果。
用户:“Chiefs的球员名单有哪些?”
bash
sports-skills nfl get_team_roster --team_id=12用户:“超级碗的结果如何?”
- 从中获取event_id(超级碗为第23周)
get_scoreboard --week=23 - 调用获取完整技术统计 或者使用
get_game_summary --event_id=<id>查找赛事ID。get_schedule --week=23
用户:“Chiefs有哪些球员受伤?”
bash
sports-skills nfl get_injuries然后筛选堪萨斯城酋长队(team_id=12)的结果。
用户:“展示Chiefs的深度阵容图”
bash
sports-skills nfl get_depth_chart --team_id=12用户:“超级碗的赔率是多少?”
bash
sports-skills nfl get_futures --limit=10用户:“展示Patrick Mahomes本赛季的数据”
bash
sports-skills nfl get_player_stats --player_id=3139477Error Handling
错误处理
When a command fails, do not surface raw errors to the user. Instead:
- Catch silently and try alternatives
- If team name given instead of ID, use to find the ID first
get_teams - Only report failure with a clean message after exhausting alternatives
当命令执行失败时,请勿向用户暴露原始错误信息,请遵循以下步骤:
- 静默捕获错误并尝试替代方案
- 如果用户提供的是球队名称而非ID,先使用查找对应ID
get_teams - 仅在穷尽所有替代方案后,向用户展示简洁的失败提示
Troubleshooting
故障排除
- command not found: Run
sports-skills. If the package is not found on PyPI, install from GitHub:pip install sports-skillspip install git+https://github.com/machina-sports/sports-skills.git - Team not found: Use to list all teams and find the correct ID
get_teams - No data for future games: ESPN only returns data for completed or in-progress games
- Week numbers: Regular season is weeks 1-18. Postseason uses unified numbering: Wild Card=19, Divisional=20, Conference Championship=21, Pro Bowl=22, Super Bowl=23. The connector translates these to ESPN's internal automatically.
seasontype=3 - Team schedule includes postseason: returns both regular-season and postseason games.
get_team_schedule
- 命令未找到:运行
sports-skills。如果PyPI上未找到该包,从GitHub安装:pip install sports-skillspip install git+https://github.com/machina-sports/sports-skills.git - 球队未找到:使用列出所有球队并查找正确ID
get_teams - 未来赛事无数据:ESPN仅返回已完赛或进行中赛事的数据
- 周数说明:常规赛为1-18周。季后赛使用统一编号:外卡赛=19,分区赛=20,联盟冠军赛=21,职业碗=22,超级碗=23。工具会自动将这些编号转换为ESPN内部的参数。
seasontype=3 - 球队赛程包含季后赛:会同时返回常规赛和季后赛赛事。
get_team_schedule