Skip to main content
Version: 0.2.0

Basketligaen — Basketligaen site API (www.basketligaen.dk/api, Denmark; Sportality) — Player

sportality_player_box​

Box score with jersey and Genius shirt numbers (2023/24 on).

Endpoint URL: GET https://www.basketligaen.dk/api/gameday/player-stats/{game_uuid}

Valid URL: https://www.basketligaen.dk/api/gameday/player-stats/c4hh5nig6t

API ParameterPythonPatternRequiredNullableDescription
game_uuidgame_uuidYGame uuid: gameInfo[].uuid of the schedule (10 lowercase letters and digits). Key space: platform game uuids; the Genius match id is extId / gameSourceId in the body.

Returns​

return_parsed=True (default) — a tidy polars.DataFrame with the columns below; pass return_as_pandas=True for a pandas.DataFrame.

col_nametypedescription
team_sideStringhome or away: the side the row belongs to.
row_typeStringKind of row: player, team_coach (the bench row: team rebounds, turnovers and fouls charged to the team or coach) or team_totals.
player_idInt64Genius person id (Int64). A string key in the players maps, an integer in play-by-play and box-score rows; cast here so the frames join, and join the genius family.
team_idInt64Genius team id (Int64): in gameday bodies, an integer in standings and stats tables.
team_nameStringName of the team.
periodInt64Period of the line: 0 = the whole game (the only value seen).
full_nameStringFull display name of the player.
first_nameStringGiven (first) name(s) of the player.
last_nameStringFamily name (surname) of the player.
nrInt64Jersey number (null on the bench and totals rows).
posStringPosition code of the line (G, F, C; null on the bench and totals rows).
minsStringMinutes played as 'MM:SS' (null on the bench and totals rows).
ptsInt64Number of points scored.
fgStringField goals as 'made-attempted'.
fg_percFloat64Field-goal percentage, 0-100.
2_pStringTwo-pointers as 'made-attempted'.
2_p_percFloat64Two-point percentage, 0-100.
3_pStringThree-pointers as 'made-attempted'.
3_p_percFloat64Three-point percentage, 0-100.
ftStringFree throws as 'made-attempted'.
ft_percFloat64Free-throw percentage, 0-100.
offInt64Offensive rebounds.
defInt64Defensive rebounds.
rebInt64Total rebounds.
astInt64Number of assists credited.
toInt64Number of turnovers committed.
stlInt64Number of steals.
blkInt64Number of blocked shots made.
blkrInt64Blocks received (shots of the player that were blocked).
pfInt64Personal fouls.
f_onInt64Fouls on (fouls drawn).
plus_minusInt64Plus/minus while on court.
team_numberInt64Team number in the game (1 home, 2 away) as Genius numbers the shirt table.
pnoInt64Genius shirt-table number of the player (player-stats only).

return_parsed=False — the raw JSON Dict payload, unparsed.

Raises​

