Skip to main content

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

sportality_athlete_career​

Player career totals, one row per ssgt.

Endpoint URL: GET https://www.basketligaen.dk/api/statistics-v2/athlete/playerProfile_gameLog

Valid URL: https://www.basketligaen.dk/api/statistics-v2/athlete/playerProfile_gameLog?playerUuid=dpu0901c0t&masterSiteInstanceId=dbl1_dbl

API ParameterPythonPatternRequiredNullableDescription
playerUuidathlete_uuidYRequired. Athlete uuid.
masterSiteInstanceIdmaster_site_instance_idYSite instance (dbl1_dbl). No effect in the drop-one probe.

Returns​

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

col_nametypedescription
gInt64Games played in the ssgt.
gpsInt64Games started (0 on every row seen).
mpgFloat64Minutes per game, 'M.m' string.
ppgFloat64Points per game.
drpgFloat64Defensive rebounds per game.
orpgFloat64Offensive rebounds per game.
rpgFloat64Rebounds per game.
apgFloat64Assists per game.
stpgFloat64Steals per game.
blkpgFloat64Blocks per game.
pfpgFloat64Personal fouls per game.
2_p_percFloat64Two-point percentage, 0-100.
3_pmInt64Three-pointers made (total).
3_paFloat64Three-pointers attempted (total, or a percentage string in the checked rows; unverified).
3_p_percFloat64Three-point percentage, 0-100.
ft_percFloat64Free-throw percentage, 0-100.
topgFloat64Turnovers per game.
plus_minus_pgFloat64Plus/minus per game.
info_uuidStringAthlete uuid on player tables, team uuid on team tables (platform key space).
info_full_nameStringFull display name of the player.
info_first_nameStringGiven (first) name(s) of the player.
info_last_nameStringFamily name (surname) of the player.
info_nationalityStringISO 3166-1 alpha-2 country code.
info_genderStringGender of the person as recorded by the site (male in every row seen).
info_age_valueInt64Age in whole years.
info_age_formatStringUnit of the value (years). Values: years = years.
info_weight_valueInt64Weight of the player in kilograms.
info_weight_formatStringUnit of the value (kg). Values: kg = kilograms.
info_height_valueInt64Height of the player in centimetres.
info_height_formatStringUnit of the value (cm). Values: cm = centimetres.
info_jersey_numberStringJersey number ('N/A' on career rows).
info_positionStringPosition code (G, F, C, SG, SF ...).
info_position_codeStringPosition code ('N/A' on career rows). Values: N/A = not applicable (career rows).
info_shootsStringShooting hand (null).
info_team_uuidStringTeam uuid (platform key space); joins /sports-v2/teams/{team_uuid}.
info_team_instance_idStringSite instance id of the club (platform key space).
info_team_nameStringName of the team.
info_team_codeStringThree-letter team code.
info_season_statsStringSeason totals (always empty here).
info_career_statsStringCareer totals (always empty here).
info_statistics_providerStringStats provider of the data (genius-basketball = Genius Sports LiveStats).
info_is_in_squadBooleanWhether the player is in the team's current squad.
info_player_idInt64Genius person id (Genius key space; an integer).
info_ssgt_uuidStringssgt uuid of the career row (platform key space).
info_team_idInt64Genius team id (Genius key space; an integer here).

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_athlete_career(athlete_uuid='dpu0901c0t', master_site_instance_id='dbl1_dbl')

sportality_athlete_details​

Player bio plus playerExtIds (the Genius person id).

Endpoint URL: GET https://www.basketligaen.dk/api/sports-v2/athlete-details/{athlete_uuid}

Valid URL: https://www.basketligaen.dk/api/sports-v2/athlete-details/dpu0901c0t

API ParameterPythonPatternRequiredNullableDescription
athlete_uuidathlete_uuidYAthlete uuid: roster players[].uuid or stats-info stats[].info.uuid. Key space: platform athlete uuids (not the Genius person id).

Returns​

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

col_nametypedescription
athlete_uuidStringPlatform athlete uuid (rosters and athlete routes key on it); not the Genius person id; null where the site has none.
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.
created_atStringCreation timestamp.
created_byStringCreating site instance.
creator_siteStringUnobserved: null in every sample and every full body. When filled: Creating site (null).
heightInt64Height of the player in centimetres.
deletedBooleanSoft-delete flag.
first_nameStringGiven (first) name(s) of the player.
genderStringGender of the person as recorded by the site (male in every row seen).
last_modifiedStringLast-modified timestamp.
last_nameStringFamily name (surname) of the player.
metadataStringFree metadata (always empty).
nationalityStringISO 3166-1 alpha-2 country code.
shootsStringShooting hand ('').
weightInt64Weight of the player in kilograms.

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_athlete_details(athlete_uuid='dpu0901c0t')

sportality_athlete_profile​

Player profile: age, height, position, season and career totals.

Endpoint URL: GET https://www.basketligaen.dk/api/statistics-v2/athlete/profile-page

Valid URL: https://www.basketligaen.dk/api/statistics-v2/athlete/profile-page?playerUuid=dpu0901c0t&masterSiteInstanceId=dbl1_dbl

API ParameterPythonPatternRequiredNullableDescription
playerUuidathlete_uuidYRequired. Athlete uuid.
masterSiteInstanceIdmaster_site_instance_idYSite instance (dbl1_dbl). No effect in the drop-one probe.

Returns​

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

col_nametypedescription
uuidStringPlatform uuid of this record (10-character lowercase key space of its record type; joins the route that serves it).
full_nameStringFull display name of the player.
first_nameStringGiven (first) name(s) of the player.
last_nameStringFamily name (surname) of the player.
nationalityStringISO 3166-1 alpha-2 country code.
genderStringGender of the team or player: male or female (every record on this host is male).
age_valueInt64Age in whole years.
age_formatStringUnit of the value (years). Values: years = years.
weight_valueInt64Weight of the player in kilograms.
weight_formatStringUnit of the value (kg). Values: kg = kilograms.
height_valueInt64Height of the player in centimetres.
height_formatStringUnit of the value (cm). Values: cm = centimetres.
jersey_numberInt64Jersey (shirt) number of the player.
positionStringPlaying position.
position_codeStringPosition code (G, F, C, or a finer code such as SG on the profile route). Values: G = guard.
shootsStringShooting hand (empty or null for every player seen).
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.
season_statsStringThe player's current-season totals as field/value pairs (GP, PAvg, ...).
career_statsStringThe player's career totals as field/value pairs.
statistics_providerStringStats provider of the data (genius-basketball = Genius Sports LiveStats).
is_in_squadBooleanWhether the player is in the team's current squad.
media_urlStringPortrait image URL (imgix CDN).
media_altStringImage alt text ('').
media_srcsetStringResponsive image set (imgix CDN URLs with widths).
media_url_img_original_proportionStringPortrait URL at its original proportions.
media_url_placeholder_imageStringPlaceholder image URL ('').
media_videourlStringVideo URL ('').
media_photographerStringPhotographer credit ('').
media_focal_pointStringFocal point record (empty).

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_athlete_profile(athlete_uuid='dpu0901c0t', master_site_instance_id='dbl1_dbl')