Package-level declarations

Typed records. Values are parsed leniently: anything missing, blank or malformed is null. Times in timestamp properties are UTC. Every model keeps the original fields in raw.

Types

Link copied to clipboard
abstract class ApiRecord

Base class of every record the API returns (Team, Event, ...).

Link copied to clipboard

A player's contract (lookupcontracts.php, lookup/player_contracts).

Link copied to clipboard

A country (all_countries.php, all/countries). v1 returns only name and flag32.

Link copied to clipboard

A team kit (lookupequipment.php, lookup/team_equipment).

Link copied to clipboard

A game, match, race or other event. Also used for video highlights.

Link copied to clipboard

One competitor's result in an individual-sport event: a race, a golf tournament, a fight. Returned both per player (playerresults.php) and per event (eventresults.php).

Link copied to clipboard

One team statistic for an event, home vs away (lookupeventstats.php, lookup/event_stats).

Link copied to clipboard

A broad reading of a strStatus code, so you don't need every sport's codes. Covers the codes in TheSportsDB's data documentation (docs_api_data) for every sport.

Link copied to clipboard

A team a player used to play for (lookupformerteams.php, lookup/player_teams).

Link copied to clipboard

A trophy a player won (lookuphonours.php, lookup/player_honours).

Link copied to clipboard

Image sizes TheSportsDB serves for any r2.thesportsdb.com image by appending a path suffix.

Link copied to clipboard

A league or cup. Lists (all_leagues.php, v2 search/league) fill only a few fields; look it up by id for the rest.

Link copied to clipboard
class LeagueRef

A league a team plays in: one of idLeague/strLeague .. idLeague7/strLeague7.

Link copied to clipboard

One player in an event's lineup (lookuplineup.php, lookup/event_lineup).

Link copied to clipboard

A game in progress (livescore.php, livescore/...).

Link copied to clipboard

A career milestone or award (lookupmilestones.php, lookup/player_milestones).

Link copied to clipboard

A player, manager or other person. Search and list endpoints fill only some fields; look the player up by id for the rest.

Link copied to clipboard

Ids of the same player in other databases.

Link copied to clipboard

One statistic for a player in one season (lookupplayerstats.php, lookup/player_stats).

Link copied to clipboard
class RawRecord

Every field of a record exactly as the API sent it, with blank strings as null.

Link copied to clipboard

The stage a special intRound value stands for. TheSportsDB uses these codes in place of a round number (docs_api_data); any other value is an ordinary round number.

Link copied to clipboard

A season of a league (search_all_seasons.php, list/seasons).

Link copied to clipboard

One season poster or badge uploaded for a league (v2 list/seasonposters). A season can have several; each is a separate piece of artwork with its own id.

Link copied to clipboard
class Socials

Social and web links. TheSportsDB often gives these without a scheme (www.facebook.com/Arsenal).

Link copied to clipboard

A sport (all_sports.php, all/sports).

Link copied to clipboard

One row of a league table (lookuptable.php). v1 only; there is no v2 equivalent.

Link copied to clipboard
class Team : ApiRecord

A team. Search and list endpoints fill only some fields (v2 list/teams has no alternate names, for example); a lookup by id fills them all.

Link copied to clipboard

A goal, card or substitution during an event (lookuptimeline.php, lookup/event_timeline).

Link copied to clipboard

One broadcast of an event on one channel (v1 lookuptv.php/eventstv.php, v2 lookup/event_tv/filter/tv).

Link copied to clipboard

A stadium, arena or circuit.

Functions

Link copied to clipboard

The same image at a smaller size. Only TheSportsDB-hosted images are resized; other URLs are returned unchanged. Image fields are nullable, so call it with ?.: