Back to API-Sports in Excel
SheetXAI logo
API-Sports logo
API-Sports · Excel Guide

Bulk-Import Gameweek Player Stats From API-Sports Into Excel

The Scenario

You run a fantasy Premier League platform. It is Saturday at 5 PM, all 10 Gameweek 25 fixtures have finished, and your scoring pipeline needs individual player stats — goals, assists, yellow cards, minutes played — loaded into an Excel workbook before the 6 PM recalculation job kicks off.

You have the 10 fixture IDs in column A of the workbook. The pipeline reads from that workbook. The clock is running.

The bad version:

  • You try to use Power Automate to fetch player stats for each fixture ID when the workbook is updated
  • Power Automate's API-Sports connector does not exist; you have to use the HTTP action with manual header configuration
  • You build the flow for one fixture ID, it works, you adapt it for 10 IDs by chaining 10 HTTP calls
  • The third HTTP call times out because Power Automate's HTTP action has a 30-second timeout
  • You try chunking the calls, you hit the Power Automate rate limit
  • It is 5:55 PM, the pipeline is going to run on stale data, and the fantasy points will be wrong.

The faster version is one prompt.

The Easy Way: One Prompt in SheetXAI

SheetXAI is an AI agent inside your Excel workbook that reads the fixture IDs in column A and fetches player stats for each one without Power Automate.

Open the SheetXAI sidebar and type:

For each fixture ID in column A, fetch player statistics from API-Sports and write player name, team, goals, assists, yellow cards, and minutes played into the workbook. Include only players with more than 0 minutes played. One row per player per fixture.

SheetXAI iterates through the fixture IDs, calls the player statistics endpoint for each, filters out zero-minute players, and writes the flat stats table. Each row includes the fixture ID as a reference column so the pipeline knows which match each stat row belongs to.

What You Get

A flat player stats table ready for your pipeline:

  • Fixture ID — join key linking each stat row back to the match
  • Player name and team — consistent naming format across all 10 fixtures
  • Goals, assists, yellow cards, minutes — one row per player per fixture

Zero-minute players are excluded automatically, so your pipeline does not filter them downstream. The table is ready to join to your player roster on player name.

What If the Data Is Not Quite Ready

Fantasy scoring pipelines have edge cases. SheetXAI can handle them inline.

When player names in the API do not match your roster workbook

API-Sports uses surname-first formatting for some nationalities. Your roster uses first-last. The join breaks on three players.

After writing the player stats table, check whether each player name in the 'Player' column matches any name in the Roster tab (column A). Flag any row with no exact match in a 'Name Mismatch' column so the team can resolve it before the points run.

When a fixture is postponed and returns no player data

One of the 10 fixture IDs was postponed and the API returns an empty response. Your pipeline errors on the null.

If any fixture ID in column A returns no player stats (postponed or no data available), write 'No Data' into the team and player columns for that fixture ID and skip it. List postponed fixture IDs in a cell at the top of the workbook.

When you need bonus points calculated inline

Your platform awards 1 bonus point for every 2 assists. You want the bonus column calculated before the pipeline reads the workbook.

After writing goals, assists, yellow cards, and minutes, add a 'Bonus Points' column calculated as FLOOR(assists / 2). Add a 'Points' column using: goals = 4 pts, assists = 3 pts, yellow cards = −1 pt, minutes ≥ 60 = 2 pts, minutes 1–59 = 1 pt.

When you want the full gameweek stats and points table in one pass

You have the 10 fixture IDs and want the complete output: player stats, bonus points, total points, and a leaderboard tab showing the top 20 point scorers for the gameweek.

For each fixture ID in column A, fetch player stats from API-Sports. Write player name, team, fixture ID, goals, assists, yellow cards, and minutes into the main tab. Calculate points using: goals = 4, assists = 3, yellow cards = −1, minutes ≥ 60 = 2, minutes 1–59 = 1. Add FLOOR(assists / 2) as bonus points. Sum total points per player. Create a 'Leaderboard' tab with the top 20 point scorers for the gameweek sorted by total points descending.

The pattern: instead of running the data pull and the scoring logic as two separate Power Automate flows, you describe the full output and SheetXAI handles both before the 6 PM cutoff.

Try It

Get the 7-day free trial of SheetXAI and ask it to pull Gameweek player stats for a list of fixture IDs directly into your Excel workbook. The API-Sports integration is included in every SheetXAI plan. For related workflows, see how to pull injury and suspension reports for all squads in Excel or the API-Sports in Excel overview.

Stop memorizing formulas.
Tell your spreadsheet what to do.

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

Learn more