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
- Query Farm hosting
- Available Β· $10/month organization minimum
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;
| 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.
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;
INSTALL vgi FROM community;
LOAD vgi;
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
SELECT team_name, points
FROM soccer.main.standings(league := 'eng.1', season := 2015)
WHERE rank = 1;
Run the connector on a server you manage. You operate the service and choose who can connect.
1. Deploy the connector on your server
Follow the connectorβs deployment instructions. Use its supported HTTP transport, or launch it remotely over SSH. The connection guide explains both options.
2. Install the vgi extension
Run this in your SQL client. On DuckDB, keep FROM query_farm on LOAD in later sessions.
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;
INSTALL vgi FROM community;
LOAD vgi;
3. Attach the connector
For an HTTP deployment, replace the example URL with your endpoint. Add the authentication options your deployment requires. For SSH, use the SSH connection instructions.
ATTACH 'soccer' AS soccer
(TYPE vgi, LOCATION 'https://your-connector.example.com');
4. Run a query
SELECT team_name, points
FROM soccer.main.standings(league := 'eng.1', season := 2015)
WHERE rank = 1;
Query Farm operates Soccer for your team. Hosting has a $10 monthly minimum per organization; usage counts toward it. From $2.97 per instance-month ($10 monthly minimum).
1. Create your hosted connector
Open the console, choose your organization and deployment size, and add any service credentials there.
2. Install the vgi extension
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;
INSTALL vgi FROM community;
LOAD vgi;
3. Attach your deployment
Copy the ATTACH statement from your deployment in the console and run it in DuckDB or Haybarn. Use soccer as the catalog alias for the query below.
4. Run a query
SELECT team_name, points
FROM soccer.main.standings(league := 'eng.1', season := 2015)
WHERE rank = 1;
Technical details
- Verified connector release
- v0.3.1
- Engine
- 2.0.1
- VGI protocol
- 3.4.0
- Verified on
- December 1, 2026
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
Query league tables, fixtures and results, match events, box scores, play-by-play with expected goals, squads, leaderboards and player season lines for 200+ competitions, plus every men's World Cup since 1930 and German league data from OpenLigaDB.
Data model
Competitions are addressed by ESPN league slug (eng.1, uefa.champions, fifa.world; list them in leagues). Seasons are start years. Matches carry an event_id that keys every match_* function.
Sources and terms
Data is fetched on demand and never rehosted. ESPN endpoints are undocumented and subject to ESPN's terms; openfootball is CC0; OpenLigaDB is community open data. This worker is not affiliated with ESPN, Disney, FIFA, UEFA or any league.
- ESPN soccer: leagues, matches, box scores and players (endpoints undocumented; Disney terms of use).
- openfootball/worldcup.json: every men's World Cup, released under CC0 1.0.
- OpenLigaDB and its API: Bundesliga tables and matches.
Catalog
Everything soccer exposes once attached β read straight from the worker's
released build.
main 4 tables Β· 22 functions
World football league tables, matches, match detail, players and open history
Schema 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);
current_matches
Today's matches across every ESPN-covered competition, one row per match
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;
current_standings
Current big-five European league tables, one row per team
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;
current_stat_leaders
Current big-five goals and assists leaderboards, one row per player per board
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;
leagues
Every soccer competition ESPN covers, one row per league slug
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;
all_current_matches ()
Today's matches in every ESPN-covered competition
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;
all_current_standings ()
Current Premier League, La Liga, Bundesliga, Serie A and Ligue 1 tables
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;
all_current_stat_leaders ()
Current goals and assists leaders in the big-five European leagues
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;
all_leagues ()
Every soccer competition ESPN covers (scan behind the leagues table)
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;
bundesliga_matches (season INTEGER, league := VARCHAR, matchday := INTEGER)
German league or DFB-Pokal matches from OpenLigaDB, per matchday or season
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);
bundesliga_table (season INTEGER, league := VARCHAR)
German league table from the OpenLigaDB community database
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;
match_commentary (event_id BIGINT)
Minute-by-minute text commentary for a match
The first ten commentary lines.
SELECT clock_display, text
FROM soccer.main.match_commentary(401879240)
ORDER BY sequence
LIMIT 10;
match_key_events (event_id BIGINT)
Goals, cards and substitutions for a match in order
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;
match_player_stats (event_id BIGINT)
Line-ups and per-player statistics for a match
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;
match_plays (event_id BIGINT)
Every on-ball action in a match, with expected goals for shots
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;
match_summary (event_id BIGINT)
One-row header for a match: teams, score, formations, venue, attendance
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);
match_team_stats (event_id BIGINT)
Team box score for a match: possession, shots, passes, tackles, cards
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);
player_stats (athlete_id BIGINT, league := VARCHAR)
One player's recent season totals in a competition
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;
roster (team_id BIGINT, league := VARCHAR)
A team's current squad with positions, ages and nationalities
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;
schedule (league := VARCHAR, season := INTEGER)
Every fixture and result in one competition season
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;
scoreboard (league := VARCHAR, match_date := DATE)
Fixtures, live scores and results for one day
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;
standings (league := VARCHAR, season := INTEGER)
League table for a competition and season
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;
stat_leaders (league := VARCHAR, season := INTEGER)
Goals and assists leaderboards for a competition season
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;
team_schedule (team_id BIGINT, league := VARCHAR, season := INTEGER)
One team's results and upcoming fixtures in a competition season
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;
teams (league := VARCHAR)
Teams in a competition, with their ESPN team ids
La Liga clubs and their ESPN ids.
SELECT team_id, team_name, abbreviation
FROM soccer.main.teams(league := 'esp.1')
ORDER BY team_name;
world_cup_goals (year INTEGER)
Every goal scored at one men's FIFA World Cup (openfootball, CC0)
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;
world_cup_matches (year INTEGER)
Every match of one men's FIFA World Cup, 1930-2026 (openfootball, CC0)
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);
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
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
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)
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.
Related workers
US soccer
Sports
MLS, NWSL, NEXT Pro, and USL standings, schedules, stats, and xG as SQL tables
NFL
Sports
NFL scores, standings, box scores, play-by-play, and player statistics as SQL
Formula 1
Sports
F1 standings, results, calendars, lap times, and session timing as SQL tables