Skip to content

Soccer

League tables, scores, match events, xG and player statistics for 200+ competitions as SQL

Connector software
Free and open source
Service credentials
Not needed
Use with an agent

Install the Orchard skill in your project to help your agent find connectors, configure them, and verify SQL results.

npx skills add Query-farm/vgi-skills --skill orchard

Copy this request into your coding agent to get started.

Use https://query.farm/products/orchard/connectors/soccer/index.md to help me query Soccer with DuckDB or Haybarn 2.0.1 and VGI protocol 3.4. Ask only for missing details about the result I need or whether I want local execution, self-hosting or Query Farm hosting. Check the connector's actual hosting availability, credentials and input requirements. Read one format of each needed reference and the exact object declarations before writing SQL. Use a released connector, and distinguish a saved example result from anything you actually execute. If you cannot run the query, tell me what remains to verify.

leicester_2015_title

Example output Β· captured
Connector release
v0.3.1
Engine
2.0.1
VGI protocol
3.4.0
SELECT team_name, points
FROM soccer.main.standings(league := 'eng.1', season := 2015)
WHERE rank = 1;
Result
team_name points
Leicester City 81

Quick start

Choose where to run Soccer, then follow the steps below.

The connector runs alongside DuckDB or Haybarn. No Query Farm account is needed.

1. Install the vgi extension

Run this in your SQL client. On DuckDB, keep FROM query_farm on LOAD in later sessions.

setup.sql
SET allow_extension_repositories = 'allowed';

CREATE EXTENSION REPOSITORY IF NOT EXISTS query_farm
    WITH PREFIX 'https://duckdb-extensions.query.farm';

INSTALL vgi FROM query_farm;
LOAD vgi FROM query_farm;

2. Attach the connector

Attach with uvx

Needs uv. uvx builds the worker from its release tag on first attach and reuses the cached environment after that.

ATTACH 'soccer' AS soccer (
  TYPE vgi,
  LOCATION 'uvx --from git+https://github.com/Query-farm/[email protected] vgi-soccer'
);

3. Run a query

query.sql
SELECT team_name, points
FROM soccer.main.standings(league := 'eng.1', season := 2015)
WHERE rank = 1;
More example queries β†’
Technical details
Verified connector release
v0.3.1
Engine
2.0.1
VGI protocol
3.4.0
Verified on
December 1, 2026
Release notes on GitHub
Pin a version for production

When running the connector yourself, keep a specific release until you’re ready to upgrade. Replace the ATTACH statement above with this one and follow the same extension and credential setup.

Attach with uvx

Needs uv. uvx builds the worker from its release tag on first attach and reuses the cached environment after that.

ATTACH 'soccer' AS soccer (
  TYPE vgi,
  LOCATION 'uvx --from git+https://github.com/Query-farm/[email protected] vgi-soccer'
);

Overview

Read-only world football data: league tables, fixtures, results, match detail and player statistics from ESPN, plus open World Cup (openfootball) and German league (OpenLigaDB) data

Catalog

Everything soccer exposes once attached β€” read straight from the worker's released build.

soccer 1 schema
main 4 tables Β· 22 functions

World football league tables, matches, match detail, players and open history

Schema examples (6)
Examples (6)

The current Premier League table.

SELECT rank, team_name, games_played, goal_difference, points
FROM soccer.main.current_standings
WHERE league_slug = 'eng.1'
ORDER BY rank;

Leaders of each big-five league.

SELECT league_name, team_name, points
FROM soccer.main.current_standings
WHERE rank = 1
ORDER BY points DESC;

2023-24 Premier League top ten scorers with their club's final league position and points, joining stat_leaders to standings on team_id.

SELECT l.rank, l.player_name, l.team_name, l.goals, s.rank AS team_rank,
  s.points
FROM soccer.main.stat_leaders(league := 'eng.1', season := 2023) AS l
JOIN soccer.main.standings(league := 'eng.1', season := 2023) AS s USING (team_id)
WHERE l.category = 'goals'
ORDER BY l.rank, l.player_name
LIMIT 10;

Top ten players by shot xG in Manchester United 4-4 Aston Villa, with their shots and goals, joining match_plays to match_player_stats on athlete_id.

WITH shot_xg AS (SELECT athlete_id, count(*) AS shots, round(sum(expected_goals), 2) AS xg FROM soccer.main.match_plays(401879240) WHERE expected_goals IS NOT NULL GROUP BY athlete_id) SELECT p.team_name, p.player_name, x.shots, x.xg, p.goals
FROM soccer.main.match_player_stats(401879240) AS p
JOIN shot_xg AS x USING (athlete_id)
ORDER BY x.xg DESC, p.player_name
LIMIT 10;
2 more examples

2018 World Cup knockout results after extra time, with shoot-out scores and every goal scorer in minute order (own goals marked), joining world_cup_matches to world_cup_goals.

SELECT m.round, m.team1,
  coalesce(m.team1_extra_time, m.team1_goals) AS team1_score,
  coalesce(m.team2_extra_time, m.team2_goals) AS team2_score, m.team2,
  m.team1_penalties, m.team2_penalties,
  string_agg(g.player_name || ' ' || g.minute_display || CASE WHEN g.own_goal THEN ' (og)' ELSE '' END, ', ' ORDER BY g.minute, g.stoppage_minute) AS scorers
FROM soccer.main.world_cup_matches(2018) AS m
LEFT JOIN soccer.main.world_cup_goals(2018) AS g ON g.round = m.round AND g.team IN (m.team1, m.team2) AND g.opponent IN (m.team1, m.team2)
WHERE m.group_name IS NULL
GROUP BY ALL
ORDER BY min(m.match_number);

Bundesliga matchday 10 of 2025-26 with each club's final 2025-26 table position, joining bundesliga_matches to bundesliga_table on team_id for home and away side.

SELECT m.team1_name, h.position AS team1_position, m.team1_goals,
  m.team2_goals, m.team2_name, a.position AS team2_position
FROM soccer.main.bundesliga_matches(2025, matchday := 10) AS m
JOIN soccer.main.bundesliga_table(2025) AS h ON h.team_id = m.team1_id
JOIN soccer.main.bundesliga_table(2025) AS a ON a.team_id = m.team2_id
ORDER BY least(h.position, a.position);
Tables
current_matches 1 example26 cols

Today's matches across every ESPN-covered competition, one row per match

