Use case

Fantasy and games

Lineups with each player's match rating, season statistics per player, and the league's leaderboards — the numbers a fantasy game scores with.

The build, step by step

  1. Who played, how well

    Each side's lineup with every player's rating and match statistics.

    GET /v2/fixtures/{id}/lineups
  2. The season so far

    A player's season statistics in one league: totals and averages.

    GET /v2/players/{id}/statistics
  3. Leaderboards

    The season's top players per statistic (Pro and Business).

    GET /v2/leagues/{id}/top-players

Ratings after the whistle

Read every player's rating from the lineups, then their season in the league.

Python
from sportsapi import SportsAPI

client = SportsAPI()  # reads SPORTSAPI_API_KEY

lineups = client.fixtures.lineups(fixture_id)["data"]
for side in (lineups["home"], lineups["away"]):
    for p in side["players"]:
        print(p["player"]["name"], p["rating"])

season = client.players.statistics(player_id, league=league_id, season=season_id)
Which plan

Pro: the leaderboards are a premium endpoint, and twelve months of history cover a season.

Compare plans