Tutorial · 11 min · endpoints verified 2026-09-17

How to build a soccer fantasy app

Build a fantasy XI from one connected soccer surface: fixtures and standings for context, scorer tables for production, and xG for the big-five leagues.

API coverage and endpoint overview: Explore the soccer API

Why this is hard

A fantasy XI needs more than a goals table

The useful decision is not simply who scored most. You need playing time, chance quality, club context and a scoring rule that your users can inspect.

  • Goals and assists are results; xG and xA explain whether that production is repeatable.
  • A transferred player can have more than one club in a season row, so club labels need careful parsing.
  • Not every competition has the same depth. Build from the coverage response instead of borrowing data from another league.
  • Your scoring formula is a product decision. Keep every weight visible and versioned.

Path 1 · recommended

Have your AI agent build it

An agent can assemble fixtures and standings through MCP, then call the league leaderboards over REST.

1. Connect the MCP server

Add the server in your MCP client and sign in with your Big Balls account. Your client registers itself and handles the token exchange — there is no key to copy.

MCP client configjson
{
  "mcpServers": {
    "bigballs-sports-data": {
      "url": "https://mcp.bigballsdata.com/mcp"
    }
  }
}

2. Tools your agent gets

  • get_matches

    Live, upcoming or historical matches for a sport or league.

  • get_standings

    League table with wins, losses, win_pct, games_played.

  • get_coverage

    Machine-readable map of what we hold and what we do not.

3. Ask for what you want

Paste this at your agent. It is written to make the model check coverage before it designs anything, which is what stops it inventing a field we do not serve.

Prompttext
Build a soccer fantasy XI. Check football coverage first, pull the current standings and fixtures, then call the league top-scorers endpoint. For a big-five league, add xG and xA. Keep the scoring weights visible, do not invent unavailable players, and label every source field.

What the agent cannot reach

The MCP server does not expose scorer or xG leaderboards. Use REST for those calls. xG is a big-five dataset, not a promise for every competition.

Path 2 · hand-coded

Build it yourself

Start with a transparent points model and add advanced data only where the chosen competition serves it.

  1. 01

    Check the live coverage map first

    Ask the coverage endpoint what is served before you make a field required in your interface. An unavailable field should produce an honest empty state, not a guessed value.

    Verify soccer coveragebash
    curl -s "https://api.bigballsdata.com/v1/coverage?sport=football" \
      -H "x-api-key: $BBS_API_KEY"
  2. 02

    Load production leaders

    Use the selected league slug. The response supplies goals, assists, minutes and matches for the ranking surface.

    Top scorersbash
    curl -s "https://api.bigballsdata.com/v1/leagues/epl/top-scorers?season=2026&limit=50" \
      -H "x-api-key: $BBS_API_KEY"
  3. 03

    Add chance quality where it exists

    For the big five, xG and xA separate repeatable chance generation from finishing variance. Use the same explicit season as the scorer table. This early-season example uses a 300-minute floor; raise it as the season grows.

    Expected-goals leadersbash
    curl -s "https://api.bigballsdata.com/v1/leagues/epl/xg-leaders?season=2026&stat=xg&min_minutes=300&limit=50" \
      -H "x-api-key: $BBS_API_KEY"
  4. 04

    Score the XI transparently

    Version the weights so a rule change never rewrites an old matchday without explanation.

    A visible scoring ruletypescript
    const RULE_VERSION = 'fantasy-xi-v1';
    const points = (p: { goals: number; assists: number; xg?: number; xa?: number }) =>
      p.goals * 5 + p.assists * 3 + (p.xg ?? 0) + (p.xa ?? 0);

Reference

Every endpoint this tutorial uses

All on the gateway at api.bigballsdata.com. Verified against production on 2026-09-17.

MethodPathReturnsWhy you need itPlan
GET/v1/coverage?sport=footballMeasured sport and league coveragePrevents the app from treating competition-specific depth as universal.Free
GET/v1/leagues/:id/top-scorersGoals, assists, minutes and matchesThe production spine of the fantasy ranking.Free
GET/v1/leagues/:id/xg-leadersxG, xA, non-penalty xG and chance-creation fieldsAdds repeatability context for supported big-five leagues. Learn how to interpret xG.Solo
GET/v1/players/:id/club-formPer-club season production for a resolved playerSupports player detail when a stable player id is available.Free

Pricing, honestly

Where the free tier stops

Free proves the production leaderboard and scoring rule. Solo adds supported xG leaderboards, richer form context and player imagery.

Free key

jsonjson
Scorers, fixtures and standings.

Solo

jsonjson
Supported xG leaderboards, player headshots, rolling form and projections where served.
  • Use Free to validate the calculation.
  • Use Solo when the product needs player presentation and changing form.
  • Never fill an unsupported league with another competition’s players.

More tutorials

Other build guides

Known gaps

Coverage boundaries to preserve

A shared soccer tutorial still has competition-specific evidence boundaries.

  • xG and xA are limited to supported big-five leagues.
  • Player identity can be unresolved on source leaderboards; do not join on a convenient same-name result.
  • Absence coverage varies by competition and is not a universal soccer injury feed.

Questions

Is there one official soccer fantasy scoring system?
No. The tutorial uses an explicit example formula so readers can replace it without confusing a product choice with an API field.
Do all soccer leagues include xG?
No. Use the coverage response and treat xG as an optional big-five enrichment.
Should I create one tutorial per league?
No. The requests and scoring workflow are sport-level; only the league slug and measured coverage change.

Build the first XI

Start with the free production board, keep the rules visible, and enrich only when the competition serves the field.