Columns
event_idnot null BIGINT
ESPN match identifier (opaque integer); pass it to the match_* functions.
league_slug VARCHAR
ESPN league slug, e.g. eng.1.
league_name VARCHAR
Competition name.
season INTEGER
Season start year (2025 = 2025-26).
kickoff TIMESTAMP WITH TIME ZONE
Scheduled kick-off time in UTC.
match_name VARCHAR
Fixture label, e.g. Arsenal at Liverpool.
state VARCHAR
pre (scheduled), in (live), or post (finished).
status VARCHAR
ESPN status, e.g. STATUS_FULL_TIME or STATUS_POSTPONED.
status_detail VARCHAR
Short status text, e.g. FT or 63'.
completed BOOLEAN
Whether the match is finished.
home_team_id INTEGER
Home team ESPN identifier (opaque integer).
home_team_name VARCHAR
Home side display name, e.g. Manchester United.
home_team_abbreviation VARCHAR
Home side three-letter code, e.g. MAN.
home_score INTEGER
Number of goals scored by the home side; null before kick-off.
away_team_id INTEGER
Away team ESPN identifier (opaque integer).
away_team_name VARCHAR
Away side display name, e.g. Aston Villa.
away_team_abbreviation VARCHAR
Away side three-letter code, e.g. AVL.
away_score INTEGER
Number of goals scored by the away side; null before kick-off.
home_shootout_score INTEGER
Number of home penalties scored in a shoot-out, when one was played.
away_shootout_score INTEGER
Number of away penalties scored in a shoot-out, when one was played.
winner VARCHAR
home, away, or draw once finished; null otherwise.
venue_name VARCHAR
Stadium name.
venue_city VARCHAR
Stadium city.
venue_country VARCHAR
Stadium country.
attendance INTEGER
Number of spectators reported (null when unknown).
note VARCHAR
Round or stage note, e.g. League Phase.
ConstraintsPRIMARY KEY (event_id)
Example

Matches being played right now.

SELECT league_name, home_team_name, home_score, away_score, away_team_name,
  status_detail
FROM soccer.main.current_matches
WHERE state = 'in'
ORDER BY league_name;
Link
current_standings 2 examples21 cols

Current big-five European league tables, one row per team

Columns
league_slugnot null VARCHAR
ESPN league slug, e.g. eng.1.
league_name VARCHAR
Competition name.
season INTEGER
Season start year; 2015 is the 2015-16 season.
season_name VARCHAR
Season label, e.g. 2015-16 Barclays Premier League.
group_name VARCHAR
Table or group, e.g. Group A or League Phase.
rank INTEGER
Table position (1 = top) within the table or group.
team_idnot null INTEGER
ESPN team identifier (opaque integer; key for roster() and team_schedule()).
team_name VARCHAR
Team display name as ESPN shows it, e.g. Leicester City.
team_abbreviation VARCHAR
Three-letter team code, e.g. LEI.
games_played INTEGER
Number of matches played.
wins INTEGER
Number of matches won.
draws INTEGER
Number of matches drawn.
losses INTEGER
Number of matches lost.
goals_for INTEGER
Number of goals scored.
goals_against INTEGER
Number of goals conceded.
goal_difference INTEGER
Goal difference: goals for minus goals against (count).
points INTEGER
League points (3 per win, 1 per draw) after any deductions.
point_deductions INTEGER
Number of points deducted by the competition (0 when none).
rank_change INTEGER
Number of places gained (+) or lost (-) since the last round.
record VARCHAR
ESPN W-D-L summary.
qualification VARCHAR
Zone note, e.g. Champions League or Relegation.
ConstraintsPRIMARY KEY (league_slug, team_id)
Examples (2)

The current Premier League table.

SELECT rank, team_name, games_played, goal_difference, points
FROM soccer.main.current_standings
WHERE league_slug = 'eng.1'
ORDER BY rank;

Leaders of each big-five league.

SELECT league_name, team_name, points
FROM soccer.main.current_standings
WHERE rank = 1
ORDER BY points DESC;
Link
current_stat_leaders 1 example13 cols

Current big-five goals and assists leaderboards, one row per player per board

Columns
league_slugnot null VARCHAR
ESPN league slug.
season INTEGER
Season start year (2015 = 2015-16).
categorynot null VARCHAR
Leaderboard: goals or assists.
ranknot null INTEGER
Position (1 = best) in ESPN's ordered leaderboard.
athlete_id BIGINT
ESPN player identifier (opaque integer).
player_name VARCHAR
Player display name, e.g. Harry Kane.
team_id INTEGER
ESPN team identifier (opaque integer).
team_name VARCHAR
Club or national team display name.
team_abbreviation VARCHAR
Three-letter team code, e.g. LEI.
value INTEGER
Leaderboard value: number of goals or assists, per category.
matches INTEGER
Number of matches played.
goals INTEGER
Number of goals scored.
assists INTEGER
Number of assists (passes leading directly to a goal).
ConstraintsPRIMARY KEY (league_slug, category, rank)
Example

Premier League top ten scorers this season.

SELECT rank, player_name, team_name, goals, matches
FROM soccer.main.current_stat_leaders
WHERE league_slug = 'eng.1' AND category = 'goals'
ORDER BY rank
LIMIT 10;
Link
leagues 1 example7 cols

Every soccer competition ESPN covers, one row per league slug

Columns
league_slugnot null VARCHAR
ESPN league slug used by every league argument, e.g. eng.1.
espn_league_id INTEGER
ESPN numeric league identifier (an opaque integer, also embedded in event uids).
league_name VARCHAR
Full competition name.
abbreviation VARCHAR
ESPN abbreviation.
short_name VARCHAR
Short competition name.
midsize_name VARCHAR
Mid-length label such as ENG.1.
has_standings BOOLEAN
Whether ESPN publishes a league table for it.
ConstraintsPRIMARY KEY (league_slug)
Example

Find the slug for a competition by name.

SELECT league_slug, league_name
FROM soccer.main.leagues
WHERE league_name ILIKE '%women%'
ORDER BY league_slug;
Link
Table functions
all_current_matches () 1 example

Today's matches in every ESPN-covered competition

No arguments
Returns columns
event_id BIGINT
ESPN match identifier (opaque integer); pass it to the match_* functions
league_slug VARCHAR
ESPN league slug, e.g. eng.1
league_name VARCHAR
Competition name
season INTEGER
Season start year (2025 = 2025-26)
kickoff TIMESTAMP WITH TIME ZONE
Scheduled kick-off time in UTC
match_name VARCHAR
Fixture label, e.g. Arsenal at Liverpool
state VARCHAR
pre (scheduled), in (live), or post (finished)
status VARCHAR
ESPN status, e.g. STATUS_FULL_TIME or STATUS_POSTPONED
status_detail VARCHAR
Short status text, e.g. FT or 63'
completed BOOLEAN
Whether the match is finished
home_team_id INTEGER
Home team ESPN identifier (opaque integer)
home_team_name VARCHAR
Home side display name, e.g. Manchester United
home_team_abbreviation VARCHAR
Home side three-letter code, e.g. MAN
home_score INTEGER
Number of goals scored by the home side; null before kick-off
away_team_id INTEGER
Away team ESPN identifier (opaque integer)
away_team_name VARCHAR
Away side display name, e.g. Aston Villa
away_team_abbreviation VARCHAR
Away side three-letter code, e.g. AVL
away_score INTEGER
Number of goals scored by the away side; null before kick-off
home_shootout_score INTEGER
Number of home penalties scored in a shoot-out, when one was played
away_shootout_score INTEGER
Number of away penalties scored in a shoot-out, when one was played
winner VARCHAR
home, away, or draw once finished; null otherwise
venue_name VARCHAR
Stadium name
venue_city VARCHAR
Stadium city
venue_country VARCHAR
Stadium country
attendance INTEGER
Number of spectators reported (null when unknown)
note VARCHAR
Round or stage note, e.g. League Phase
Example

