Skip to contents

Club CMS record: names, logo, website, ticket links.

Usage

nl_team_info(team_id, return_parsed = TRUE)

Arguments

team_id

SIHF team id (team_id in nl_standings(); the same id as the SIHF family's team_id), e.g. 101144 (EV Zug). A whole number or a digit string.

return_parsed

Logical. TRUE (the default) returns the fastRhockey_data tibble; FALSE returns the raw JSON body as a nested list (api keys already dropped).

Value

A fastRhockey_data tibble (27 columns) with the columns below, or the raw JSON body when return_parsed = FALSE. A valid but empty payload returns a zero-row tibble with these columns.

col_nametypedescription
namecharacterClub name from the club's CMS record
cms_node_idnumericUmbraco CMS node id of the club page (whole number; not a team id).
url_segmentcharacterURL slug of the club page
typecharacterCMS node kind ('Content')
content_typecharacterCMS document type ('club')
urlcharacterSite path of the club page
fields_gridcharacterPage layout blocks; unobserved: null or empty in every sampled row
fields_logo_namecharacterTitle of the club logo media item in the club CMS
fields_logo_idnumericUmbraco CMS media id; not a team id
fields_logo_url_segmentcharacterURL slug; unobserved: null or empty in every sampled row
fields_logo_typecharacterCMS node kind ('Media')
fields_logo_content_typecharacterMedia kind ('Image')
fields_logo_urlcharacterSite path of the image
fields_logo_fields_umbraco_file_srccharacterSite path of the file
fields_logo_fields_umbraco_file_focal_pointcharacterCrop focal point; unobserved: null or empty in every sampled row
fields_logo_fields_umbraco_file_cropscharacterCrop presets; unobserved: null or empty in every sampled row
fields_logo_fields_umbraco_widthintegerImage width, pixels
fields_logo_fields_umbraco_heightintegerImage height, pixels
fields_logo_fields_umbraco_bytesnumericFile size, bytes
fields_logo_fields_umbraco_extensioncharacterFile extension of the club logo media file
team_idnumericSIHF team id (whole number; e.g. 101151 = HC Davos). The same key space as the sihf family's team_id.
fields_websitecharacterClub website URL
fields_ticket_urlcharacterClub ticket-shop URL
fields_game_ticket_urlcharacterPer-game ticket URL template; empty string in the sample
fields_overriden_namecharacterDisplay-name override (sic); empty string in the sample
fields_playerscharacterRoster override; empty string in the sample
fields_api_namecharacterClub key in the app's backend (e.g. 'evz')

Details

Polite use. www.nationalleague.ch/robots.txt disallows /api, so keep use light and incremental. Requests are spaced at least one second apart (on every attempt, retries included). Check the site's terms of use before any bulk download or redistribution. Crawl incrementally: fetch a finished game once (keyed by game_id), find new games with one nl_schedule() call per run, and fetch season tables at most once per game day.

Seasons are END years and go on the wire unchanged. Ids (*_id) are whole-number numeric (a 14-digit game_id exceeds R's 32-bit integer); every other whole-number column is integer. The club backend key the API ships in /teams/{id}/info is dropped before parsing and never returned.

Endpoint: GET https://www.nationalleague.ch/api/teams/{teamId}/info.

Errors

Raises a classed condition (all inherit fastRhockey_error): fastRhockey_no_data for a 404 or an empty answer (no games or rows for that season, team or phase), fastRhockey_asset_fetch for a failed fetch, an error object in a 200, a body without the ids it must carry, or an answer for another season, team, game or player, and fastRhockey_bad_request for a 400/422 or an argument that is not a whole number.

Examples

# \donttest{
  try(nl_team_info(team_id = 101144))
#> ── National League Team Info Information from nationalleague.ch ────────────────
#> ℹ Data updated: 2026-11-02 03:51:59 UTC
#> # A tibble: 1 × 27
#>   name   cms_node_id url_segment type    content_type url            fields_grid
#>   <chr>        <dbl> <chr>       <chr>   <chr>        <chr>          <chr>      
#> 1 EV Zug        1627 ev-zug      Content club         /clubs/ev-zug/ []         
#> # ℹ 20 more variables: fields_logo_name <chr>, fields_logo_id <dbl>,
#> #   fields_logo_url_segment <chr>, fields_logo_type <chr>,
#> #   fields_logo_content_type <chr>, fields_logo_url <chr>,
#> #   fields_logo_fields_umbraco_file_src <chr>,
#> #   fields_logo_fields_umbraco_file_focal_point <chr>,
#> #   fields_logo_fields_umbraco_file_crops <chr>,
#> #   fields_logo_fields_umbraco_width <int>, …
# }