Skip to contents

Games (schedule and results) of a season from get_rencontres, requested as one page (par_page = 700) that must be the whole list: a partial page is fastRhockey_asset_fetch, never returned as a whole schedule. get_rencontres publishes local times; a round body publishes UTC: both land in game_datetime as Europe/Paris. Scores are matched to the home and away teams by team id (score[] is not home-first and some finished games list extra 0-goal rows for teams that did not play); goals are NA until the game starts (unplayed games publish a 0-0 placeholder).

Usage

magnus_schedule(
  season,
  phase_id = NULL,
  team_id = NULL,
  start_date = NULL,
  end_date = NULL,
  round = NULL,
  return_parsed = TRUE
)

Arguments

season

Season by its END year (2027 = 2026-27), sent as the season's competition_id. Coverage starts in 2020-21 (2021); an earlier season, or one the federation does not list, is fastRhockey_no_data.

phase_id

Phase id (phase_id of magnus_phases()). Omitted: every phase of the competition.

team_id

Team id (team_id of magnus_teams()): that team's games only.

start_date

Earliest game date, YYYY-MM-DD (a string or a Date).

end_date

Latest game date, YYYY-MM-DD (a string or a Date).

round

Round number (tour): that round's games only. Shadows the base function.

return_parsed

Parse the payload into a tibble (default TRUE). Pass FALSE for the raw JSON envelope as a list.

Value

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

col_nametypedescription
game_idintegerGame id (integer join key), the game_id argument of magnus_game, magnus_pbp, magnus_lineups and magnus_shootout.
seasonintegerSeason by its END year (2027 = 2026-27).
competition_idintegerCompetition (season) id (integer).
phase_idintegerPhase id (integer; regular season, playoffs, relegation).
phasecharacterPhase name in French (e.g., "Saison régulière").
roundintegerRound (journée) number within the phase.
game_datetimePOSIXctScheduled start, Europe/Paris time (get_rencontres publishes local time, a round body UTC; both are converted).
statuscharacterGame state: final, in_progress or scheduled.
decisioncharacterHow a final game was decided: regulation, overtime or shootout; null until the game is final (round bodies carry no decision, so null there too).
home_team_idintegerTeam id of the home team (integer).
home_teamcharacterDisplay name of the home team.
home_team_abbreviationcharacterAbbreviation of the home team.
away_team_idintegerTeam id of the away team (integer).
away_teamcharacterDisplay name of the away team.
away_team_abbreviationcharacterAbbreviation of the away team.
home_scoreintegerGoals of the home team (shootout winner included in the final score); null until the game starts (unplayed games publish a 0-0 placeholder).
away_scoreintegerGoals of the away team; null until the game starts.
home_team_participant_idintegerTeam participant id of the home team in this phase (integer; its own key space, joins team_participant_id of the standings; not a team id).
away_team_participant_idintegerTeam participant id of the away team in this phase (integer; joins team_participant_id of the standings).
venue_idintegerRink id (integer).
venuecharacterName of the rink (arena).
game_labelcharacterGame label as published ("HOME / AWAY").

Examples

# \donttest{
  try(magnus_schedule(season = 2027, phase_id = 714, round = 2))
#> Error in .euro_check_status(resp) : 
#>   liguemagnus.com/wp-admin/admin-ajax.php answered HTTP 403:
#> <html><body><h1>403 Forbidden</h1> Request forbidden by administrative rules.
#> Interdiction d'acceder a cette ressource </body></html>
# }