Today's matches in every competition, with live and final scores.

SELECT league_name, home_team_name, home_score, away_score, away_team_name,
  status_detail
FROM soccer.main.all_current_matches()
ORDER BY kickoff;
Link
all_current_standings () 1 example

Current Premier League, La Liga, Bundesliga, Serie A and Ligue 1 tables

No arguments
Returns columns
league_slug VARCHAR
ESPN league slug, e.g. eng.1
league_name VARCHAR
Competition name
season INTEGER
Season start year; 2015 is the 2015-16 season
season_name VARCHAR
Season label, e.g. 2015-16 Barclays Premier League
group_name VARCHAR
Table or group, e.g. Group A or League Phase
rank INTEGER
Table position (1 = top) within the table or group
team_id INTEGER
ESPN team identifier (opaque integer; key for roster() and team_schedule())
team_name VARCHAR
Team display name as ESPN shows it, e.g. Leicester City
team_abbreviation VARCHAR
Three-letter team code, e.g. LEI
games_played INTEGER
Number of matches played
wins INTEGER
Number of matches won
draws INTEGER
Number of matches drawn
losses INTEGER
Number of matches lost
goals_for INTEGER
Number of goals scored
goals_against INTEGER
Number of goals conceded
goal_difference INTEGER
Goal difference: goals for minus goals against (count)
points INTEGER
League points (3 per win, 1 per draw) after any deductions
point_deductions INTEGER
Number of points deducted by the competition (0 when none)
rank_change INTEGER
Number of places gained (+) or lost (-) since the last round
record VARCHAR
ESPN W-D-L summary
qualification VARCHAR
Zone note, e.g. Champions League or Relegation
Example

Current leaders of the big-five European leagues.

SELECT league_name, team_name, points
FROM soccer.main.all_current_standings()
WHERE rank = 1
ORDER BY league_slug;
Link
all_current_stat_leaders () 1 example

Current goals and assists leaders in the big-five European leagues

No arguments
Returns columns
league_slug VARCHAR
ESPN league slug
season INTEGER
Season start year (2015 = 2015-16)
category VARCHAR
Leaderboard: goals or assists
rank INTEGER
Position (1 = best) in ESPN's ordered leaderboard
athlete_id BIGINT
ESPN player identifier (opaque integer)
player_name VARCHAR
Player display name, e.g. Harry Kane
team_id INTEGER
ESPN team identifier (opaque integer)
team_name VARCHAR
Club or national team display name
team_abbreviation VARCHAR
Three-letter team code, e.g. LEI
value INTEGER
Leaderboard value: number of goals or assists, per category
matches INTEGER
Number of matches played
goals INTEGER
Number of goals scored
assists INTEGER
Number of assists (passes leading directly to a goal)
Example

Current top scorer in each big-five league.

SELECT league_slug, player_name, team_name, goals
FROM soccer.main.all_current_stat_leaders()
WHERE category = 'goals' AND rank = 1
ORDER BY league_slug;
Link
all_leagues () 1 example

Every soccer competition ESPN covers (scan behind the leagues table)

No arguments
Returns columns
league_slug VARCHAR
ESPN league slug used by every league argument, e.g. eng.1
espn_league_id INTEGER
ESPN numeric league identifier (an opaque integer, also embedded in event uids)
league_name VARCHAR
Full competition name
abbreviation VARCHAR
ESPN abbreviation
short_name VARCHAR
Short competition name
midsize_name VARCHAR
Mid-length label such as ENG.1
has_standings BOOLEAN
Whether ESPN publishes a league table for it
Example

Find the slug for any competition by name.

SELECT league_slug, league_name
FROM soccer.main.all_leagues()
WHERE league_name ILIKE '%champions%'
ORDER BY league_slug;
Link
bundesliga_matches (season INTEGER, league := VARCHAR, matchday := INTEGER) 2 examples

German league or DFB-Pokal matches from OpenLigaDB, per matchday or season

Positional arguments
season INTEGER
Season start year.
Named arguments
league := VARCHAR
OpenLigaDB shortcut: bl1 Bundesliga, bl2 2. Bundesliga, bl3 3. Liga, fbl1 Frauen-Bundesliga, dfb DFB-Pokal. Β· default "bl1"
matchday := INTEGER
Matchday (Spieltag) or cup round; NULL returns the whole season. Β· default null
Returns columns
match_id INTEGER
OpenLigaDB match identifier (opaque integer)
league VARCHAR
OpenLigaDB league shortcut
league_name VARCHAR
Competition name
season INTEGER
Season start year (2025 = 2025-26)
matchday INTEGER
Matchday (Spieltag) or cup round number (1 = first)
matchday_name VARCHAR
Matchday label, e.g. 10. Spieltag
kickoff TIMESTAMP WITH TIME ZONE
Kick-off time in UTC
team1_id INTEGER
Home team OpenLigaDB identifier (opaque integer)
team1_name VARCHAR
Home side display name, e.g. Manchester United
team2_id INTEGER
Away team OpenLigaDB identifier (opaque integer)
team2_name VARCHAR
Away side display name, e.g. Aston Villa
team1_goals INTEGER
Number of home goals at full time
team2_goals INTEGER
Number of away goals at full time
team1_halftime INTEGER
Number of home goals at half-time
team2_halftime INTEGER
Number of away goals at half-time
finished BOOLEAN
Whether the match is finished
viewers INTEGER
Number of spectators, when a contributor recorded it (rarely; usually null)
Examples (2)

Bundesliga matchday 10 of 2025-26 with half-time and full-time scores.

SELECT kickoff, team1_name, team1_goals, team2_goals, team2_name,
  team1_halftime, team2_halftime
FROM soccer.main.bundesliga_matches(2025, matchday := 10)
ORDER BY kickoff;

Bundesliga matchday 10 of 2025-26 with each club's final 2025-26 table position, joining bundesliga_matches to bundesliga_table on team_id for home and away side.

SELECT m.team1_name, h.position AS team1_position, m.team1_goals,
  m.team2_goals, m.team2_name, a.position AS team2_position
FROM soccer.main.bundesliga_matches(2025, matchday := 10) AS m
JOIN soccer.main.bundesliga_table(2025) AS h ON h.team_id = m.team1_id
JOIN soccer.main.bundesliga_table(2025) AS a ON a.team_id = m.team2_id
ORDER BY least(h.position, a.position);
Link
bundesliga_table (season INTEGER, league := VARCHAR) 1 example

German league table from the OpenLigaDB community database

