Skip to content

Recipes

Task-oriented guides. Each one states a goal, shows the exact sequence of calls, gives working code, and names the traps that are not visible from the reference alone.

Every code sample on these pages has been run against the production API - the payloads and values shown are real responses, not illustrations.

RecipeWhat you getTime
Get a token and make your first callCredential exchange, token caching, first working request5 min
Display a league tableThe two-step navigation from stage to rendered table10 min
Get one match with score and statsReading a score correctly, statistics, timeline10 min
Show a match timelineOrdering, deduplication, corrections, added time, substitutions15 min
Build a livescore boardOne polled endpoint, clock rendering, when to move to push15 min
Display a knockout bracketRounds, nodes and slots into a renderable tree, two-legged ties20 min
Sync incrementally instead of re-fetchingThe timestamp cursor, why the boundary is inclusive12 min
Show top scorers, cards and assists19 ranking types, and why player rows invert participant12 min
Compare two teams head to headAll-time balance, last 10, and the five-level event tree8 min
List a team squadPlayers, departed players and the coach in one array8 min
Build a season calendarA whole season of fixtures with scores, grouped by round12 min

Four things are worth understanding before any recipe, because otherwise the sequences look arbitrary. They are covered inline in the recipes above and collected in the planning document:

  • The payload is in api.data, not at the top level
  • Match state needs three fields - status_type, status_id and relation_status. A postponed match still reports status_type: "scheduled"
  • The clock is in seconds and resets each period. played_time is the cumulative total
  • There is no score field - you select a result by id from results[]

Written but not yet published in full: squads and lineups, head-to-head comparison, browsing competitions by country, top scorers and cards. The full list with priorities is in docs/recipes.md.

Machine-readable catalogues harvested from the API, useful when interpreting payloads:

FileContents
spec/reference/statuses.jsonall 369 event statuses with id, name, type
spec/reference/incidents-by-sport.jsonincident definitions for soccer, basketball, tennis, volleyball, ice hockey
spec/harvest/*.jsonone real response per endpoint, redacted and trimmed