Free course · Intermediate · 6 parts · ~44 min

Soccer Analytics with StatsBomb & xG

Pass maps, shot maps, heatmaps and pass networks from free professional event data — plus a real World Cup dataset.

Soccer's analytics revolution runs on event data, and StatsBomb gives a professional-grade slice of it away free. This course builds the four canonical match visualizations — pass map, xG shot map, player heatmap, team pass network — then closes on a real tournament: goals by stage at the 2026 World Cup, from a bundled snapshot of actual results.

An xG league table from Understat data rounds out the toolkit — the single most useful number for judging whether a team's results are sustainable.

What you'll be able to do

  • Navigate StatsBomb event data and know what's in it
  • Draw pass maps, shot maps and heatmaps on a properly scaled pitch
  • Build a team pass network and read its structure
  • Construct an xG table and argue from it
Download the course bundle - every script + dataset, one ZIP

The bundle contains each part's finished script, the shared helpers, and the sample data they read, with a README listing the run order - the whole course works offline.

The syllabus

Pace: In order for the first two parts, then free order. The World Cup part is the payoff - a real tournament in your hands.

  1. Build an xG League Table from Understat DataIntermediate · ~8 minxG against the table: the sustainability check every result needs.
  2. Draw a Pass Map with mplsoccerIntermediate · ~7 minEvent data made visible - your first professional-grade match graphic.
  3. Build a Match Shot Map with Expected GoalsIntermediate · ~8 minChance quality on the pitch map, not just the scoreline.
  4. Draw a Player Heatmap from Event DataIntermediate · ~7 minWhere a player actually operated, from raw event coordinates.
  5. Build a Team Pass NetworkAdvanced · ~9 minTeam structure as a graph - who really connects the play.
  6. Group vs Knockout Scoring at a Live World Cup, with groupbyBeginner · ~5 minA live-tournament dataset, one groupby, a real finding.

Check yourself

Five questions, graded on the page, nothing recorded anywhere - pick an answer and the explanation appears.

1. Expected goals (xG) measures…

2. A team running far ahead of its xG for several matches is…

3. In a pass network, node size and edge thickness typically encode…

4. StatsBomb open data is…

5. How does a team win 1-0 while 'losing' the xG battle?

Where next: Statistics for Sports Data · Sports Data Visualization.