Positional arguments
season INTEGER
Season start year.
Named arguments
league := VARCHAR
OpenLigaDB shortcut: bl1 Bundesliga, bl2 2. Bundesliga, bl3 3. Liga, fbl1 Frauen-Bundesliga. Β· default "bl1"
Returns columns
league VARCHAR
OpenLigaDB league shortcut, e.g. bl1
season INTEGER
Season start year (2025 = 2025-26)
position INTEGER
Table position (1 = top)
team_id INTEGER
OpenLigaDB team identifier (opaque integer)
team_name VARCHAR
Club or national team display name
short_name VARCHAR
Short team name
matches INTEGER
Number of matches played
wins INTEGER
Number of matches won
draws INTEGER
Number of matches drawn
losses INTEGER
Number of matches lost
goals_for INTEGER
Number of goals scored
goals_against INTEGER
Number of goals conceded
goal_difference INTEGER
Goal difference: goals for minus goals against (count)
points INTEGER
League points (3 per win, 1 per draw)
Example

The 2025-26 Bundesliga table from OpenLigaDB.

SELECT position, team_name, matches, wins, draws, losses, goal_difference,
  points
FROM soccer.main.bundesliga_table(2025)
ORDER BY position;
Link
match_commentary (event_id BIGINT) 1 example

Minute-by-minute text commentary for a match

Arguments
event_id BIGINT
ESPN match id (event_id) from scoreboard(), schedule() or team_schedule().
Returns columns
event_id BIGINT
ESPN match identifier (opaque integer)
sequence INTEGER
Order within the commentary (0 = first line)
clock_seconds INTEGER
Match clock in seconds since kick-off
clock_display VARCHAR
Displayed minute
text VARCHAR
Commentary text
play_id BIGINT
Linked ESPN play identifier (opaque integer), when the line describes a play
play_type VARCHAR
Linked play type slug
Example

The first ten commentary lines.

SELECT clock_display, text
FROM soccer.main.match_commentary(401879240)
ORDER BY sequence
LIMIT 10;
Link
match_key_events (event_id BIGINT) 1 example

Goals, cards and substitutions for a match in order

