Skip to contents

One team's players from the CMS directory: CMS ids, position, jersey, birth date, size, headshots. One team per call (league-wide paging is unreliable).

Ids are CMS ids (player_cms_id, player_document_id, team_cms_id), not StatNet ids; team_code is the team's display code and slug joins ha_leaders(). One team per call: the directory pages unreliably league-wide, so only one complete page of that team's players is accepted.

Usage

ha_players(
  team,
  order_by = "familyName",
  search_query = NULL,
  return_parsed = TRUE
)

Arguments

team

Team display code (CMS short name: AIK, MORA, ÖIK, ...). Required: the directory pages unreliably league-wide.

order_by

Sort: familyName or firstName. Allowed: familyName, firstName.

search_query

Free-text name search; omitted = everyone. NULL = not sent.

return_parsed

Parse the payload into a tibble (default TRUE). Pass FALSE for the raw JSON as a list (stamped with the request under _request where the body does not say what it answers).

Value

A tibble (return_parsed = TRUE), else the raw JSON list:

col_nametypedescription
family_namecharacterFamily name of the player.
first_namecharacterFirst name of the player.
player_cms_idintegerCMS (Strapi) record id of the player (not the StatNet id).
player_document_idcharacterCMS (Strapi) document id of the player.
headshots_largecharacterHeadshot URL (large rendition).
headshots_smallcharacterHeadshot URL (small rendition).
headshots_thumbcharacterHeadshot URL (thumb rendition).
headshots_mediumcharacterHeadshot URL (medium rendition).
position_codecharacterPlaying position code (CE centre, LW left wing, ...); positionName spells it out in English.
jersey_numberintegerJersey number of the player.
birth_datecharacterBirth date, YYYY-MM-DD.
countrycharacterNationality, IOC/ISO alpha-3 code (SWE, NOR).
heightintegerPlayer height in centimetres.
weightintegerPlayer weight in kilograms.
shootscharacterShoots / catches: L or R.
youth_teamcharacterYouth (development) club.
is_rookielogicalTrue when the CMS directory flags the player as a rookie.
team_playercharacterCard label 'TEAM // POS JERSEY // Family name'.
slugcharacterPlayer slug; joins ha_leaders.
position_namecharacterPlaying position, English label (Center, Left Wing, ...).
team_cms_idintegerCMS (Strapi) record id of the team (81 = AIK).
team_document_idcharacterCMS (Strapi) document id of the team.
team_codecharacterDisplay code of the team (AIK, MoDo, MORA, NVIF, ÖIK), not the StatNet id.
team_main_color_hexcharacterPrimary colour of the team (hex).
team_namecharacterTeam label as shown on the card (the display team code).
team_logo_urlcharacterLogo URL of the team.

Errors

fastRhockey_no_data: the site has nothing for the request (a season before 2005/06, an unknown or pre-2025/26 game, a phase not played, a body without rows). fastRhockey_bad_request: a value outside its enumerated set, a field the site requires is missing, or HTTP 400/422. fastRhockey_asset_fetch: any other non-2xx, a connection failure after retries, or an empty, non-JSON, error-shaped, truncated or out-of-scope 200 (the answer is unknown, not empty).

Examples

# \donttest{
  try(ha_players(team = "AIK"))
#> ── HA Players Information from hockeyallsvenskan.se ── fastRhockey 1.0.0.9000 ──
#> ℹ Data updated: 2026-10-13 01:54:14 UTC
#> # A tibble: 29 × 26
#>    family_name first_name  player_cms_id player_document_id      headshots_large
#>    <chr>       <chr>               <int> <chr>                   <chr>          
#>  1 Bengtsson   Christopher          2690 xk3ojogy15d4kcx4htv30z… https://ha-med…
#>  2 Björk       Christoffer          2695 b4b8exr9vlq9vw3m7s32jb… https://ha-med…
#>  3 Boije       Sid                  2368 vom6f8tbmwfffw44no38p8… NA             
#>  4 Brattström  Victor               2683 dawjoxbwz5xzrjaa5578ob… https://ha-med…
#>  5 Contreras   Leon                 2082 i6q1jra32l6tvt0givzw8a… NA             
#>  6 Enroth      Jhonas               2685 l8adior0jcfjisdz9r15aa… https://ha-med…
#>  7 Eriksson    Max                  1810 nei92n4kb77qrjtzv1guwr… NA             
#>  8 Grönlund    Anders               2700 hqg7rjrije0l5ku3dcrh1q… https://ha-med…
#>  9 Hellgren    Ludwig               1999 x4wyyhq9avlg3a2ege8tro… NA             
#> 10 Isén        Edvin                2701 u866bnxgqrns6wk5zkiplf… https://ha-med…
#> # ℹ 19 more rows
#> # ℹ 21 more variables: headshots_small <chr>, headshots_thumb <chr>,
#> #   headshots_medium <chr>, position_code <chr>, jersey_number <int>,
#> #   birth_date <chr>, country <chr>, height <int>, weight <int>, shoots <chr>,
#> #   youth_team <chr>, is_rookie <lgl>, team_player <chr>, slug <chr>,
#> #   position_name <chr>, team_cms_id <int>, team_document_id <chr>,
#> #   team_code <chr>, team_main_color_hex <chr>, team_name <chr>, …
# }