football-data
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseFootball Data
足球数据工具
Setup
安装配置
Before first use, check if the CLI is available:
bash
which sports-skills || pip install sports-skillsIf fails with a Python version error, the package requires Python 3.10+. Find a compatible Python:
pip installbash
python3 --version # check version首次使用前,检查CLI是否可用:
bash
which sports-skills || pip install sports-skills如果因Python版本错误失败,说明该包需要Python 3.10+版本。请找到兼容的Python版本:
pip installbash
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 football get_daily_schedule
sports-skills football get_season_standings --season_id=premier-league-2025Python SDK (alternative):
python
from sports_skills import football
standings = football.get_season_standings(season_id="premier-league-2025")
schedule = football.get_daily_schedule()推荐使用CLI——可避免Python导入路径问题:
bash
sports-skills football get_daily_schedule
sports-skills football get_season_standings --season_id=premier-league-2025Python SDK(替代方案):
python
from sports_skills import football
standings = football.get_season_standings(season_id="premier-league-2025")
schedule = football.get_daily_schedule()Data Coverage by League
各联赛数据覆盖情况
Not all data is available for every league. Use the right command for the right league.
| Command | All 13 leagues | Top 5 only | PL only |
|---|---|---|---|
| get_season_standings | x | ||
| get_daily_schedule | x | ||
| get_season_schedule | x | ||
| get_season_teams | x | ||
| search_team | x | ||
| get_team_schedule | x | ||
| get_team_profile | x | ||
| get_event_summary | x | ||
| get_event_lineups | x | ||
| get_event_statistics | x | ||
| get_event_timeline | x | ||
| get_current_season | x | ||
| get_competitions | x | ||
| get_event_xg | x | ||
| get_event_players_statistics (with xG) | x | ||
| get_season_leaders | x | ||
| get_missing_players | x |
Top 5 leagues (Understat): EPL, La Liga, Bundesliga, Serie A, Ligue 1.
PL only (FPL): Premier League — injury news, player stats, ownership, ICT index.
All leagues: via ESPN — scores, standings, schedules, match summaries, lineups, team stats.
Transfermarkt: Works for any player with a — market values and transfer history.
tm_player_idNote: MLS uses a different season structure (spring-fall calendar). Use to detect the right season_id.
get_current_season(competition_id="mls")并非所有数据在每个联赛都可用,请为对应联赛选择正确的命令。
| 命令 | 全部13个联赛 | 仅Top 5联赛 | 仅Premier League |
|---|---|---|---|
| get_season_standings | x | ||
| get_daily_schedule | x | ||
| get_season_schedule | x | ||
| get_season_teams | x | ||
| search_team | x | ||
| get_team_schedule | x | ||
| get_team_profile | x | ||
| get_event_summary | x | ||
| get_event_lineups | x | ||
| get_event_statistics | x | ||
| get_event_timeline | x | ||
| get_current_season | x | ||
| get_competitions | x | ||
| get_event_xg | x | ||
| get_event_players_statistics (带xG) | x | ||
| get_season_leaders | x | ||
| get_missing_players | x |
Top 5联赛(数据来自Understat):EPL、La Liga、Bundesliga、Serie A、Ligue 1。
仅Premier League(数据来自FPL):伤病新闻、球员统计、球员持有率、ICT指数。
全部联赛:数据来自ESPN——比分、排名、赛程、赛事总结、首发阵容、球队统计。
Transfermarkt:适用于所有带有的球员——市场身价和转会历史。
tm_player_id注意:MLS采用不同的赛季结构(春秋赛制)。请使用检测正确的season_id。
get_current_season(competition_id="mls")ID Conventions
ID命名规则
- season_id: e.g.
{league-slug}-{year},"premier-league-2025""la-liga-2025" - competition_id: league slug e.g. ,
"premier-league","serie-a""champions-league" - team_id: ESPN team ID (numeric string) e.g. (Arsenal),
"359"(Real Madrid)"86" - event_id: ESPN event ID (numeric string) e.g.
"740847" - fpl_id: FPL element ID or code (PL players only)
- tm_player_id: Transfermarkt player ID e.g. (Saka),
"433177"(Mbappe)"342229"
- season_id:例如
{league-slug}-{year},"premier-league-2025""la-liga-2025" - competition_id:联赛缩写 例如 ,
"premier-league","serie-a""champions-league" - team_id:ESPN球队ID(数字字符串)例如 (阿森纳),
"359"(皇家马德里)"86" - event_id:ESPN赛事ID(数字字符串)例如
"740847" - fpl_id:FPL球员ID或编码(仅适用于Premier League球员)
- tm_player_id:Transfermarkt球员ID 例如 (萨卡),
"433177"(姆巴佩)"342229"
Commands
命令列表
get_current_season
get_current_season
Detect current season for a competition. Works for all leagues.
- (str, required): Competition slug
competition_id
Returns and :
data.competitiondata.seasonjson
{"competition": {"id": "premier-league", "name": "Premier League"}, "season": {"id": "premier-league-2025", "name": "2025-26 English Premier League", "year": "2025"}}检测指定赛事的当前赛季,支持所有联赛。
- (字符串,必填):赛事缩写
competition_id
返回和:
data.competitiondata.seasonjson
{"competition": {"id": "premier-league", "name": "Premier League"}, "season": {"id": "premier-league-2025", "name": "2025-26 English Premier League", "year": "2025"}}get_competitions
get_competitions
List available competitions with current season info. No params. Works for all leagues.
Returns with , , , .
data.competitions[]idnamecodecurrent_season列出所有可用赛事及当前赛季信息,无参数,支持所有联赛。
返回,包含、、、字段。
data.competitions[]idnamecodecurrent_seasonget_competition_seasons
get_competition_seasons
Get available seasons for a competition. Works for all leagues.
- (str, required): Competition slug
competition_id
获取指定赛事的所有可用赛季,支持所有联赛。
- (字符串,必填):赛事缩写
competition_id
get_season_schedule
get_season_schedule
Get full season match schedule. Works for all leagues.
- (str, required): Season slug (e.g., "premier-league-2025")
season_id
Returns — same shape as events below.
data.schedules[]获取指定赛季的完整赛事赛程,支持所有联赛。
- (字符串,必填):赛季缩写(例如"premier-league-2025")
season_id
返回——结构与下文的赛事数据一致。
data.schedules[]get_season_standings
get_season_standings
Get league table for a season. Works for all leagues.
- (str, required): Season slug
season_id
Returns :
data.standings[].entries[]json
{
"position": 1,
"team": {"id": "359", "name": "Arsenal", "short_name": "Arsenal", "abbreviation": "ARS", "crest": "https://..."},
"played": 26, "won": 17, "drawn": 6, "lost": 3,
"goals_for": 50, "goals_against": 18, "goal_difference": 32, "points": 57
}获取指定赛季的联赛积分榜,支持所有联赛。
- (字符串,必填):赛季缩写
season_id
返回:
data.standings[].entries[]json
{
"position": 1,
"team": {"id": "359", "name": "Arsenal", "short_name": "Arsenal", "abbreviation": "ARS", "crest": "https://..."},
"played": 26, "won": 17, "drawn": 6, "lost": 3,
"goals_for": 50, "goals_against": 18, "goal_difference": 32, "points": 57
}get_season_leaders
get_season_leaders
Get top scorers/leaders for a season. Premier League only (via FPL).
- (str, required): Season slug (must be
season_id)premier-league-*
Returns — note: player name is nested under :
data.leaders[].player.namejson
{
"player": {"id": "223094", "name": "Erling Haaland", "first_name": "Erling", "last_name": "Haaland", "position": "Forward"},
"team": {"id": "43", "name": "Man City"},
"goals": 22, "assists": 6, "penalties": 0, "played_matches": 25
}Returns empty for non-PL leagues.
获取指定赛季的顶级射手/数据领跑者,仅支持Premier League(数据来自FPL)。
- (字符串,必填):赛季缩写(必须为
season_id格式)premier-league-*
返回——注意:球员名称嵌套在字段下:
data.leaders[].player.namejson
{
"player": {"id": "223094", "name": "Erling Haaland", "first_name": "Erling", "last_name": "Haaland", "position": "Forward"},
"team": {"id": "43", "name": "Man City"},
"goals": 22, "assists": 6, "penalties": 0, "played_matches": 25
}针对非Premier League联赛调用会返回空值。
get_season_teams
get_season_teams
Get teams in a season. Works for all leagues.
- (str, required): Season slug
season_id
获取指定赛季的所有参赛球队,支持所有联赛。
- (字符串,必填):赛季缩写
season_id
search_team
search_team
Search for a team by name across all leagues (or a specific one). Uses fuzzy matching.
- (str, required): Team name to search (e.g., "Corinthians", "Barcelona", "Man Utd")
query - (str, optional): Limit search to one league (e.g., "serie-a-brazil", "premier-league")
competition_id
Returns with , , and for each match:
data.results[]teamcompetitionseasonjson
{"team": {"id": "874", "name": "Corinthians"}, "competition": {"id": "serie-a-brazil", "name": "Serie A Brazil"}, "season": {"id": "serie-a-brazil-2025", "year": "2025"}}按名称搜索球队(支持全联赛或指定联赛),使用模糊匹配。
- (字符串,必填):球队名称(例如"Corinthians", "Barcelona", "Man Utd")
query - (字符串,可选):限制搜索范围到指定联赛(例如"serie-a-brazil", "premier-league")
competition_id
返回,包含每个匹配结果的、和字段:
data.results[]teamcompetitionseasonjson
{"team": {"id": "874", "name": "Corinthians"}, "competition": {"id": "serie-a-brazil", "name": "Serie A Brazil"}, "season": {"id": "serie-a-brazil-2025", "year": "2025"}}get_team_profile
get_team_profile
Get basic team info (name, crest, venue). Does not return squad/roster — use to find PL player IDs, then for individual player data.
get_season_leadersget_player_profile- (str, required): ESPN team ID
team_id - (str, optional): League hint (faster resolution)
league_slug
Returns and . is empty — see "Deep dive on a PL team" example below for the recommended workflow.
data.teamdata.venuedata.players[]获取球队基本信息(名称、队徽、主场)。不返回球队阵容——如需获取Premier League球队的球员数据,请先使用获取球员FPL ID,再调用获取单个球员数据。
get_season_leadersget_player_profile- (字符串,必填):ESPN球队ID
team_id - (字符串,可选):联赛提示(可加快查询速度)
league_slug
返回和字段。为空——请参考下文“深度分析Premier League球队”示例中的推荐流程。
data.teamdata.venuedata.players[]get_daily_schedule
get_daily_schedule
Get all matches for a specific date across all leagues.
- (str, optional): Date in YYYY-MM-DD format. Defaults to today.
date
Returns and :
data.datedata.events[]json
{
"id": "748381", "status": "not_started", "start_time": "2026-02-16T20:00Z",
"competition": {"id": "la-liga", "name": "La Liga"},
"season": {"id": "la-liga-2025", "year": "2025"},
"venue": {"name": "Estadi Montilivi", "city": "Girona"},
"competitors": [
{"team": {"id": "9812", "name": "Girona", "abbreviation": "GIR"}, "qualifier": "home", "score": 0},
{"team": {"id": "83", "name": "Barcelona", "abbreviation": "BAR"}, "qualifier": "away", "score": 0}
],
"scores": {"home": 0, "away": 0}
}Status values: , , , , .
"not_started""live""halftime""closed""postponed"获取指定日期全联赛的所有赛事。
- (字符串,可选):日期格式为YYYY-MM-DD,默认值为今日。
date
返回和:
data.datedata.events[]json
{
"id": "748381", "status": "not_started", "start_time": "2026-02-16T20:00Z",
"competition": {"id": "la-liga", "name": "La Liga"},
"season": {"id": "la-liga-2025", "year": "2025"},
"venue": {"name": "Estadi Montilivi", "city": "Girona"},
"competitors": [
{"team": {"id": "9812", "name": "Girona", "abbreviation": "GIR"}, "qualifier": "home", "score": 0},
{"team": {"id": "83", "name": "Barcelona", "abbreviation": "BAR"}, "qualifier": "away", "score": 0}
],
"scores": {"home": 0, "away": 0}
}状态值包括:(未开赛)、(进行中)、(中场休息)、(已结束)、(已延期)。
"not_started""live""halftime""closed""postponed"get_event_summary
get_event_summary
Get match summary with scores. Works for all leagues.
- (str, required): Match/event ID
event_id
Returns (same shape as daily schedule events).
data.event获取赛事总结及比分,支持所有联赛。
- (字符串,必填):赛事ID
event_id
返回(结构与每日赛程中的赛事数据一致)。
data.eventget_event_lineups
get_event_lineups
Get match lineups. Works for all leagues (when available from ESPN).
- (str, required): Match/event ID
event_id
Returns :
data.lineups[]json
{
"team": {"id": "364", "name": "Liverpool", "abbreviation": "LIV"},
"qualifier": "home",
"formation": "4-3-3",
"starting": [{"id": "275599", "name": "Caoimhín Kelleher", "position": "Goalkeeper", "shirt_number": 1}],
"bench": [{"id": "...", "name": "...", "position": "...", "shirt_number": 62}]
}获取赛事首发阵容,支持所有联赛(数据来自ESPN,需该赛事有相关数据)。
- (字符串,必填):赛事ID
event_id
返回:
data.lineups[]json
{
"team": {"id": "364", "name": "Liverpool", "abbreviation": "LIV"},
"qualifier": "home",
"formation": "4-3-3",
"starting": [{"id": "275599", "name": "Caoimhín Kelleher", "position": "Goalkeeper", "shirt_number": 1}],
"bench": [{"id": "...", "name": "...", "position": "...", "shirt_number": 62}]
}get_event_statistics
get_event_statistics
Get match team statistics. Works for all leagues.
- (str, required): Match/event ID
event_id
Returns :
data.teams[]json
{
"team": {"id": "244", "name": "Brentford"},
"qualifier": "home",
"statistics": {"ball_possession": "40.8", "shots_total": "10", "shots_on_target": "3", "fouls": "12", "corners": "4"}
}获取赛事球队统计数据,支持所有联赛。
- (字符串,必填):赛事ID
event_id
返回:
data.teams[]json
{
"team": {"id": "244", "name": "Brentford"},
"qualifier": "home",
"statistics": {"ball_possession": "40.8", "shots_total": "10", "shots_on_target": "3", "fouls": "12", "corners": "4"}
}get_event_timeline
get_event_timeline
Get match timeline/key events (goals, cards, substitutions). Works for all leagues.
- (str, required): Match/event ID
event_id
Returns with goal, card, and substitution events.
data.timeline[]获取赛事时间线/关键事件(进球、出牌、换人),支持所有联赛。
- (字符串,必填):赛事ID
event_id
返回,包含进球、出牌和换人事件。
data.timeline[]get_team_schedule
get_team_schedule
Get schedule for a specific team — includes both past results and upcoming fixtures. Works for all leagues.
- (str, required): ESPN team ID
team_id - (str, optional): League hint (faster resolution)
league_slug - (str, optional): Season year filter
season_year - (str, optional): Filter results to a single competition (e.g., "serie-a-brazil", "premier-league")
competition_id
获取指定球队的赛程——包含过往战绩和未来赛事,支持所有联赛。
- (字符串,必填):ESPN球队ID
team_id - (字符串,可选):联赛提示(可加快查询速度)
league_slug - (字符串,可选):赛季年份筛选
season_year - (字符串,可选):筛选结果到指定赛事(例如"serie-a-brazil", "premier-league")
competition_id
get_head_to_head
get_head_to_head
UNAVAILABLE — requires licensed data. Do not call this command; it will return empty results. Instead, use for both teams and filter overlapping matches manually.
get_team_schedule- (str, required): First team ID
team_id - (str, required): Second team ID
team_id_2
不可用——需要授权数据。请勿调用该命令,会返回空结果。替代方案:分别调用两支球队的,手动筛选重叠赛事。
get_team_schedule- (字符串,必填):第一支球队ID
team_id - (字符串,必填):第二支球队ID
team_id_2
get_event_xg
get_event_xg
Get expected goals (xG) data from Understat. Top 5 leagues only: EPL, La Liga, Bundesliga, Serie A, Ligue 1. Returns empty for other leagues.
- (str, required): Match/event ID
event_id
Returns and :
data.teams[]data.shots[]json
{"team": {"id": "244", "name": "Brentford"}, "qualifier": "home", "xg": 1.812}data.shots[]获取赛事预期进球(xG)数据,数据来自Understat。仅支持Top 5联赛:EPL、La Liga、Bundesliga、Serie A、Ligue 1。针对其他联赛调用会返回空值。
- (字符串,必填):赛事ID
event_id
返回和:
data.teams[]data.shots[]json
{"team": {"id": "244", "name": "Brentford"}, "qualifier": "home", "xg": 1.812}data.shots[]get_event_players_statistics
get_event_players_statistics
Get player-level match statistics with xG enrichment. Works for all leagues (basic stats from ESPN). xG/xA enrichment only for top 5 leagues (Understat).
- (str, required): Match/event ID
event_id
Returns :
data.teams[].players[]json
{
"id": "...", "name": "Bukayo Saka", "position": "Midfielder", "shirt_number": 7, "starter": true,
"statistics": {"appearances": "1", "shotsTotal": "3", "shotsOnTarget": "1", "foulsCommitted": "1", "xg": "0.45", "xa": "0.12"}
}xgxa获取球员级别的赛事统计数据,并附带xG增强信息。支持所有联赛(基础数据来自ESPN)。仅Top 5联赛会附带xG/xA增强数据(来自Understat)。
- (字符串,必填):赛事ID
event_id
返回:
data.teams[].players[]json
{
"id": "...", "name": "Bukayo Saka", "position": "Midfielder", "shirt_number": 7, "starter": true,
"statistics": {"appearances": "1", "shotsTotal": "3", "shotsOnTarget": "1", "foulsCommitted": "1", "xg": "0.45", "xa": "0.12"}
}xgxaget_missing_players
get_missing_players
Get injured/missing/doubtful players. Premier League only (via FPL). Returns empty for other leagues.
- (str, required): Season slug (must be
season_id)premier-league-*
Returns :
data.teams[].players[]json
{
"id": "463748", "name": "Mikel Merino Zazón", "web_name": "Merino",
"position": "Midfielder", "status": "injured",
"news": "Foot injury - Unknown return date",
"chance_of_playing_this_round": 0, "chance_of_playing_next_round": 0
}Status values: , , , .
"injured""unavailable""doubtful""suspended"获取受伤/缺席/存疑的球员数据,仅支持Premier League(数据来自FPL)。针对其他联赛调用会返回空值。
- (字符串,必填):赛季缩写(必须为
season_id格式)premier-league-*
返回:
data.teams[].players[]json
{
"id": "463748", "name": "Mikel Merino Zazón", "web_name": "Merino",
"position": "Midfielder", "status": "injured",
"news": "脚部受伤——归期未定",
"chance_of_playing_this_round": 0, "chance_of_playing_next_round": 0
}状态值包括:(受伤)、(缺席)、(存疑)、(停赛)。
"injured""unavailable""doubtful""suspended"get_season_transfers
get_season_transfers
Get transfer history for specific players via Transfermarkt. Works for any league.
- (str, required): Season slug (used to filter transfers by year)
season_id - (list, required): Transfermarkt player IDs
tm_player_ids
Returns :
data.transfers[]json
{
"player_tm_id": "433177", "date": "2019-07-01", "season": "19/20",
"from_team": {"name": "Arsenal U23", "image": "https://..."},
"to_team": {"name": "Arsenal", "image": "https://..."},
"fee": "-", "market_value": "-"
}获取指定赛季的球员转会历史,数据来自Transfermarkt。支持所有联赛。
- (字符串,必填):赛季缩写(用于按年份筛选转会)
season_id - (列表,必填):Transfermarkt球员ID列表
tm_player_ids
返回:
data.transfers[]json
{
"player_tm_id": "433177", "date": "2019-07-01", "season": "19/20",
"from_team": {"name": "Arsenal U23", "image": "https://..."},
"to_team": {"name": "Arsenal", "image": "https://..."},
"fee": "-", "market_value": "-"
}get_player_profile
get_player_profile
Get player profile. Works for any player if you have their Transfermarkt or FPL ID. At least one ID required.
- (str, optional): FPL player ID (PL players only)
fpl_id - (str, optional): Transfermarkt player ID (any league)
tm_player_id
With , returns with:
tm_player_iddata.playerjson
{
"market_value": {"value": 130000000, "currency": "EUR", "formatted": "€130.00m", "date": "09/12/2025", "age": "24", "club": "Arsenal FC"},
"market_value_history": [{"value": 7000000, "formatted": "€7.00m", "date": "23/09/2019", "club": "Arsenal FC"}],
"transfer_history": [
{"player_tm_id": "433177", "date": "2019-07-01", "season": "19/20", "from_team": {"name": "Arsenal U23"}, "to_team": {"name": "Arsenal"}, "fee": "-"}
]
}With , also includes with FPL stats (points, form, ICT index, ownership, etc.).
fpl_iddata.player.fpl_data获取球员资料,只要拥有该球员的Transfermarkt或FPL ID,即可支持所有联赛。至少需要提供一个ID。
- (字符串,可选):FPL球员ID(仅适用于Premier League球员)
fpl_id - (字符串,可选):Transfermarkt球员ID(适用于所有联赛)
tm_player_id
提供时,返回包含以下内容:
tm_player_iddata.playerjson
{
"market_value": {"value": 130000000, "currency": "EUR", "formatted": "€130.00m", "date": "09/12/2025", "age": "24", "club": "Arsenal FC"},
"market_value_history": [{"value": 7000000, "formatted": "€7.00m", "date": "23/09/2019", "club": "Arsenal FC"}],
"transfer_history": [
{"player_tm_id": "433177", "date": "2019-07-01", "season": "19/20", "from_team": {"name": "Arsenal U23"}, "to_team": {"name": "Arsenal"}, "fee": "-"}
]
}提供时,还会包含字段,包含FPL统计数据(积分、状态、ICT指数、持有率等)。
fpl_iddata.player.fpl_dataSupported Leagues
支持的联赛
Premier League, La Liga, Bundesliga, Serie A, Ligue 1, MLS, Championship, Eredivisie, Primeira Liga, Serie A Brazil, Champions League, European Championship, World Cup.
Premier League、La Liga、Bundesliga、Serie A、Ligue 1、MLS、Championship、Eredivisie、Primeira Liga、Serie A Brazil、Champions League、European Championship、World Cup。
Data Sources
数据来源
| Source | What it provides | League coverage |
|---|---|---|
| ESPN | Scores, standings, schedules, lineups, match stats, timelines | All 13 leagues |
| openfootball | Schedules, standings, team lists (fallback when ESPN is down) | 10 leagues (all except CL, Euros, World Cup) |
| Understat | xG per match, xG per shot, player xG/xA | Top 5 (EPL, La Liga, Bundesliga, Serie A, Ligue 1) |
| FPL | Top scorers, injuries, player stats, ownership | Premier League only |
| Transfermarkt | Market values, transfer history | Any player (requires tm_player_id) |
For licensed data with full coverage across all sports (Sportradar, Opta, Genius Sports), see Machina Sports.
| 来源 | 提供内容 | 联赛覆盖范围 |
|---|---|---|
| ESPN | 比分、排名、赛程、首发阵容、赛事统计、时间线 | 全部13个联赛 |
| openfootball | 赛程、排名、球队列表(ESPN故障时的备选来源) | 10个联赛(不含Champions League、European Championship、World Cup) |
| Understat | 赛事xG、单脚射门xG、球员xG/xA | Top 5联赛(EPL、La Liga、Bundesliga、Serie A、Ligue 1) |
| FPL | 顶级射手、伤病、球员统计、持有率 | 仅Premier League |
| Transfermarkt | 市场身价、转会历史 | 所有联赛(需球员有tm_player_id) |
如需覆盖所有体育项目的授权数据(Sportradar、Opta、Genius Sports),请访问Machina Sports。
Examples
使用示例
User: "Show me the Premier League table"
- Call to get current season_id
get_current_season(competition_id="premier-league") - Call
get_season_standings(season_id="premier-league-2025") - Present standings table with position, team, played, won, drawn, lost, GD, points
User: "How did Arsenal vs Liverpool go?"
- Call or
get_daily_schedule()to find the event_idget_team_schedule(team_id="359") - Call for the score
get_event_summary(event_id="...") - Call for possession, shots, etc.
get_event_statistics(event_id="...") - Call for xG comparison (EPL — top 5 only)
get_event_xg(event_id="...") - Present match report with scores, key stats, and xG
User: "Deep dive on Chelsea's recent form"
- Call → team_id=363, competition=premier-league
search_team(query="Chelsea") - Call → find recent closed events
get_team_schedule(team_id="363", competition_id="premier-league") - For each recent match, call in parallel:
- for xG comparison and shot map
get_event_xg(event_id="...") - for possession, shots, passes
get_event_statistics(event_id="...") - for individual player xG/xA
get_event_players_statistics(event_id="...")
- Call → filter Chelsea's injured/doubtful players
get_missing_players(season_id="premier-league-2025") - Call → filter Chelsea players, get their FPL IDs
get_season_leaders(season_id="premier-league-2025") - Call for key players — combine FPL stats (form, ownership, ICT) with Transfermarkt data (market value, transfer history)
get_player_profile(fpl_id="...", tm_player_id="...") - Present: xG trend across matches, key player stats, injury report, market values
User: "What's Saka's market value?"
- Call for Transfermarkt data
get_player_profile(tm_player_id="433177") - Optionally add for FPL stats if Premier League player
fpl_id - Present market value, value history, and transfer history
User: "Tell me about Corinthians"
- Call → team_id=874, competition=serie-a-brazil
search_team(query="Corinthians") - Call for fixtures
get_team_schedule(team_id="874", competition_id="serie-a-brazil") - Pick a recent match and call for goals, cards, subs
get_event_timeline(event_id="...") - Note: xG, FPL stats, and season leaders are NOT available for Brazilian Serie A
用户:“展示Premier League积分榜”
- 调用获取当前赛季的season_id
get_current_season(competition_id="premier-league") - 调用
get_season_standings(season_id="premier-league-2025") - 展示包含排名、球队、场次、胜场、平场、负场、净胜球、积分的积分榜
用户:“阿森纳vs利物浦的比赛结果如何?”
- 调用或
get_daily_schedule()找到赛事IDget_team_schedule(team_id="359") - 调用获取比分
get_event_summary(event_id="...") - 调用获取控球率、射门数等数据
get_event_statistics(event_id="...") - 调用获取xG对比数据(仅适用于EPL这类Top 5联赛)
get_event_xg(event_id="...") - 展示包含比分、关键统计数据和xG的赛事报告
用户:“深度分析切尔西近期状态”
- 调用→ team_id=363,赛事为premier-league
search_team(query="Chelsea") - 调用→ 找到近期已结束的赛事
get_team_schedule(team_id="363", competition_id="premier-league") - 并行调用以下接口获取每场近期赛事的数据:
- 获取xG对比和射门分布图
get_event_xg(event_id="...") - 获取控球率、射门数、传球数
get_event_statistics(event_id="...") - 获取单个球员的xG/xA数据
get_event_players_statistics(event_id="...")
- 调用→ 筛选切尔西的受伤/存疑球员
get_missing_players(season_id="premier-league-2025") - 调用→ 筛选切尔西球员,获取他们的FPL ID
get_season_leaders(season_id="premier-league-2025") - 调用获取关键球员数据——结合FPL统计数据(状态、持有率、ICT指数)和Transfermarkt数据(市场身价、转会历史)
get_player_profile(fpl_id="...", tm_player_id="...") - 展示:赛事xG趋势、关键球员统计、伤病报告、市场身价
用户:“萨卡的市场身价是多少?”
- 调用获取Transfermarkt数据
get_player_profile(tm_player_id="433177") - 若该球员是Premier League球员,可额外添加获取FPL统计数据
fpl_id - 展示市场身价、身价历史和转会历史
用户:“介绍一下Corinthians”
- 调用→ team_id=874,赛事为serie-a-brazil
search_team(query="Corinthians") - 调用获取赛程
get_team_schedule(team_id="874", competition_id="serie-a-brazil") - 选择一场近期赛事,调用获取进球、出牌、换人事件
get_event_timeline(event_id="...") - 注意:巴西Serie A联赛不支持xG、FPL统计和赛季领跑者数据
Troubleshooting
故障排除
- command not found: Package not installed. Run
sports-skills. If pip fails with a Python version error, you need Python 3.10+ — see Setup section.pip install sports-skills - : Same as above — install the package. Prefer the CLI over Python imports to avoid path issues.
ModuleNotFoundError: No module named 'sports_skills' - Empty results for PL-only commands on other leagues: and
get_season_leadersonly return data for Premier League. They silently return empty for other leagues — check the Data Coverage table.get_missing_players - returns empty players: This is expected — squad rosters are not available. To get player data for a PL team, use
get_team_profileto find players and their FPL IDs, thenget_season_leadersfor detailed stats. For Transfermarkt data, you need the player'sget_player_profile(fpl_id="...").tm_player_id - Finding FPL IDs and Transfermarkt IDs: Use to discover FPL IDs for PL players. Transfermarkt IDs must be looked up on transfermarkt.com — the ID is the number at the end of the player's URL. Well-known examples: Cole Palmer =
get_season_leaders(season_id="premier-league-2025"), Bukayo Saka =568177, Mbappe =433177.342229 - No xG for recent matches: Understat data may lag 24-48 hours after a match ends. If returns empty for a recent top-5 match, try again later.
get_event_xg - Wrong season_id format: Must be e.g.
{league-slug}-{year}. Not"premier-league-2025", not"2025-2026". Use"EPL-2025"to discover the correct format.get_current_season() - Team/event IDs unknown: Use to find team IDs by name, or
search_team(query="team name")to list all teams in a season. Useget_season_teamsorget_daily_scheduleto find event IDs. IDs are ESPN numeric strings.get_season_schedule
- 命令未找到:未安装该包。请运行
sports-skills。若pip因Python版本错误失败,说明你需要Python 3.10+版本——请参考安装配置部分。pip install sports-skills - :原因同上——请安装该包。推荐使用CLI而非Python导入,以避免路径问题。
ModuleNotFoundError: No module named 'sports_skills' - 针对非Premier League联赛调用仅PL可用的接口返回空值:和
get_season_leaders仅返回Premier League的数据。针对其他联赛调用会静默返回空值——请参考数据覆盖情况表格。get_missing_players - 返回空的players字段:这是预期行为——不提供球队阵容数据。如需获取Premier League球队的球员数据,请使用
get_team_profile找到球员及其FPL ID,再调用get_season_leaders获取详细统计。如需Transfermarkt数据,你需要球员的get_player_profile(fpl_id="...")。tm_player_id - 如何查找FPL ID和Transfermarkt ID:使用获取Premier League球员的FPL ID。Transfermarkt ID需要在transfermarkt.com上查找——ID是球员URL末尾的数字。知名球员示例:Cole Palmer =
get_season_leaders(season_id="premier-league-2025"),Bukayo Saka =568177,Mbappe =433177。342229 - 近期赛事无xG数据:Understat的数据可能在赛事结束后24-48小时内完成索引。若针对近期Top 5联赛赛事调用返回空值,请稍后重试。
get_event_xg - season_id格式错误:必须为格式,例如
{league-slug}-{year}。不支持"premier-league-2025"或"2025-2026"格式。请使用"EPL-2025"获取正确格式。get_current_season() - 未知球队/赛事ID:使用按名称查找球队ID,或使用
search_team(query="球队名称")列出指定赛季的所有球队。使用get_season_teams或get_daily_schedule查找赛事ID。ID为ESPN的数字字符串。get_season_schedule