Arguments
event_id BIGINT
ESPN match id (event_id) from scoreboard(), schedule() or team_schedule().
Returns columns
event_id BIGINT
ESPN match identifier (opaque integer)
sequence INTEGER
Order within the match (1 = first)
key_event_id BIGINT
ESPN play identifier (opaque integer)
event_type VARCHAR
Type slug, e.g. goal, yellow-card, substitution
event_type_text VARCHAR
Type label, e.g. Goal
period INTEGER
Match period number (1-2 halves, 3-4 extra time, 5 shoot-out)
clock_seconds INTEGER
Match clock in seconds since kick-off. ESPN holds it at the end of the period during stoppage time (5400 for every 90'+N event); use clock_display for added minutes
clock_display VARCHAR
Displayed minute, e.g. 45'+2'
scoring_play BOOLEAN
Whether a goal was scored
team_id INTEGER
Team ESPN identifier (opaque integer)
team_name VARCHAR
Club or national team display name
athlete_id BIGINT
ESPN identifier of the primary player (scorer, booked player, or incoming substitute)
player_name VARCHAR
Primary player name
secondary_athlete_id BIGINT
ESPN identifier of the second player (assister or outgoing substitute)
secondary_player_name VARCHAR
Second player name
text VARCHAR
ESPN description
wallclock TIMESTAMP WITH TIME ZONE
Real-world UTC time of the event
Example

Every goal in order with scorer and assister.

SELECT clock_display, team_name, player_name, secondary_player_name,
  event_type
FROM soccer.main.match_key_events(401879240)
WHERE scoring_play
ORDER BY sequence;
Link
match_player_stats (event_id BIGINT) 1 example

Line-ups and per-player statistics for a match

Arguments
event_id BIGINT
ESPN match id (event_id) from scoreboard(), schedule() or team_schedule().
Returns columns
event_id BIGINT
ESPN match identifier (opaque integer)
team_id INTEGER
ESPN team identifier (opaque integer)
team_name VARCHAR
Club or national team display name
home_away VARCHAR
home or away
athlete_id BIGINT
ESPN player identifier (opaque integer)
player_name VARCHAR
Player display name, e.g. Harry Kane
jersey VARCHAR
Shirt number
position VARCHAR
Position played
position_abbreviation VARCHAR
Position code
starter BOOLEAN
Started the match
subbed_in BOOLEAN
Came on as a substitute
subbed_out BOOLEAN
Was substituted off
formation_place INTEGER
Formation slot index (1 = goalkeeper; 0 for substitutes)
goals INTEGER
Number of goals
assists INTEGER
Number of assists
shots INTEGER
Number of shots
shots_on_target INTEGER
Number of shots on target
fouls_committed INTEGER
Number of fouls committed
fouls_suffered INTEGER
Number of fouls suffered
offsides INTEGER
Number of offsides
yellow_cards INTEGER
Number of yellow cards
red_cards INTEGER
Number of red cards
own_goals INTEGER
Number of own goals
saves INTEGER
Number of saves
goals_conceded INTEGER
Number of goals conceded
Example

Goal scorers and assisters in the match.

SELECT team_name, player_name, goals, assists, shots
FROM soccer.main.match_player_stats(401879240)
WHERE goals > 0 OR assists > 0
ORDER BY goals DESC, assists DESC;
Link
match_plays (event_id BIGINT) 2 examples

Every on-ball action in a match, with expected goals for shots

Arguments
event_id BIGINT
ESPN match id (event_id) from scoreboard(), schedule() or team_schedule().
Returns columns
event_id BIGINT
ESPN match identifier (opaque integer)
sequence INTEGER
Order within the match (1 = first)
play_id BIGINT
ESPN play identifier (opaque integer)
play_type VARCHAR
Type slug, e.g. pass, shot-on-target, goal
play_type_text VARCHAR
Type label
period INTEGER
Match period number (1-2 halves, 3-4 extra time, 5 shoot-out)
clock_seconds INTEGER
Match clock in seconds since kick-off. ESPN holds it at the end of the period during stoppage time (5400 for every 90'+N event); use clock_display for added minutes
clock_display VARCHAR
Displayed minute
team_id INTEGER
ESPN identifier of the acting team (opaque integer)
athlete_id BIGINT
ESPN identifier of the first participant (opaque integer)
participant_role VARCHAR
First participant's role, e.g. shooter
home_score INTEGER
Number of home goals after the play
away_score INTEGER
Number of away goals after the play
scoring_play BOOLEAN
Whether a goal was scored
expected_goals DOUBLE
Expected goals (probability 0-1) of the shot, when the play is a shot
expected_goals_on_target DOUBLE
Post-shot expected goals (probability 0-1) for on-target shots
field_x DOUBLE
Start x coordinate in percent of pitch length (about 0-100, attacking right; ESPN occasionally reports values just outside that range)
field_y DOUBLE
Start y coordinate in percent of pitch width (about 0-100)
text VARCHAR
ESPN description
wallclock TIMESTAMP WITH TIME ZONE
Real-world UTC time of the play
Examples (2)

Shots with expected goals (xG), biggest chances first.

SELECT clock_display, play_type, expected_goals, text
FROM soccer.main.match_plays(401879240)
WHERE expected_goals IS NOT NULL
ORDER BY expected_goals DESC
LIMIT 10;

Top ten players by shot xG in Manchester United 4-4 Aston Villa, with their shots and goals, joining match_plays to match_player_stats on athlete_id.

WITH shot_xg AS (SELECT athlete_id, count(*) AS shots, round(sum(expected_goals), 2) AS xg FROM soccer.main.match_plays(401879240) WHERE expected_goals IS NOT NULL GROUP BY athlete_id) SELECT p.team_name, p.player_name, x.shots, x.xg, p.goals
FROM soccer.main.match_player_stats(401879240) AS p
JOIN shot_xg AS x USING (athlete_id)
ORDER BY x.xg DESC, p.player_name
LIMIT 10;
Link
match_summary (event_id BIGINT) 1 example

One-row header for a match: teams, score, formations, venue, attendance

Arguments
event_id BIGINT
ESPN match id (event_id) from scoreboard(), schedule() or team_schedule().
Returns columns
event_id BIGINT
ESPN match identifier (opaque integer)
league_slug VARCHAR
ESPN league slug
league_name VARCHAR
Competition name
season INTEGER
Season start year (2025 = 2025-26)
kickoff TIMESTAMP WITH TIME ZONE
Kick-off time in UTC
state VARCHAR
pre, in, or post
status VARCHAR
ESPN status name
status_detail VARCHAR
Short status text, e.g. FT
completed BOOLEAN
Whether the match is finished
home_team_id INTEGER
Home team ESPN identifier (opaque integer)
home_team_name VARCHAR
Home side display name, e.g. Manchester United
home_score INTEGER
Number of goals scored by the home side
home_formation VARCHAR
Home starting formation, e.g. 4-2-3-1
home_record VARCHAR
Home team's W-D-L record after the match
away_team_id INTEGER
Away team ESPN identifier (opaque integer)
away_team_name VARCHAR
Away side display name, e.g. Aston Villa
away_score INTEGER
Number of goals scored by the away side
away_formation VARCHAR
Away starting formation
away_record VARCHAR
Away team's W-D-L record after the match
venue_name VARCHAR
Stadium name
venue_city VARCHAR
Stadium city
attendance INTEGER
Number of spectators reported (null when unknown)
neutral_site BOOLEAN
Whether the match was at a neutral venue
Example

Header for Manchester United v Aston Villa (event 401879240).

SELECT home_team_name, home_score, away_score, away_team_name,
  home_formation, away_formation, venue_name, attendance
FROM soccer.main.match_summary(401879240);
Link
match_team_stats (event_id BIGINT) 1 example

Team box score for a match: possession, shots, passes, tackles, cards

Arguments
event_id BIGINT
ESPN match id (event_id) from scoreboard(), schedule() or team_schedule().
Returns columns
event_id BIGINT
ESPN match identifier (opaque integer)
team_id INTEGER
ESPN team identifier (opaque integer)
team_name VARCHAR
Club or national team display name
home_away VARCHAR
home or away
possession_pct DECIMAL(4,1)
Ball possession in percent (both sides sum to 100)
shots INTEGER
Number of shots
shots_on_target INTEGER
Number of shots on target
blocked_shots INTEGER
Number of blocked shots
corners INTEGER
Number of corners
offsides INTEGER
Number of offsides
fouls INTEGER
Number of fouls
yellow_cards INTEGER
Number of yellow cards
red_cards INTEGER
Number of red cards
saves INTEGER
Number of saves
passes INTEGER
Number of passes
accurate_passes INTEGER
Number of accurate passes
crosses INTEGER
Number of crosses
accurate_crosses INTEGER
Number of accurate crosses
long_balls INTEGER
Number of long balls
accurate_long_balls INTEGER
Number of accurate long balls
tackles INTEGER
Number of tackles
effective_tackles INTEGER
Number of effective tackles
interceptions INTEGER
Number of interceptions
clearances INTEGER
Number of clearances
effective_clearances INTEGER
Number of effective clearances
Example

Possession, shots and passing for both sides.

SELECT team_name, possession_pct, shots, shots_on_target, corners, passes,
  accurate_passes
FROM soccer.main.match_team_stats(401879240);
Link
player_stats (athlete_id BIGINT, league := VARCHAR) 1 example

One player's recent season totals in a competition

Positional arguments
athlete_id BIGINT
ESPN player id, from roster(), stat_leaders() or match data.
Named arguments
league := VARCHAR
Competition to report; NULL selects the player's main league. ESPN league slug, e.g. eng.1 (Premier League), esp.1, ger.1, ita.1, fra.1, uefa.champions, fifa.world. List every slug with SELECT league_slug FROM soccer.main.leagues. Β· default null
Returns columns
athlete_id BIGINT
ESPN player identifier (opaque integer)
league_slug VARCHAR
ESPN league slug of this season line
season INTEGER
Season start year (2025 = 2025-26)
season_name VARCHAR
Season label
team_id INTEGER
ESPN team id the line belongs to
team_name VARCHAR
Club or national team display name
starts INTEGER
Number of matches started
goals INTEGER
Number of goals scored
assists INTEGER
Number of assists (passes leading directly to a goal)
shots INTEGER
Number of shots attempted
shots_on_target INTEGER
Number of shots on target
fouls_committed INTEGER
Number of fouls committed
fouls_suffered INTEGER
Number of fouls suffered
offsides INTEGER
Number of times caught offside
yellow_cards INTEGER
Number of yellow cards
red_cards INTEGER
Number of red cards
clean_sheets INTEGER
Number of clean sheets kept as goalkeeper
saves INTEGER
Number of saves made as goalkeeper
goals_conceded INTEGER
Number of goals conceded as goalkeeper
Example

Erling Haaland's (athlete 253989) Premier League seasons.

SELECT season, team_name, starts, goals, assists, shots_on_target
FROM soccer.main.player_stats(253989, league := 'eng.1')
ORDER BY season;
Link
roster (team_id BIGINT, league := VARCHAR) 1 example

A team's current squad with positions, ages and nationalities

Positional arguments
team_id BIGINT
ESPN team id, from soccer.main.teams() or standings().
Named arguments
league := VARCHAR
ESPN league slug, e.g. eng.1 (Premier League), esp.1, ger.1, ita.1, fra.1, uefa.champions, fifa.world. List every slug with SELECT league_slug FROM soccer.main.leagues. Β· default "eng.1"
Returns columns
league_slug VARCHAR
ESPN league slug
team_id INTEGER
ESPN team identifier (opaque integer)
athlete_id BIGINT
ESPN player identifier (opaque integer); pass it to player_stats()
player_name VARCHAR
Player display name, e.g. Harry Kane
first_name VARCHAR
First name
last_name VARCHAR
Last name
jersey VARCHAR
Shirt number
position VARCHAR
Position, e.g. Goalkeeper or Forward
position_abbreviation VARCHAR
Position code: G, D, M, or F
age INTEGER
Age in years
date_of_birth DATE
Date of birth
citizenship VARCHAR
Nationality
height_in DECIMAL(5,1)
Height in inches
weight_lb DECIMAL(5,1)
Weight in pounds
gender VARCHAR
MALE or FEMALE
status VARCHAR
Squad status, e.g. Active
Example

Manchester United's (team 360) current squad by position.

SELECT position, jersey, player_name, age, citizenship
FROM soccer.main.roster(360, league := 'eng.1')
ORDER BY position, player_name;
Link
schedule (league := VARCHAR, season := INTEGER) 1 example

Every fixture and result in one competition season

Named arguments
league := VARCHAR
ESPN league slug, e.g. eng.1 (Premier League), esp.1, ger.1, ita.1, fra.1, uefa.champions, fifa.world. List every slug with SELECT league_slug FROM soccer.main.leagues. Β· default "eng.1"
season := INTEGER
Season start year (2015 = 2015-16). NULL selects ESPN's current season. Β· default null
Returns columns
event_id BIGINT
ESPN match identifier (opaque integer); pass it to the match_* functions
league_slug VARCHAR
ESPN league slug, e.g. eng.1
league_name VARCHAR
Competition name
season INTEGER
Season start year (2025 = 2025-26)
kickoff TIMESTAMP WITH TIME ZONE
Scheduled kick-off time in UTC
match_name VARCHAR
Fixture label, e.g. Arsenal at Liverpool
state VARCHAR
pre (scheduled), in (live), or post (finished)
status VARCHAR
ESPN status, e.g. STATUS_FULL_TIME or STATUS_POSTPONED
status_detail VARCHAR
Short status text, e.g. FT or 63'
completed BOOLEAN
Whether the match is finished
home_team_id INTEGER
Home team ESPN identifier (opaque integer)
home_team_name VARCHAR
Home side display name, e.g. Manchester United
home_team_abbreviation VARCHAR
Home side three-letter code, e.g. MAN
home_score INTEGER
Number of goals scored by the home side; null before kick-off
away_team_id INTEGER
Away team ESPN identifier (opaque integer)
away_team_name VARCHAR
Away side display name, e.g. Aston Villa
away_team_abbreviation VARCHAR
Away side three-letter code, e.g. AVL
away_score INTEGER
Number of goals scored by the away side; null before kick-off
home_shootout_score INTEGER
Number of home penalties scored in a shoot-out, when one was played
away_shootout_score INTEGER
Number of away penalties scored in a shoot-out, when one was played
winner VARCHAR
home, away, or draw once finished; null otherwise
venue_name VARCHAR
Stadium name
venue_city VARCHAR
Stadium city
venue_country VARCHAR
Stadium country
attendance INTEGER
Number of spectators reported (null when unknown)
note VARCHAR
Round or stage note, e.g. League Phase
Example

Every 2025-26 Premier League match involving Arsenal.

SELECT kickoff, home_team_name, home_score, away_score, away_team_name
FROM soccer.main.schedule(league := 'eng.1', season := 2025)
WHERE 'Arsenal' IN (home_team_name, away_team_name)
ORDER BY kickoff;
Link
scoreboard (league := VARCHAR, match_date := DATE) 1 example

Fixtures, live scores and results for one day

Named arguments
league := VARCHAR
ESPN league slug such as eng.1, or 'all' for every competition ESPN tracks that day. Slugs are listed in soccer.main.leagues. Β· default "eng.1"
match_date := DATE
Calendar day (US Eastern, as ESPN groups it). NULL selects ESPN's current match day. Β· default null
Returns columns
event_id BIGINT
ESPN match identifier (opaque integer); pass it to the match_* functions
league_slug VARCHAR
ESPN league slug, e.g. eng.1
league_name VARCHAR
Competition name
season INTEGER
Season start year (2025 = 2025-26)
kickoff TIMESTAMP WITH TIME ZONE
Scheduled kick-off time in UTC
match_name VARCHAR
Fixture label, e.g. Arsenal at Liverpool
state VARCHAR
pre (scheduled), in (live), or post (finished)
status VARCHAR
ESPN status, e.g. STATUS_FULL_TIME or STATUS_POSTPONED
status_detail VARCHAR
Short status text, e.g. FT or 63'
completed BOOLEAN
Whether the match is finished
home_team_id INTEGER
Home team ESPN identifier (opaque integer)
home_team_name VARCHAR
Home side display name, e.g. Manchester United
home_team_abbreviation VARCHAR
Home side three-letter code, e.g. MAN
home_score INTEGER
Number of goals scored by the home side; null before kick-off
away_team_id INTEGER
Away team ESPN identifier (opaque integer)
away_team_name VARCHAR
Away side display name, e.g. Aston Villa
away_team_abbreviation VARCHAR
Away side three-letter code, e.g. AVL
away_score INTEGER
Number of goals scored by the away side; null before kick-off
home_shootout_score INTEGER
Number of home penalties scored in a shoot-out, when one was played
away_shootout_score INTEGER
Number of away penalties scored in a shoot-out, when one was played
winner VARCHAR
home, away, or draw once finished; null otherwise
venue_name VARCHAR
Stadium name
venue_city VARCHAR
Stadium city
venue_country VARCHAR
Stadium country
attendance INTEGER
Number of spectators reported (null when unknown)
note VARCHAR
Round or stage note, e.g. League Phase
Example

Premier League results on 8 November 2026.

SELECT kickoff, home_team_name, home_score, away_score, away_team_name,
  status_detail
FROM soccer.main.scoreboard(league := 'eng.1', match_date := DATE '2026-11-08')
ORDER BY kickoff;
Link
standings (league := VARCHAR, season := INTEGER) 2 examples

League table for a competition and season

Named arguments
league := VARCHAR
ESPN league slug, e.g. eng.1 (Premier League), esp.1, ger.1, ita.1, fra.1, uefa.champions, fifa.world. List every slug with SELECT league_slug FROM soccer.main.leagues. Β· default "eng.1"
season := INTEGER
Season start year (2015 = 2015-16). NULL selects ESPN's current season. Β· default null
Returns columns
league_slug VARCHAR
ESPN league slug, e.g. eng.1
league_name VARCHAR
Competition name
season INTEGER
Season start year; 2015 is the 2015-16 season
season_name VARCHAR
Season label, e.g. 2015-16 Barclays Premier League
group_name VARCHAR
Table or group, e.g. Group A or League Phase
rank INTEGER
Table position (1 = top) within the table or group
team_id INTEGER
ESPN team identifier (opaque integer; key for roster() and team_schedule())
team_name VARCHAR
Team display name as ESPN shows it, e.g. Leicester City
team_abbreviation VARCHAR
Three-letter team code, e.g. LEI
games_played INTEGER
Number of matches played
wins INTEGER
Number of matches won
draws INTEGER
Number of matches drawn
losses INTEGER
Number of matches lost
goals_for INTEGER
Number of goals scored
goals_against INTEGER
Number of goals conceded
goal_difference INTEGER
Goal difference: goals for minus goals against (count)
points INTEGER
League points (3 per win, 1 per draw) after any deductions
point_deductions INTEGER
Number of points deducted by the competition (0 when none)
rank_change INTEGER
Number of places gained (+) or lost (-) since the last round
record VARCHAR
ESPN W-D-L summary
qualification VARCHAR
Zone note, e.g. Champions League or Relegation
Examples (2)

Leicester City's 2015-16 title-winning Premier League table.

SELECT rank, team_name, wins, draws, losses, goal_difference, points
FROM soccer.main.standings(league := 'eng.1', season := 2015)
ORDER BY rank;

The current Champions League league-phase table.

SELECT rank, team_name, points, qualification
FROM soccer.main.standings(league := 'uefa.champions')
ORDER BY rank;
Link
stat_leaders (league := VARCHAR, season := INTEGER) 2 examples

Goals and assists leaderboards for a competition season

Named arguments
league := VARCHAR
ESPN league slug, e.g. eng.1 (Premier League), esp.1, ger.1, ita.1, fra.1, uefa.champions, fifa.world. List every slug with SELECT league_slug FROM soccer.main.leagues. Β· default "eng.1"
season := INTEGER
Season start year (2015 = 2015-16). NULL selects ESPN's current season. Β· default null
Returns columns
league_slug VARCHAR
ESPN league slug
season INTEGER
Season start year (2015 = 2015-16)
category VARCHAR
Leaderboard: goals or assists
rank INTEGER
Position (1 = best) in ESPN's ordered leaderboard
athlete_id BIGINT
ESPN player identifier (opaque integer)
player_name VARCHAR
Player display name, e.g. Harry Kane
team_id INTEGER
ESPN team identifier (opaque integer)
team_name VARCHAR
Club or national team display name
team_abbreviation VARCHAR
Three-letter team code, e.g. LEI
value INTEGER
Leaderboard value: number of goals or assists, per category
matches INTEGER
Number of matches played
goals INTEGER
Number of goals scored
assists INTEGER
Number of assists (passes leading directly to a goal)
Examples (2)

The 2015-16 Premier League top scorers.

SELECT rank, player_name, team_name, goals, matches
FROM soccer.main.stat_leaders(league := 'eng.1', season := 2015)
WHERE category = 'goals'
ORDER BY rank
LIMIT 10;

2023-24 Premier League top ten scorers with their club's final league position and points, joining stat_leaders to standings on team_id.

SELECT l.rank, l.player_name, l.team_name, l.goals, s.rank AS team_rank,
  s.points
FROM soccer.main.stat_leaders(league := 'eng.1', season := 2023) AS l
JOIN soccer.main.standings(league := 'eng.1', season := 2023) AS s USING (team_id)
WHERE l.category = 'goals'
ORDER BY l.rank, l.player_name
LIMIT 10;
Link
team_schedule (team_id BIGINT, league := VARCHAR, season := INTEGER) 1 example

One team's results and upcoming fixtures in a competition season

Positional arguments
team_id BIGINT
ESPN team id, from soccer.main.teams() or any standings row.
Named arguments
league := VARCHAR
ESPN league slug, e.g. eng.1 (Premier League), esp.1, ger.1, ita.1, fra.1, uefa.champions, fifa.world. List every slug with SELECT league_slug FROM soccer.main.leagues. Β· default "eng.1"
season := INTEGER
Season start year (2015 = 2015-16). NULL selects ESPN's current season. Β· default null
Returns columns
event_id BIGINT
ESPN match identifier (opaque integer); pass it to the match_* functions
league_slug VARCHAR
ESPN league slug, e.g. eng.1
league_name VARCHAR
Competition name
season INTEGER
Season start year (2025 = 2025-26)
kickoff TIMESTAMP WITH TIME ZONE
Scheduled kick-off time in UTC
match_name VARCHAR
Fixture label, e.g. Arsenal at Liverpool
state VARCHAR
pre (scheduled), in (live), or post (finished)
status VARCHAR
ESPN status, e.g. STATUS_FULL_TIME or STATUS_POSTPONED
status_detail VARCHAR
Short status text, e.g. FT or 63'
completed BOOLEAN
Whether the match is finished
home_team_id INTEGER
Home team ESPN identifier (opaque integer)
home_team_name VARCHAR
Home side display name, e.g. Manchester United
home_team_abbreviation VARCHAR
Home side three-letter code, e.g. MAN
home_score INTEGER
Number of goals scored by the home side; null before kick-off
away_team_id INTEGER
Away team ESPN identifier (opaque integer)
away_team_name VARCHAR
Away side display name, e.g. Aston Villa
away_team_abbreviation VARCHAR
Away side three-letter code, e.g. AVL
away_score INTEGER
Number of goals scored by the away side; null before kick-off
home_shootout_score INTEGER
Number of home penalties scored in a shoot-out, when one was played
away_shootout_score INTEGER
Number of away penalties scored in a shoot-out, when one was played
winner VARCHAR
home, away, or draw once finished; null otherwise
venue_name VARCHAR
Stadium name
venue_city VARCHAR
Stadium city
venue_country VARCHAR
Stadium country
attendance INTEGER
Number of spectators reported (null when unknown)
note VARCHAR
Round or stage note, e.g. League Phase
Example

Manchester United (team 360) results and fixtures this Premier League season.

SELECT kickoff, home_team_name, home_score, away_score, away_team_name,
  state
FROM soccer.main.team_schedule(360, league := 'eng.1')
ORDER BY kickoff;
Link
teams (league := VARCHAR) 1 example

Teams in a competition, with their ESPN team ids

Named arguments
league := VARCHAR
ESPN league slug, e.g. eng.1 (Premier League), esp.1, ger.1, ita.1, fra.1, uefa.champions, fifa.world. List every slug with SELECT league_slug FROM soccer.main.leagues. Β· default "eng.1"
Returns columns
league_slug VARCHAR
ESPN league slug the team list was requested for
team_id INTEGER
ESPN team identifier (opaque integer); pass it to roster() and team_schedule()
team_name VARCHAR
Team display name as ESPN shows it, e.g. Leicester City
short_name VARCHAR
Short display name
abbreviation VARCHAR
Three-letter team code, e.g. LEI
location VARCHAR
Location or club name
nickname VARCHAR
Nickname
slug VARCHAR
ESPN team slug
color VARCHAR
Primary colour as hex
alternate_color VARCHAR
Secondary colour as hex
is_active BOOLEAN
Whether ESPN marks the team active
Example

La Liga clubs and their ESPN ids.

SELECT team_id, team_name, abbreviation
FROM soccer.main.teams(league := 'esp.1')
ORDER BY team_name;
Link
world_cup_goals (year INTEGER) 1 example

Every goal scored at one men's FIFA World Cup (openfootball, CC0)

Arguments
year INTEGER
Men's FIFA World Cup year, 1930-2026 (no tournament in 1942 or 1946).
Returns columns
year INTEGER
Tournament year, e.g. 2022
match_number INTEGER
Match number within the tournament (1 = opening match)
round VARCHAR
Round
team VARCHAR
Team credited with the goal
opponent VARCHAR
Opposing team
player_name VARCHAR
Scorer (for an own goal, the defender)
minute INTEGER
Regulation minute of the goal, e.g. 90 for 90+3
stoppage_minute INTEGER
Added-time minutes, e.g. 3 for 90+3
minute_display VARCHAR
Minute as published, e.g. 90+3
penalty BOOLEAN
Scored from the penalty spot in play
own_goal BOOLEAN
Own goal by the opposing team's player
Example

Top scorers of the 2022 World Cup, excluding own goals and shoot-outs.

SELECT player_name, team, count(*) AS goals
FROM soccer.main.world_cup_goals(2022)
WHERE NOT own_goal
GROUP BY ALL
ORDER BY goals DESC
LIMIT 10;
Link
world_cup_matches (year INTEGER) 2 examples

Every match of one men's FIFA World Cup, 1930-2026 (openfootball, CC0)

Arguments
year INTEGER
Men's FIFA World Cup year, 1930-2026 (no tournament in 1942 or 1946).
Returns columns
year INTEGER
Tournament year, e.g. 2022
match_number INTEGER
Match number within the tournament (1 = opening match)
round VARCHAR
Round, e.g. Matchday 1, Quarter-finals, Final
group_name VARCHAR
Group, for group-stage matches
match_date DATE
Local match date
kickoff_time VARCHAR
Local kick-off time as published, e.g. 15:00 UTC-4
ground VARCHAR
Stadium and city
team1 VARCHAR
First-named team
team2 VARCHAR
Second-named team
team1_goals INTEGER
Number of team 1 goals after 90 minutes
team2_goals INTEGER
Number of team 2 goals after 90 minutes
team1_halftime INTEGER
Number of team 1 goals at half-time
team2_halftime INTEGER
Number of team 2 goals at half-time
team1_extra_time INTEGER
Number of team 1 goals after extra time, when played
team2_extra_time INTEGER
Number of team 2 goals after extra time, when played
team1_penalties INTEGER
Number of team 1 penalties scored in a shoot-out, when taken
team2_penalties INTEGER
Number of team 2 penalties scored in a shoot-out, when taken
winner VARCHAR
Winning team name; null for a draw or unplayed match
Examples (2)

The 2022 World Cup knockout rounds, including extra time and penalties.

SELECT round, team1, team2, team1_goals, team2_goals, team1_extra_time,
  team2_extra_time, team1_penalties, team2_penalties, winner
FROM soccer.main.world_cup_matches(2022)
WHERE group_name IS NULL
ORDER BY match_number;

2018 World Cup knockout results after extra time, with shoot-out scores and every goal scorer in minute order (own goals marked), joining world_cup_matches to world_cup_goals.

SELECT m.round, m.team1,
  coalesce(m.team1_extra_time, m.team1_goals) AS team1_score,
  coalesce(m.team2_extra_time, m.team2_goals) AS team2_score, m.team2,
  m.team1_penalties, m.team2_penalties,
  string_agg(g.player_name || ' ' || g.minute_display || CASE WHEN g.own_goal THEN ' (og)' ELSE '' END, ', ' ORDER BY g.minute, g.stoppage_minute) AS scorers
FROM soccer.main.world_cup_matches(2018) AS m
LEFT JOIN soccer.main.world_cup_goals(2018) AS g ON g.round = m.round AND g.team IN (m.team1, m.team2) AND g.opponent IN (m.team1, m.team2)
WHERE m.group_name IS NULL
GROUP BY ALL
ORDER BY min(m.match_number);
Link

Try these queries

world_cup_2022_final β€” Argentina won the 2022 World Cup final on penalties.

SELECT winner, team1_penalties, team2_penalties
FROM soccer.main.world_cup_matches(2022)
WHERE round = 'Final';

Uses world_cup_matches

leagues_directory_has_premier_league β€” The league directory resolves eng.1 to the Premier League.

SELECT league_name FROM soccer.main.leagues WHERE league_slug = 'eng.1';

Uses leagues

current_tables_cover_big_five β€” The current tables cover all five leagues.

SELECT count(DISTINCT league_slug) AS leagues
FROM soccer.main.current_standings;

Uses current_standings

2023-24 Premier League top ten scorers with their club's final league position and points, joining stat_leaders to standings on team_id.

SELECT l.rank, l.player_name, l.team_name, l.goals, s.rank AS team_rank,
  s.points
FROM soccer.main.stat_leaders(league := 'eng.1', season := 2023) AS l
JOIN soccer.main.standings(league := 'eng.1', season := 2023) AS s USING (team_id)
WHERE l.category = 'goals'
ORDER BY l.rank, l.player_name
LIMIT 10

Uses stat_leadersstandings

Top ten players by shot xG in Manchester United 4-4 Aston Villa, with their shots and goals, joining match_plays to match_player_stats on athlete_id.

WITH shot_xg AS (SELECT athlete_id, count(*) AS shots, round(sum(expected_goals), 2) AS xg FROM soccer.main.match_plays(401879240) WHERE expected_goals IS NOT NULL GROUP BY athlete_id) SELECT p.team_name, p.player_name, x.shots, x.xg, p.goals
FROM soccer.main.match_player_stats(401879240) AS p
JOIN shot_xg AS x USING (athlete_id)
ORDER BY x.xg DESC, p.player_name
LIMIT 10

Uses match_playsmatch_player_stats

Bundesliga matchday 10 of 2025-26 with each club's final 2025-26 table position, joining bundesliga_matches to bundesliga_table on team_id for home and away side.

SELECT m.team1_name, h.position AS team1_position, m.team1_goals,
  m.team2_goals, m.team2_name, a.position AS team2_position
FROM soccer.main.bundesliga_matches(2025, matchday := 10) AS m
JOIN soccer.main.bundesliga_table(2025) AS h ON h.team_id = m.team1_id
JOIN soccer.main.bundesliga_table(2025) AS a ON a.team_id = m.team2_id
ORDER BY least(h.position, a.position)

Uses bundesliga_matchesbundesliga_table

29 more examples in the Catalog, each listed under the table or function it uses.

Questions it can answer

Plain-English questions from the worker's agent test tasks. An AI agent with this catalog attached should answer each one with SQL.

  • Which club won the 2015-16 Premier League, with how many points, and who was the league's top scorer that season?
  • Which team tops each of Europe's big-five leagues right now, and who is the leading goal scorer in each of those leagues?
  • Which competitions have matches today, and how many matches does each have?
  • For ESPN match 401879240, compare the two teams' possession, shots and expected goals (xG), and list the players who scored.
  • List every 2025-26 Premier League match Arsenal played, with the result.
  • Look up Manchester United in the Premier League team list and show their remaining league fixtures this season.

Soccer is an independent open-source connector from Query.Farm. It is not affiliated with, endorsed by or sponsored by the services, projects or organisations it works with. Product names, logos and trademarks belong to their respective owners.