Back to API-Sports in Google Sheets
SheetXAI logo
API-Sports logo
API-Sports · Google Sheets Guide

Build a Full-Season Team Stats Comparison Table in Google Sheets

2026-05-13
4 min read
See the Excel version →

The Scenario

You are a football analytics consultant. Your client is a sports media agency that wants a Premier League team stats comparison table for a presentation to a broadcast rights partner next Thursday. They need season-long statistics for all 20 clubs: shots on target, clean sheets, average possession, goals scored, and goals conceded.

You have the client's slide template. You do not have the data.

The bad version:

  • You look up the teams/statistics endpoint in the API-Sports docs
  • You write a script to call it 20 times, once per team, with league ID 39 and season 2024
  • Each response has possession as a string with a percent sign that your numeric parser chokes on
  • You clean the possession column, run the script again, discover that three team IDs in your list are wrong and return null
  • You fix the IDs, rerun, export to CSV, open in Sheets, and reformat the column headers to match the client's template
  • It is Wednesday evening, the presentation is tomorrow, and you have not started the slides.

The faster version is one prompt.

The Easy Way: One Prompt in SheetXAI

SheetXAI is an AI agent inside your spreadsheet that calls the team statistics endpoint for every Premier League club in one pass and writes the output in the column structure you specify.

Open the SheetXAI sidebar and type:

Fetch season statistics for all teams in the Premier League (league ID 39, season 2024) and write team name, goals scored, goals conceded, clean sheets, and average possession into columns A through E, one row per team. Sort by goals scored descending.

SheetXAI calls the API-Sports teams/statistics endpoint for all 20 Premier League clubs, parses the possession percentage into a clean numeric value, and writes the full comparison table sorted by attacking output. The column headers match what you typed.

What You Get

A 20-row comparison table ready for the client presentation:

  • Team name — all 20 Premier League clubs
  • Goals scored and conceded — season totals
  • Clean sheets — goalkeeper and defensive efficiency metric
  • Average possession — as a clean percentage number, not a string with a % symbol

The sort order gives you the attack-minded clubs at the top by default, which is the natural reading order for a broadcast partner focused on offensive output and watchability.

What If the Data Is Not Quite Ready

Client presentations usually need more than a raw comparison table. SheetXAI can add the analytical layers before Thursday.

When the client wants a defensive efficiency ranking alongside the offensive stats

Goals conceded is in the table but your client wants a separate defensive tier label — Top 6 Defence, Mid Table, or Leaky — based on goals conceded per game.

Calculate goals conceded per game for each team (goals conceded divided by matches played). Add a 'Defensive Tier' column: Top 6 Defence for the 6 teams with the lowest rate, Mid Table for the next 8, Leaky for the bottom 6. Write the tier labels into column F.

When average possession data is missing for two clubs

Two newly promoted clubs have incomplete possession tracking for the first part of the season. You do not want blanks in the client table.

For any row where average possession is blank or zero, write 'Insufficient Data' into that cell. Add a footnote row at the bottom of the table flagging which clubs have incomplete possession data and noting that figures are based on available matches only.

When the client wants the table ranked differently for different slides

Slide 3 needs the table ranked by goals scored. Slide 5 needs the same 20 clubs ranked by clean sheets. Slide 7 needs it ranked by possession.

Create three copies of the team stats table in three separate tabs: 'By Goals' sorted by goals scored descending, 'By Clean Sheets' sorted by clean sheets descending, and 'By Possession' sorted by average possession descending. Keep all five data columns in each tab.

When the client wants the full stats brief with tier labels and a visual summary in one pass

You have no data at all and the presentation is in 18 hours. You want the raw comparison table, defensive tier labels, three sorted views, and a 'Top Performers' tab highlighting the leader in each stat category.

Fetch season statistics for all 20 Premier League teams (league ID 39, season 2024). Write team name, goals scored, goals conceded, clean sheets, and average possession to the main tab sorted by goals scored. Add a Defensive Tier column. Create 'By Clean Sheets' and 'By Possession' sorted tabs. Create a 'Top Performers' tab listing the team ranked first in each of the five categories with their stat value.

The pattern: instead of pulling the data and building three sorted views and a summary tab across four separate steps, you describe the full deliverable and SheetXAI builds all of it before the presentation.

Try It

Get the 7-day free trial of SheetXAI and ask it to pull season-long statistics for all teams in a league directly into your sheet. The API-Sports integration is included in every SheetXAI plan. For related workflows, see how to pull a full season fixture list and standings or the API-Sports in Google Sheets overview.

Stop memorizing formulas.
Tell your spreadsheet what to do.

Join 4,000+ professionals saving hours every week with SheetXAI.

Learn more