football-data by machina-sports/sports-skills
npx skills add https://github.com/machina-sports/sports-skills --skill football-data在编写查询之前,请查阅 references/api-reference.md 以了解端点、ID 约定和数据形状。
首次使用前,检查 CLI 是否可用:
which sports-skills || pip install sports-skills
如果 pip install 失败(包未找到或 Python 版本错误),请从 GitHub 安装:
pip install git+https://github.com/machina-sports/sports-skills.git
该包需要 Python 3.10+。如果您的默认 Python 版本较旧,请使用特定版本:
python3 --version # 检查版本
# 如果版本 < 3.10,尝试:python3.12 -m pip install sports-skills
# 在 macOS 上使用 Homebrew:/opt/homebrew/bin/python3.12 -m pip install sports-skills
无需 API 密钥。
推荐使用 CLI —— 它可以避免 Python 导入路径问题:
sports-skills football get_daily_schedule
sports-skills football get_season_standings --season_id=premier-league-2025
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
Python SDK(备选方案):
from sports_skills import football
standings = football.get_season_standings(season_id="premier-league-2025")
schedule = football.get_daily_schedule()
关键:在调用任何数据端点之前,请验证:
get_current_season(competition_id="...") —— 切勿硬编码。search_team(query="...") 验证 Team ID。get_event_xg 和 get_event_players_statistics(包含 xG)仅针对前五联赛(英超、西甲、德甲、意甲、法甲)调用。get_season_leaders 和 get_missing_players 仅针对英超赛季调用(season_id 必须以 premier-league- 开头)。从系统提示的日期推导当前年份(例如,currentDate: 2026-02-16 → 当前年份为 2026)。
get_current_season(competition_id="...") 来获取活跃的 season_id。请勿猜测或硬编码年份。{联赛缩写}-{年份}(例如,对于 2025-26 赛季为 "premier-league-2025")。年份是赛季的开始年份,而非结束年份。get_current_season(competition_id="mls")。| 命令 | 描述 |
|---|---|
get_current_season | 检测赛事当前赛季 |
get_competitions | 列出可用赛事及当前赛季信息 |
get_competition_seasons | 赛事的可用赛季 |
get_season_schedule | 完整赛季比赛日程 |
get_season_standings | 赛季联赛积分榜 |
get_season_leaders | 最佳射手/领先者(仅限英超) |
get_season_teams | 赛季中的球队 |
search_team | 按名称搜索球队 |
search_player | 按名称搜索球员 |
get_team_profile | 基本球队信息(无阵容/花名册) |
get_daily_schedule | 指定日期所有联赛的比赛 |
get_event_summary | 比赛摘要(含比分) |
get_event_lineups | 比赛阵容 |
get_event_statistics | 比赛球队统计数据 |
get_event_timeline | 比赛时间线(进球、红黄牌、换人) |
get_team_schedule | 特定球队的赛程 |
get_head_to_head | 不可用 —— 返回空 |
get_event_xg | xG 数据(仅限前五联赛) |
get_event_players_statistics | 球员级比赛统计数据(可选 xG) |
get_missing_players | 受伤/存疑球员(仅限英超) |
get_season_transfers | 通过 Transfermarkt 获取转会历史 |
get_player_season_stats | 通过 ESPN 获取球员赛季统计数据 |
get_player_profile | 球员资料(FPL 和/或 Transfermarkt) |
完整参数列表、返回形状和数据覆盖表请参见 references/api-reference.md。
示例 1:英超积分榜 用户说:“给我看看英超积分榜” 操作:
get_current_season(competition_id="premier-league") 获取当前 season_idget_season_standings(season_id=<步骤1中的season_id>)
结果:包含排名、球队、场次、胜、平、负、净胜球、积分的积分榜示例 2:比赛报告 用户说:“阿森纳对利物浦的比赛结果如何?” 操作:
get_daily_schedule() 或 get_team_schedule(team_id="359") 查找 event_idget_event_summary(event_id="...") 获取比分get_event_statistics(event_id="...") 获取控球率、射门等数据get_event_xg(event_id="...") 获取 xG 对比(英超 —— 仅限前五联赛)
结果:包含比分、关键统计数据和 xG 的比赛报告示例 3:球队深度分析 用户说:“深度分析切尔西近期的状态” 操作:
search_team(query="Chelsea") → team_id=363, competition=premier-leagueget_team_schedule(team_id="363", competition_id="premier-league") → 查找近期已结束的比赛get_event_xg、get_event_statistics、get_event_players_statisticsget_missing_players(season_id=<season_id>) → 筛选切尔西的受伤/存疑球员
结果:跨比赛的 xG 趋势、关键球员统计数据以及伤病报告示例 4:球员市场价值 用户说:“萨卡的市场价值是多少?” 操作:
get_player_profile(tm_player_id="433177") 获取 Transfermarkt 数据fpl_id 以获取 FPL 统计数据
结果:市场价值、价值历史和转会历史示例 5:非英超俱乐部 用户说:“告诉我关于科林蒂安的信息” 操作:
search_team(query="Corinthians") → team_id=874, competition=serie-a-brazilget_team_schedule(team_id="874", competition_id="serie-a-brazil") 获取赛程get_event_timeline(event_id="...") 获取进球、红黄牌、换人信息
结果:赛程、时间线事件(注意:xG、FPL 统计数据和赛季最佳射手不适用于巴西甲级联赛)get_standingsget_season_standings(需要 season_id)。get_live_scoresget_daily_schedule() 获取今日比赛。get_team_squadget_team_rosterget_team_profile 不返回球员信息。使用 get_season_leaders 获取 PL 球员 ID,然后使用 get_player_profile。get_transfersget_season_transfers(需要 season_id + tm_player_ids)。get_match_resultsget_matchget_event_summary 并附带 event_id。get_player_statsget_event_players_statistics 获取比赛级统计数据,或使用 get_player_profile 获取职业生涯数据。get_scoresget_resultsget_event_summary 并附带 event_id。get_fixturesget_daily_schedule 获取今日比赛,或使用 get_season_schedule 获取完整赛季赛程。get_league_tableget_season_standings 并附带 season_id。如果一个命令不在上方的命令表中,则它不存在。请勿尝试调用未列出的命令。
当命令失败时(错误的 event_id、数据缺失、网络错误等),不要向用户显示原始错误。而是:
get_daily_schedule() 或 get_team_schedule() 来发现正确的 ID。错误:sports-skills 命令未找到
原因:包未安装
解决方案:运行 pip install sports-skills。如果不在 PyPI 上,从 GitHub 安装:pip install git+https://github.com/machina-sports/sports-skills.git
错误:ModuleNotFoundError: No module named 'sports_skills'
原因:包未安装或路径问题
解决方案:安装该包。为避免路径问题,优先使用 CLI 而非 Python 导入
错误:get_season_leaders 或 get_missing_players 对非英超联赛返回空
原因:这些命令仅适用于英超联赛;对于其他联赛,它们会静默返回空
解决方案:检查 references/api-reference.md 中的数据覆盖表。对于其他联赛,使用 get_event_players_statistics 获取球员数据
错误:get_team_profile 不返回球员
原因:此命令不返回球队阵容 —— 这是预期行为
解决方案:对于英超球队,使用 get_season_leaders 查找球员 FPL ID,然后使用 get_player_profile(fpl_id="...")
错误:season_id 格式错误
原因:Season ID 必须遵循 {联赛缩写}-{年份} 格式
解决方案:使用 get_current_season(competition_id="...") 来发现正确的格式。例如:"premier-league-2025",而不是 "2025-2026" 或 "EPL-2025"
错误:近期比赛无 xG 数据
原因:Understat 数据可能在比赛结束后延迟 24-48 小时
解决方案:如果 get_event_xg 对近期前五联赛比赛返回空,请稍后重试。仅适用于英超、西甲、德甲、意甲、法甲
错误:球队或比赛 ID 未知
原因:ID 是猜测的,而非查找的
解决方案:使用 search_team(query="球队名称") 查找球队 ID,或使用 get_daily_schedule / get_season_schedule 查找比赛 ID。切勿猜测 ID。
每周安装量
377
代码库
GitHub Stars
54
首次出现
2026年2月16日
安全审计
安装于
codex360
opencode359
gemini-cli356
github-copilot347
cursor343
kimi-cli341
Before writing queries, consult references/api-reference.md for endpoints, ID conventions, and data shapes.
Before first use, check if the CLI is available:
which sports-skills || pip install sports-skills
If pip install fails (package not found or Python version error), install from GitHub:
pip install git+https://github.com/machina-sports/sports-skills.git
The package requires Python 3.10+. If your default Python is older, use a specific version:
python3 --version # check version
# 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
No API keys required.
Prefer the CLI — it avoids Python import path issues:
sports-skills football get_daily_schedule
sports-skills football get_season_standings --season_id=premier-league-2025
Python SDK (alternative):
from sports_skills import football
standings = football.get_season_standings(season_id="premier-league-2025")
schedule = football.get_daily_schedule()
CRITICAL: Before calling any data endpoint, verify:
get_current_season(competition_id="...") — never hardcoded.search_team(query="...") if only a name is provided.get_event_xg and get_event_players_statistics (with xG) are only called for top-5 leagues (EPL, La Liga, Bundesliga, Serie A, Ligue 1).get_season_leaders and get_missing_players are only called for Premier League seasons (season_id must start with premier-league-).Derive the current year from the system prompt's date (e.g., currentDate: 2026-02-16 → current year is 2026).
get_current_season(competition_id="...") to get the active season_id. Do NOT guess or hardcode the year.{league-slug}-{year} (e.g., "premier-league-2025" for the 2025-26 season). The year is the start year of the season, not the end year.get_current_season(competition_id="mls").| Command | Description |
|---|---|
get_current_season | Detect current season for a competition |
get_competitions | List available competitions with current season info |
get_competition_seasons | Available seasons for a competition |
get_season_schedule | Full season match schedule |
get_season_standings | League table for a season |
get_season_leaders |
See references/api-reference.md for full parameter lists, return shapes, and data coverage table.
Example 1: Premier League table User says: "Show me the Premier League table" Actions:
get_current_season(competition_id="premier-league") to get the current season_idget_season_standings(season_id=<season_id from step 1>) Result: Standings table with position, team, played, won, drawn, lost, GD, pointsExample 2: Match report User says: "How did Arsenal vs Liverpool go?" Actions:
get_daily_schedule() or get_team_schedule(team_id="359") to find the event_idget_event_summary(event_id="...") for the scoreget_event_statistics(event_id="...") for possession, shots, etc.get_event_xg(event_id="...") for xG comparison (EPL — top 5 only) Result: Match report with scores, key stats, and xGExample 3: Team deep dive User says: "Deep dive on Chelsea's recent form" Actions:
search_team(query="Chelsea") → team_id=363, competition=premier-leagueget_team_schedule(team_id="363", competition_id="premier-league") → find recent closed eventsget_event_xg, get_event_statistics, get_event_players_statisticsget_missing_players(season_id=<season_id>) → filter Chelsea's injured/doubtful players Result: xG trend across matches, key player stats, and injury reportExample 4: Player market value User says: "What's Saka's market value?" Actions:
get_player_profile(tm_player_id="433177") for Transfermarkt datafpl_id for FPL stats Result: Market value, value history, and transfer historyExample 5: Non-PL club User says: "Tell me about Corinthians" Actions:
search_team(query="Corinthians") → team_id=874, competition=serie-a-brazilget_team_schedule(team_id="874", competition_id="serie-a-brazil") for fixturesget_event_timeline(event_id="...") for goals, cards, subs Result: Fixtures, timeline events (note: xG, FPL stats, and season leaders NOT available for Brazilian Serie A)get_standingsget_season_standings (requires season_id).get_live_scoresget_daily_schedule() for today's matches.get_team_squadget_team_rosterget_team_profile does NOT return players. Use get_season_leaders for PL player IDs, then get_player_profile.If a command is not in the Commands table above, it does not exist. Do not try commands not listed.
When a command fails (wrong event_id, missing data, network error, etc.), do not surface the raw error to the user. Instead:
get_daily_schedule() or get_team_schedule() to discover the correct ID.Error: sports-skills command not found Cause: Package not installed Solution: Run pip install sports-skills. If not on PyPI, install from GitHub: pip install git+https://github.com/machina-sports/sports-skills.git
Error: ModuleNotFoundError: No module named 'sports_skills' Cause: Package not installed or path issue Solution: Install the package. Prefer the CLI over Python imports to avoid path issues
Error: get_season_leaders or get_missing_players returns empty for a non-PL league Cause: These commands only work for Premier League; they silently return empty for other leagues Solution: Check the Data Coverage table in references/api-reference.md. For other leagues, use get_event_players_statistics for player data
Error: get_team_profile returns no players Cause: This command does not return squad rosters — this is expected behavior Solution: For PL teams, use get_season_leaders to find player FPL IDs, then get_player_profile(fpl_id="...")
Error: Wrong season_id format Cause: Season ID must follow the {league-slug}-{year} format Solution: Use get_current_season(competition_id="...") to discover the correct format. Example: "premier-league-2025", not "2025-2026" or "EPL-2025"
Error: No xG data for a recent match Cause: Understat data may lag 24-48 hours after a match ends Solution: If get_event_xg returns empty for a recent top-5 match, retry later. Only available for EPL, La Liga, Bundesliga, Serie A, Ligue 1
Error: Team or event ID unknown Cause: ID was guessed instead of looked up Solution: Use search_team(query="team name") to find team IDs, or get_daily_schedule / get_season_schedule to find event IDs. Never guess IDs.
Weekly Installs
377
Repository
GitHub Stars
54
First Seen
Feb 16, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
codex360
opencode359
gemini-cli356
github-copilot347
cursor343
kimi-cli341
DOCX文件创建、编辑与分析完整指南 - 使用docx-js、Pandoc和Python脚本
43,600 周安装
| Top scorers/leaders (Premier League only) |
get_season_teams | Teams in a season |
search_team | Search for a team by name |
search_player | Search for a player by name |
get_team_profile | Basic team info (no squad/roster) |
get_daily_schedule | All matches for a date across all leagues |
get_event_summary | Match summary with scores |
get_event_lineups | Match lineups |
get_event_statistics | Match team statistics |
get_event_timeline | Match timeline (goals, cards, subs) |
get_team_schedule | Schedule for a specific team |
get_head_to_head | UNAVAILABLE — returns empty |
get_event_xg | xG data (top 5 leagues only) |
get_event_players_statistics | Player-level match stats with optional xG |
get_missing_players | Injured/doubtful players (Premier League only) |
get_season_transfers | Transfer history via Transfermarkt |
get_player_season_stats | Player season stats via ESPN |
get_player_profile | Player profile (FPL and/or Transfermarkt) |
get_transfersget_season_transfers (requires season_id + tm_player_ids).get_match_resultsget_matchget_event_summary with an event_id.get_player_statsget_event_players_statistics for match-level stats, or get_player_profile for career data.get_scoresget_resultsget_event_summary with an event_id.get_fixturesget_daily_schedule for today's matches or get_season_schedule for a full season.get_league_tableget_season_standings with a season_id.