ExceptionDescription
NoDataErrorThe host answered 404 -- the requested resource does not exist. The site answered 404, an empty body (gameday routes before 2023/24, or an unknown game), a table with no rows, or the season and game type are not in layout-info.
AssetFetchErrorThe fetch failed (a non-2xx answer or a connection failure after retries, e.g. 401/403/429/5xx, or an empty or unreadable 200 body) -- the answer is unknown, not empty. An error envelope or non-JSON 200, another game / team / athlete / ssgt than the one asked for, an unfinished game or truncated play-by-play, a cut stats table, or any other failed fetch (a 500 is the site's answer for an unknown uuid and is not retried).
ValueErrorThe host answered 400 / 422 -- the request is wrong; retrying cannot help.

Example​

sportality_player_box(game_uuid='c4hh5nig6t')

sportality_player_h2h​

Player head-to-head of a matchup with per-game and season lines.

Endpoint URL: GET https://www.basketligaen.dk/api/statistics-v2/player-h2h-v2/{ssgt_uuid}/{home_team_uuid}/{away_team_uuid}

Valid URL: https://www.basketligaen.dk/api/statistics-v2/player-h2h-v2/xs07bd3fmp/rfo82vr830/gvvuxe9ysw?gameUuid=c4hh5nig6t

API ParameterPythonPatternRequiredNullableDescription
ssgt_uuidssgt_uuidYssgt uuid: one season + series + game type, e.g. xs07bd3fmp = 2026/2027 regular season. Directory: /statistics-v2/layout-info originalSeasonSeriesGameTypeTeams[].ssgtUuid.
home_team_uuidhome_team_uuidYHome team uuid of the game.
away_team_uuidaway_team_uuidYAway team uuid of the game.
gameUuidgame_uuidYGame uuid; selects the game whose box-score lines the head-to-head carries.

Returns​

return_parsed=True (default) — a tidy polars.DataFrame with the columns below; pass return_as_pandas=True for a pandas.DataFrame.

col_nametypedescription
uuidStringAthlete uuid (platform key space).
first_nameStringGiven (first) name(s) of the player.
last_nameStringFamily name (surname) of the player.
full_nameStringFull display name of the player.
nationalityStringISO 3166-1 alpha-2 country code.
genderStringGender of the person as recorded by the site (male in every row seen).
jersey_numberInt64Jersey (shirt) number of the player.
positionStringPosition name (Guard, Forward, Center ...).
position_codeStringPosition code. Values: C = center; G = guard; N/A = not applicable (career rows); PF = power forward; PG = point guard; SF = small forward; SG = shooting guard.
age_valueInt64Age in whole years.
age_formatStringUnit of the value (years). Values: years = years.
height_valueInt64Height of the player in centimetres.
height_formatStringUnit of the value (cm). Values: cm = centimetres.
weight_valueInt64Weight of the player in kilograms.
weight_formatStringUnit of the value (kg). Values: kg = kilograms.
team_uuidStringPlatform team uuid.
team_instance_idStringSite instance id of the club (platform key space).
team_nameStringName of the team.
team_codeStringPlatform team code (HOL, RAN).
team_mediaStringURL of the team logo image.
media_urlStringPortrait image URL (imgix CDN).
media_altStringImage alt text ('').
media_srcsetStringResponsive image set (imgix CDN URLs with widths).
season_statsStringSeason totals as field/value pairs (absent for some players).
career_statsStringCareer totals as field/value pairs (absent for some players).
match_stats_nrInt64Jersey (shirt) number of the player.
match_stats_posStringPlaying position code of the player (G, F, C, ...).
match_stats_team_numberInt64Team number in the game.
match_stats_pnoInt64Genius shirt-table number.
match_stats_minsStringMinutes played 'MM:SS'.
match_stats_ptsInt64Number of points scored.
match_stats_fgStringField goals 'made-attempted'.
match_stats_fg_percFloat64Field-goal percentage, 0-100.
match_stats_2_pStringTwo-pointers 'made-attempted'.
match_stats_2_p_percFloat64Two-point percentage, 0-100.
match_stats_3_pStringThree-pointers 'made-attempted'.
match_stats_3_p_percFloat64Three-point percentage, 0-100.
match_stats_ftStringFree throws 'made-attempted'.
match_stats_ft_percFloat64Free-throw percentage, 0-100.
match_stats_offInt64Offensive rebounds.
match_stats_defInt64Defensive rebounds.
match_stats_rebInt64Total rebounds.
match_stats_astInt64Number of assists credited.
match_stats_toInt64Number of turnovers committed.
match_stats_stlInt64Number of steals.
match_stats_blkInt64Number of blocked shots made.
match_stats_blkrInt64Blocks received.
match_stats_pfInt64Personal fouls.
match_stats_f_onInt64Fouls on (fouls drawn).
match_stats_plus_minusInt64Plus/minus while on court.
season_avg_statsStringThe player's season averages (an object keyed by stat).
statistics_providerStringStats provider (genius-basketball).
is_in_squadBooleanWhether the player is in the squad.
effective_ssgt_uuidStringThe ssgt the head-to-head was computed for: the CURRENT season, whatever the path asked.

return_parsed=False — the raw JSON Dict payload, unparsed.

Raises​

ExceptionDescription
NoDataErrorThe host answered 404 -- the requested resource does not exist. The site answered 404, an empty body (gameday routes before 2023/24, or an unknown game), a table with no rows, or the season and game type are not in layout-info.
AssetFetchErrorThe fetch failed (a non-2xx answer or a connection failure after retries, e.g. 401/403/429/5xx, or an empty or unreadable 200 body) -- the answer is unknown, not empty. An error envelope or non-JSON 200, another game / team / athlete / ssgt than the one asked for, an unfinished game or truncated play-by-play, a cut stats table, or any other failed fetch (a 500 is the site's answer for an unknown uuid and is not retried).
ValueErrorThe host answered 400 / 422 -- the request is wrong; retrying cannot help.

Example​

sportality_player_h2h(away_team_uuid='gvvuxe9ysw', game_uuid='c4hh5nig6t', home_team_uuid='rfo82vr830', ssgt_uuid='xs07bd3fmp')