Title: Scraper for National Hockey League Data
Version: 0.2.0
Description: Scrapes data from the 'NHL' and 'ESPN' APIs into 'tibble's. It primarily wraps endpoints documented by Zach Maludzinski (2023) https://github.com/Zmalski/NHL-API-Reference, Drew Hynes (2018) https://gitlab.com/dword4/nhlapi/, and Joseph Wilson (2023) https://github.com/pseudo-r/Public-ESPN-API, covering data from high-level multi-season summaries and award winners to low-level play-by-play logs and sports books' odds.
License: MIT + file LICENSE
Encoding: UTF-8
RoxygenNote: 7.3.2
Imports: httr (≥ 1.4.0), jsonlite (≥ 2.0.0), dplyr (≥ 1.1.0), tibble (≥ 3.3.0), magrittr (≥ 2.0.0)
Suggests: testthat (≥ 3.0.0), knitr (≥ 1.50.0), rmarkdown (≥ 2.29.0)
Config/testthat/edition: 3
VignetteBuilder: knitr
URL: https://github.com/RentoSaijo/nhlscraper, https://rentosaijo.github.io/nhlscraper/
BugReports: https://github.com/RentoSaijo/nhlscraper/issues
Copyright: Copyright: NHL and the NHL Shield are registered trademarks of the National Hockey League. NHL and NHL team marks are the property of the NHL and its teams.
NeedsCompilation: no
Packaged: 2025-07-17 12:08:45 UTC; rsai_91
Author: Rento Saijo ORCID iD [aut, cre, cph], Lars Skytte [ctb]
Maintainer: Rento Saijo <rentosaijo0527@gmail.com>
Repository: CRAN
Date/Publication: 2025-07-17 12:40:02 UTC

Call ESPN API

Description

Call ESPN API

Usage

espn_api(path, query = list(), type)

Arguments

path

String

query

list

type

integer where 1=site.api and 2=sports.core

Value

parsed JSON


Get attendance for all seasons

Description

get_attendance() retrieves information on each season, including but not limited to their ID and regular and playoff attendance. May soon be merged with get_seasons().

Usage

get_attendance()

Value

tibble with one row per season

Examples

all_attendance <- get_attendance()

Get all award winners/finalists

Description

get_award_winners() retrieves information on each award winner or finalist, including but not limited to their player, trophy, and season IDs; name; and vote count.

Usage

get_award_winners()

Value

tibble with one row per winner/finalist

Examples

all_award_winners <- get_award_winners()

Get all awards

Description

get_awards() retrieves information on each award, including but not limited to their trophy ID, name, description, creation date, and image URL.

Usage

get_awards()

Value

tibble with one row per award

Examples

all_awards <- get_awards()

Get bracket by season

Description

get_bracket() retrieves information on each series for a given season, including but not limited to their title, abbreviation, 1-letter code, round, top and bottom seeds, and winning and losing teams' IDs. Access get_seasons() for season reference.

Usage

get_bracket(season = get_season_now()$seasonId - 1)

Arguments

season

integer in YYYYYYYY

Value

tibble with one row per series

Examples

bracket_20242025 <- get_bracket(season=20242025)

Get configuration for skater, goalie, and team statistics

Description

get_configuration() retrieves information on the outputs of the possible combinations of inputs for get_team_statistics(), get_skater_statistics(), and get_goalie_statistics().

Usage

get_configuration()

Value

list with 5 items

Examples

config <- get_configuration()

Get all countries

Description

get_countries() retrieves information on each country, including but not limited to their ID, name, 2-letter code, and 3-letter code.

Usage

get_countries()

Value

tibble with one row per country

Examples

all_countries <- get_countries()

Get all draft picks

Description

get_draft_picks() retrieves information on each selection, including but not limited to their player ID, name, draft year, overall number, bio-metrics, and the pick's team history.

Usage

get_draft_picks()

Value

tibble with one row per pick

Examples

all_draft_picks <- get_draft_picks()

Get draft rankings by year and player-type

Description

get_draft_rankings() retrieves information on each prospect for a given set of year and player_type, including but not limited to their name, midterm and final ranks, position, bio-metrics, and birth date and location.

Usage

get_draft_rankings(year = get_season_now()$seasonId%/%10000, player_type = 1)

Arguments

year

integer in YYYY

player_type

integer where 1=North American Skaters, 2=International Skaters, 3=North American Goalies, and 4=International Goalies

Value

tibble with one row per player

Examples

draft_rankings_2025_1 <- get_draft_rankings(year=2025, player_type=1)

Get draft tracker as of now

Description

get_draft_tracker() retrieves information on the latest draft, including but not limited to each pick's team ID, name, and overall number and selected player's name and position.

Usage

get_draft_tracker()

Value

tibble with one row per pick

Examples

draft_tracker <- get_draft_tracker()

Get all drafts

Description

get_drafts() retrieves information on each draft, including but not limited to their year, type, venue, minimum and maximum player ages, and number of rounds and picks.

Usage

get_drafts()

Value

tibble with one row per draft

Examples

all_drafts <- get_drafts()

Get athlete (player) by ESPN Athlete (Player) ID and season

Description

get_espn_athlete() retrieves information on an athlete for a given season, including but not limited to his name, bio-metrics, birth date and location, position, team(s), and jersey number. Access get_espn_athletes() for athlete and get_seasons() for season references.

Usage

get_espn_athlete(
  athlete = 3988803,
  season = get_season_now()$seasonId%%10000
)

Arguments

athlete

integer ESPN Athlete (Player) ID

season

integer Season in YYYY

Value

list with various items

Examples

ESPN_Charlie_McAvoy_20242025 <- get_espn_athlete(athlete=3988803, season=2025)

Get all ESPN athletes

Description

get_espn_athletes() retrieves ESPN hyperlinks for each athlete; the hyperlinks are formatted in ⁠base/athletes/{ESPN Athlete ID}?query⁠. May soon be reworked to only return the ESPN Athlete IDs.

Usage

get_espn_athletes()

Value

tibble with one row per athlete

Examples

all_ESPN_athletes <- get_espn_athletes()

Get coach by ESPN Coach ID (and season)

Description

get_espn_coach() retrieves information on a coach for a given season or all seasons, including but not limited to his or her name and head-shot URL. Access get_espn_coaches() for coach and get_seasons() for season references.

Usage

get_espn_coach(coach = 5033, season = "all")

Arguments

coach

integer ESPN Coach ID

season

integer/string in YYYY or 'all'

Value

list with various items

Examples

ESPN_Paul_Maurice <- get_espn_coach(coach=5033, season='all')

Get career coaching records by ESPN Coach ID and game-type

Description

get_espn_coach_career() retrieves information on each statistic for a given set of coach and game_type, including but not limited to their name, abbreviation, description, and value. Access get_espn_coaches() for coach reference.

Usage

get_espn_coach_career(coach = 5033, game_type = 0)

Arguments

coach

integer ESPN Coach ID

game_type

integer where 0=total, 1=regular, and 2=playoffs

Value

tibble with one row per statistic

Examples

ESPN_Paul_Maurice_career <- get_espn_coach_career(coach=5033, game_type=0)

Get ESPN coaches by season

Description

get_espn_coaches() retrieves ESPN hyperlinks for each coach for a given season; the hyperlinks are formatted in ⁠base/seasons/{ESPN Season ID}/coaches/{ESPN Coach ID}?query⁠. Access get_seasons() for season reference. May soon be reworked to only return the ESPN Coach IDs.

Usage

get_espn_coaches(season = get_season_now()$seasonId%%10000)

Arguments

season

integer in YYYY

Value

tibble with one row per coach

Examples

ESPN_coaches_20242025 <- get_espn_coaches(2025)

Get event (game) by ESPN ID

Description

get_espn_event() retrieves information on an event, including but not limited to its competitors, date, venue, and attendance.

Usage

get_espn_event(event = 401687600)

Arguments

event

integer ESPN Event (Game) ID

Value

list with various items

Examples

NJD_BUF_2024_10_04 <- get_espn_event(event=401687600)

Get event (game) odds by ESPN Event (Game) ID

Description

get_espn_event_odds() retrieves information on each provider for a given event, including but not limited to its name, favorite and underdog teams, and money-line and spread odds. Access get_espn_events() for event reference.

Usage

get_espn_event_odds(event = 401687600)

Arguments

event

integer ESPN Event (Game) ID

Value

tibble with one row per provider

Examples

NJD_BUF_2024_10_04_odds <- get_espn_event_odds(event=401687600)

Get event (game) officials by ESPN Event (Game) ID

Description

get_espn_event_officials() retrieves information on each official for a given event, including but not limited to its ESPN ID, name, and position. Access get_espn_events() for event reference.

Usage

get_espn_event_officials(event = 401687600)

Arguments

event

integer ESPN Event (Game) ID

Value

tibble with one row per official

Examples

NJD_BUF_2024_10_04_officials <- get_espn_event_officials(event=401687600)

Get event (game) play-by-play by ESPN Event (Game) ID

Description

get_espn_event_play_by_play() retrieves ESPN-provided information on each play for a given event, including but not limited to their ID, type, time of occurrence, strength-state, participants, and X and Y coordinates. Access get_espn_events() for event reference.

Usage

get_espn_event_play_by_play(event = 401687600)

Arguments

event

integer ESPN Event (Game) ID

Value

tibble with one row per play

Examples

NJD_BUF_2024_10_04_pbp <- get_espn_event_play_by_play(event=401687600)

Get event (game) stars by ESPN Event (Game) ID

Description

get_espn_event_stars() retrieves information on each star for a given event, including but not limited to its name, description, and the athlete's ESPN ID. Access get_espn_events() for event reference.

Usage

get_espn_event_stars(event = 401687600)

Arguments

event

integer ESPN Event (Game) ID

Value

tibble with one row per athlete

Examples

NJD_BUF_2024_10_04_stars <- get_espn_event_stars(event=401687600)

Get ESPN events (games) by start and end dates

Description

get_espn_events() retrieves ESPN hyperlinks for each event; the hyperlinks are formatted in ⁠base/events/{ESPN Event ID}?query⁠. Access get_seasons() for start_season and end_season references. May soon be reworked to only return the ESPN Event IDs.

Usage

get_espn_events(start_date = 20241004, end_date = 20250624)

Arguments

start_date

integer Start Date in YYYYMMDD

end_date

integer End Date in YYYYMMDD

Value

tibble with one row per event (game)

Examples

ESPN_events_20242025 <- get_espn_events(start_date=20241004, end_date=20250624)

Get ESPN futures by season

Description

get_espn_futures() retrieves futures by type for a given season.

Usage

get_espn_futures(season = get_season_now()$seasonId%%10000)

Arguments

season

integer Season in YYYY

Value

nested tibble with one row per type and book

Examples

ESPN_futures_20252026 <- get_espn_futures(2026)

Get ESPN injury reports as of now

Description

get_espn_injuries() retrieves injury reports by team.

Usage

get_espn_injuries()

Value

nested tibble with one row per team and player

Examples

ESPN_injuries_now <- get_espn_injuries()

Get team by season and ESPN Team ID

Description

get_espn_team() retrieves information on a team for a given season, including but not limited to its name and logo URL. Access get_espn_teams() for team and get_seasons() for season references.

Usage

get_espn_team(team = 1, season = get_season_now()$seasonId%%10000)

Arguments

team

integer ESPN Team ID

season

integer Season in YYYY

Value

list with various items

Examples

ESPN_BOS_20242025 <- get_espn_team(team=1, season=2025)

Get ESPN teams by season

Description

get_espn_teams() retrieves ESPN hyperlinks for each team for a given season; the hyperlinks are formatted in ⁠base/seasons/{ESPN Season ID}/coaches/{ESPN Team ID}?query⁠. Access get_seasons() for season reference. May soon be reworked to only return the ESPN Team IDs.

Usage

get_espn_teams(season = get_season_now()$seasonId%%10000)

Arguments

season

integer Season in YYYY

Value

tibble with one row per team

Examples

ESPN_teams_20242025 <- get_espn_teams(2025)

Get ESPN transactions by start and end dates

Description

get_espn_transactions() retrieves information on each transaction for a given set of start_date and end_date, including but not limited to their date, description, and involved teams. Access get_seasons() for start_season and end_season references.

Usage

get_espn_transactions(start_date = 20241004, end_date = 20250624)

Arguments

start_date

integer Start Date in YYYYMMDD

end_date

integer End Date in YYYYMMDD

Value

tibble with one row per transaction

Examples

ESPN_transactions_20242025 <- get_espn_transactions(start_date=20241004, end_date=20250624)

Get all franchises' season-by-season results

Description

get_franchise_season_by_season() retrieves information on each franchise's season, including but not limited to their ID, decision, final playoff round, and statistics.

Usage

get_franchise_season_by_season()

Value

tibble with one row per franchise's season

Examples

all_franchise_sbs <- get_franchise_season_by_season()

Get all franchises' teams' all-time totals

Description

get_franchise_team_totals() retrieves information on each team, including but not limited to their ID, first and last seasons' IDs, and all-time statistics.

Usage

get_franchise_team_totals()

Value

tibble with one row per team

Examples

all_franchise_team_totals <- get_franchise_team_totals()

Get all franchises' all-time records versus other franchises

Description

get_franchise_vs_franchise() retrieves information on each franchise versus another franchise, including but not limited to their IDs, game-type ID, and all-time statistics.

Usage

get_franchise_vs_franchise()

Value

tibble with one row per franchise versus franchise

Examples

franchise_vs_franchise <- get_franchise_vs_franchise()

Get all franchises

Description

get_franchises() retrieves information on each franchise, including but not limited to their ID; first and last seasons' IDs; captain, coach, and general manager histories; and retired numbers.

Usage

get_franchises()

Value

tibble with one row per franchise

Examples

all_franchises <- get_franchises()

Get boxscore by game, team, and player-type

Description

get_game_boxscore() retrieves information on each player for a given set of game, team, and player_type, including but not limited to their ID, name, sweater number, goals, assists, +/-, hits, blocks, shots-on-goal, giveaways, takeaways, time on ice, and number of shifts. Access get_games() for game reference.

Usage

get_game_boxscore(game = 2024020602, team = "home", player_type = "forwards")

Arguments

game

integer Game ID

team

string of 'home' or 'away'

player_type

string of 'forwards', 'defense', or 'goalies'

Value

tibble with one row per player

Examples

boxscore_2024030411_FLA_defensemen <- get_game_boxscore(
  game=2024030411,
  team='away',
  player_type='defense'
)

Get GameCenter (GC) game-landing by game

Description

get_game_landing() retrieves GC-provided information on a game, including but not limited to its type, venue, start time, clock, home and away teams, and TV broadcast(s). Access get_games() for game reference.

Usage

get_game_landing(game = 2024020602)

Arguments

game

integer Game ID

Value

list of various items

Examples

game_landing_2024030411 <- get_game_landing(game=2024030411)

Get World Showcase (WSC) game-story by game

Description

get_game_story() retrieves WSC-provided information on a game, including but not limited to its type, venue, start time, clock, home and away teams, and TV broadcast(s). Access get_games() for game reference.

Usage

get_game_story(game = 2024020602)

Arguments

game

integer Game ID

Value

list of various items

Examples

game_story_2024030411 <- get_game_story(game=2024030411)

Get all games

Description

get_games() retrieves information on each game, including but not limited to their ID, season, type, start date and time, and home and visiting teams' IDs and scores.

Usage

get_games()

Value

tibble with one row per game

Examples

# This may take >5s, so skip.

  all_games <- get_games()


Get GameCenter (GC) play-by-play by game

Description

get_gc_play_by_play() retrieves GC-provided information on each play for a given game, including but not limited to their ID; type; time of occurrence; winning, losing, blocking, shooting, hitting, hit, scoring, assisting, committed-by, drawn-by, and/or served-by player IDs; and X and Y coordinates. Access get_games() for game reference.

Usage

get_gc_play_by_play(game = 2024020602)

Arguments

game

integer Game ID

Value

tibble with one row per play

Examples

gc_pbp_2024030411 <- get_gc_play_by_play(game=2024030411)

Get glossary

Description

get_glossary() retrieves information on each terminology, including but not limited to their definition and abbreviation.

Usage

get_glossary()

Value

tibble with one row per terminology

Examples

glossary <- get_glossary()

Get goalie statistics leaders by season, game-type, and category

Description

get_goalie_leaders() retrieves information on each goalie for a given set of season, game_type, and category, including but not limited to their ID, name, and statistics. Access get_seasons() for season reference.

Usage

get_goalie_leaders(
  season = get_season_now()$seasonId,
  game_type = 2,
  category = "wins"
)

Arguments

season

integer in YYYYYYYY

game_type

integer where 2=regular and 3=playoffs

category

string of 'wins', 'shutouts', 'savePctg', or 'goalsAgainstAverage'

Value

tibble with one row per goalie

Examples

playoff_savePctg_leaders_20242025 <- get_goalie_leaders(
  season=20242025,
  game_type=3,
  category='savePctg'
)

Get goalie milestones

Description

get_goalie_milestones() retrieves information on each goalie close to a milestone, including but not limited to their ID, name, and statistics.

Usage

get_goalie_milestones()

Value

tibble with one row per goalie

Examples

goalie_milestones <- get_goalie_milestones()

Get goalie statistics

Description

get_goalie_statistics() retrieves information on each goalie or game for a given set of season, teams, game_types, and report. dates must be given when paired with is_game as the default range will return incomplete data (too wide). Access get_configuration() for what information each combination of report, is_aggregate and is_game can provide. Access get_seasons() for season and dates and get_teams() for teams references. Will soon be reworked for easier access.

Usage

get_goalie_statistics(
  season = get_season_now()$seasonId,
  teams = 1:100,
  game_types = 1:3,
  dates = c("2025-01-01"),
  report = "summary",
  is_aggregate = FALSE,
  is_game = FALSE
)

Arguments

season

integer in YYYYYYYY

teams

vector of integers Team ID(s)

game_types

vector of integers where 1=pre-season, 2=regular, and 3=playoffs

dates

vector of strings in 'YYYY-MM-DD'

report

string

is_aggregate

boolean

is_game

boolean

Value

tibble with one row per goalie or game

Examples

playoff_goalie_svr_20242025 <- get_goalie_statistics(
  season=20242025,
  teams=1:100,
  game_types=c(3),
  report='startedVsRelieved'
)

Get goalies' biographies by range of seasons

Description

get_goalies() retrieves information on each goalie for a given set of start_season and end_season, including but not limited to their ID, name, bio-metrics, and career statistics. Access get_seasons() for start_season and end_season references. Will soon be deprecated as get_players() can list all players and their IDs much more efficiently.

Usage

get_goalies(start_season = 19171918, end_season = get_season_now()$seasonId)

Arguments

start_season

integer in YYYYYYYY

end_season

integer in YYYYYYYY

Value

tibble with one row per goalie

Examples

goalies_2000s <- get_goalies(start_season=20002001, end_season=20242025)

Get all officials

Description

get_officials() retrieves information on each official, including but not limited to their ID, name, and birth date and location.

Usage

get_officials()

Value

tibble with one row per official

Examples

all_officials <- get_officials()

Get partner odds as of now

Description

get_partner_odds() retrieves partner-provided information on each game for a given country, including but not limited to their ID and home and away team odds. Access get_countries() for country reference.

Usage

get_partner_odds(country = "US")

Arguments

country

string 2-letter Code

Value

tibble with one row per game

Examples

partner_odds_now_CA <- get_partner_odds(country='CA')

Get game-log by player, season, and game-type

Description

get_player_game_log() retrieves information on each game for a given set of player, season, and game_type, including but not limited to their ID, date, and statistics. Access get_players() for player and get_seasons() for season references.

Usage

get_player_game_log(
  player = 8480039,
  season = get_season_now()$seasonId,
  game_type = 2
)

Arguments

player

integer Player ID

season

integer in YYYYYYYY

game_type

integer where 2=regular and 3=playoffs

Value

tibble with one row per game

Examples

playoff_Mikko_Rantanen_gl_20242025 <- get_player_game_log(
  player=8478420,
  season=20242025,
  game_type=3
)

Get landing by player

Description

get_player_landing() retrieves information on a player, including but not limited to his ID, name, bio-metrics, career statistics, and awards. Access get_players() for player reference.

Usage

get_player_landing(player = 8480039)

Arguments

player

integer Player ID

Value

list with various items

Examples

Mikko_Rantanen_landing <- get_player_landing(player=8478420)

Get all players

Description

get_players() retrieves information on each player, including but not limited to their ID, name, bio-metrics, birth date and location, and hall-of-fame status.

Usage

get_players()

Value

tibble with one row per player

Examples

# This may take >5s, so skip.

  all_players <- get_players()


Get schedule by date

Description

get_schedule() retrieves information on each game for a given date, including but not limited to their ID; type; venue; start time; tickets link; and home and away teams' IDs, names, and scores. Access get_seasons() for date reference. Unable to conclude any major difference versus get_scores(); may soon be deprecated.

Usage

get_schedule(date = "2025-01-01")

Arguments

date

string in 'YYYY-MM-DD'

Value

tibble with one row per game

Examples

schedule_2025_01_02 <- get_schedule(date='2025-01-02')

Get scoreboard(s) by date

Description

get_scoreboards() retrieves information on each game for a given date, including but not limited to their ID; type; venue; start time; tickets link; and home and away teams' IDs, names, and scores. Access get_seasons() for date reference. Unable to conclude any major difference versus get_scores(); may soon be deprecated.

Usage

get_scoreboards(date = "2025-01-01")

Arguments

date

string in 'YYYY-MM-DD'

Value

tibble with one row per game

Examples

scoreboards_2025_01_02 <- get_scoreboards(date='2025-01-02')

Get score(s) by date

Description

get_scores() retrieves information on each game for a given date, including but not limited to their ID; type; venue; start time; period and intermission clocks; and home and away teams' IDs, names, and scores. Access get_seasons() for date reference.

Usage

get_scores(date = "2025-01-01")

Arguments

date

string in 'YYYY-MM-DD'

Value

tibble with one row per game

Examples

scores_2025_01_02 <- get_scores(date='2025-01-02')

Get season as of now

Description

get_season_now() retrieves information on the current season, including but not limited to its ID and game-type.

Usage

get_season_now()

Value

tibble with one row

Examples

season_now <- get_season_now()

Get all seasons

Description

get_seasons() retrieves information on each season, including but not limited to their ID; start and end dates; number of regular season and playoff games; Stanley Cup owner; Olympics participation; entry and supplemental draft, conference-division, win-tie-loss, and wildcard regulations.

Usage

get_seasons()

Value

tibble with one row per season

Examples

all_seasons <- get_seasons()

Get series by season and round

Description

get_series() retrieves information on each series for a given set of season and round, including but not limited to their label, 1-letter code, top and bottom seeds, and winning and losing teams' IDs. Access get_seasons() for season reference.

Usage

get_series(season = get_season_now()$seasonId, round = 1)

Arguments

season

integer in YYYYYYYY

round

integer of 1:4

Value

tibble with one row per series

Examples

CF_series_20242025 <- get_series(season=20242025, round=3)

Get schedule by season and series

Description

get_series_schedule() retrieves information on each game for a given set of season and series, including but not limited to their ID; venue; start date and time; and home and away teams' IDs, names, and scores. Access get_seasons() for season and get_bracket() for series references.

Usage

get_series_schedule(season = get_season_now()$seasonId, series = "a")

Arguments

season

integer in YYYYYYYY

series

string 1-letter Code

Value

tibble with one row per game

Examples

COL_DAL_schedule_20242025 <- get_series_schedule(season=20242025, series='f')

Get shift charts

Description

get_shift_charts() retrieves information on each shift for a given game, including but not limited to their period, start and end times, and player's ID and name. Access get_games() for game reference.

Usage

get_shift_charts(game = 2024020602)

Arguments

game

integer Game ID

Value

tibble with one row per shift

Examples

shift_charts_2024030411 <- get_shift_charts(game=2024030411)

Get skater statistics leaders by season, game-type, and category

Description

get_skater_leaders() retrieves information on each skater for a given set of season, game_type, and category, including but not limited to their ID, name, and statistics. Access get_seasons() for season reference.

Usage

get_skater_leaders(
  season = get_season_now()$seasonId,
  game_type = 2,
  category = "points"
)

Arguments

season

integer in YYYYYYYY

game_type

integer where 2=regular and 3=playoffs

category

string of 'assists', 'goals', 'goalsSh', 'goalsPp', 'points', 'penaltyMins', 'toi', 'plusMinus', or 'faceoffLeaders'

Value

tibble with one row per skater

Examples

playoff_toi_leaders_20242025 <- get_skater_leaders(
  season=20242025,
  game_type=3,
  category='toi'
)

Get skater milestones

Description

get_skater_milestones() retrieves information on each skater close to a milestone, including but not limited to their ID, name, and statistics.

Usage

get_skater_milestones()

Value

tibble with one row per skater

Examples

skater_milestones <- get_skater_milestones()

Get skater statistics

Description

get_skater_statistics() retrieves information on each skater or game for a given set of season, teams, game_types, and report. dates must be given when paired with is_game as the default range will return incomplete data (too wide). Access get_configuration() for what information each combination of report, is_aggregate and is_game can provide. Access get_seasons() for season and dates and get_teams() for teams references. Will soon be reworked for easier access.

Usage

get_skater_statistics(
  season = get_season_now()$seasonId,
  teams = 1:100,
  game_types = 1:3,
  dates = c("2025-01-01"),
  report = "summary",
  is_aggregate = FALSE,
  is_game = FALSE
)

Arguments

season

integer in YYYYYYYY

teams

vector of integers Team ID(s)

game_types

vector of integers where 1=pre-season, 2=regular, and 3=playoffs

dates

vector of strings in 'YYYY-MM-DD'

report

string

is_aggregate

boolean

is_game

boolean

Value

tibble with one row per skater or game

Examples

regular_skater_shootout_20242025 <- get_skater_statistics(
  season=20242025,
  game_types=c(2),
  report='shootout'
)

Get skaters' biographies by range of seasons

Description

get_skaters() retrieves information on each skater for a given set of start_season and end_season, including but not limited to their ID, name, bio-metrics, and career statistics. Access get_seasons() for start_season and end_season references. Will soon be deprecated as get_players() can list all players and their IDs much more efficiently.

Usage

get_skaters(start_season = 19171918, end_season = get_season_now()$seasonId)

Arguments

start_season

integer in YYYYYYYY

end_season

integer in YYYYYYYY

Value

tibble with one row per skater

Examples

skaters_2000s <- get_skaters(start_season=20002001, end_season=20242025)

Get 'spotlight' players as of now

Description

get_spotlight_players() retrieves information on each 'spotlight' player, including but not limited to their ID, name, position, and sweater number.

Usage

get_spotlight_players()

Value

tibble with one row per player

Examples

spotlight_players_now <- get_spotlight_players()

Get standings by date

Description

get_standings() retrieves information on each team for a given date, including but not limited to their ID; name; conference; division; season, recent, and home-away statistics; and waiver sequence. Access get_seasons() for date reference.

Usage

get_standings(date = "2025-01-01")

Arguments

date

string in 'YYYY-MM-DD'

Value

tibble with one row per team

Examples

standings_2025_01_02 <- get_standings(date='2025-01-02')

Get standings information for all seasons

Description

get_standings_information() retrieves information on each season, including but not limited to their ID; start and end dates for standings; and conference-division, win-tie-loss, and wildcard regulations. May soon be merged with get_seasons().

Usage

get_standings_information()

Value

tibble with one row per season

Examples

standings_info <- get_standings_information()

Get all streams

Description

get_streams() retrieves information on each stream, including but not limited to their ID, name, and URL.

Usage

get_streams()

Value

tibble with one row per stream

Examples

all_streams <- get_streams()

Get prospects by team and player-type

Description

get_team_prospects() retrieves information on each prospect for a given set of team and player_type, including but not limited to their ID, name, bio-metrics, and birth date and location. Access get_teams() for team reference.

Usage

get_team_prospects(team = "BOS", player_type = "forwards")

Arguments

team

string 3-letter Code

player_type

string of 'forwards', 'defensemen', or 'goalies'

Value

tibble with one row per player

Examples

COL_defensemen_prospects <- get_team_prospects(
  team='COL',
  player_type='defensemen'
)

Get roster by team, season, and player-type

Description

get_team_roster() retrieves information on each player for a given set of team, season, and player_type, including but not limited to their ID, name, bio-metrics, and birth date and location. Access get_teams() for team and get_team_seasons() for season references.

Usage

get_team_roster(
  team = "BOS",
  season = get_season_now()$seasonId,
  player_type = "forwards"
)

Arguments

team

string 3-letter Code

season

integer in YYYYYYYY

player_type

string of 'forwards', 'defensemen', or 'goalies'

Value

tibble with one row per player

Examples

COL_defensemen_20242025 <- get_team_roster(
  team='COL',
  season=20242025,
  player_type='defensemen'
)

Get roster statistics by team, season, game-type, and player-type

Description

get_team_roster_statistics() retrieves information on each player for a given set of team, season, game_type and player_type, including but not limited to their ID, name, and statistics. Access get_teams() for team and get_team_seasons() for season references.

Usage

get_team_roster_statistics(
  team = "BOS",
  season = get_season_now()$seasonId,
  game_type = 2,
  player_type = "skaters"
)

Arguments

team

string 3-letter Code

season

integer in YYYYYYYY

game_type

integer where 2=regular and 3=playoffs

player_type

string of 'skaters' or 'goalies'

Value

tibble with one row per player

Examples

regular_COL_goalies_statistics_20242025 <- get_team_roster_statistics(
  team='COL',
  season=20242025,
  game_type=2,
  player_type='goalies'
)

Get schedule by team and season

Description

get_team_schedule() retrieves information on each game for a given set of team and season, including but not limited to their ID, season, type, start date and time, and home and visiting teams' IDs and scores. Access get_teams() for team and get_team_seasons() for season references.

Usage

get_team_schedule(team = "BOS", season = get_season_now()$seasonId)

Arguments

team

string 3-letter Code

season

integer in YYYYYYYY

Value

tibble with one row per game

Examples

COL_schedule_20242025 <- get_team_schedule(team='COL', season=20242025)

Get team scoreboard as of now

Description

get_team_scoreboard() retrieves information on the current game for a given team, including but not limited to their ID, season, type, start date and time, and home and visiting teams' IDs and scores. Access get_teams() for team reference.

Usage

get_team_scoreboard(team = "BOS")

Arguments

team

string 3-letter Code

Value

tibble with one row per game

Examples

FLA_scoreboard_now <- get_team_scoreboard(team='FLA')

Get season(s) for which team played in regular season and/or playoffs

Description

get_team_seasons() retrieves information on each season for a given team, including but not limited to their ID and game-type(s). Access get_teams() for team reference.

Usage

get_team_seasons(team = "BOS")

Arguments

team

3-letter Code

Value

tibble with one row per season

Examples

COL_seasons <- get_team_seasons(team='COL')

Get team statistics

Description

get_team_statistics() retrieves information on each team or game for a given set of season, game_types, and report. dates must be given when paired with is_game as the default range will return incomplete data (too wide). Access get_configuration() for what information each combination of report, is_aggregate and is_game can provide. Access get_team_seasons() for season and dates references. Will soon be reworked for easier access.

Usage

get_team_statistics(
  season = get_season_now()$seasonId,
  report = "summary",
  is_aggregate = FALSE,
  is_game = FALSE,
  dates = c("2025-01-01"),
  game_types = 1:3
)

Arguments

season

integer in YYYYYYYY

report

string

is_aggregate

boolean

is_game

boolean

dates

vector of strings in 'YYYY-MM-DD'

game_types

vector of integers where 1=pre-season, 2=regular, and 3=playoffs

Value

tibble with one row per team or game

Examples

playoff_team_stf_20242025 <- get_team_statistics(
  season=20242025,
  report='scoretrailfirst',
  game_types=c(3)
)


Get all teams

Description

get_teams() retrieves information on each team, including but not limited to their ID, name, and 3-letter code.

Usage

get_teams()

Value

tibble with one row per team

Examples

all_teams <- get_teams()

Get TV schedule by date

Description

get_tv_schedule() retrieves information on each TV program for a given date, including but not limited to their title, description, start and end times, and broadcast status. Access get_seasons() for date reference.

Usage

get_tv_schedule(date = "2025-01-01")

Arguments

date

string in 'YYYY-MM-DD'

Value

tibble with one row per program

Examples

tv_schedule_2025_01_02 <- get_tv_schedule(date='2025-01-02')

Get all venues

Description

get_venues() retrieves information on each venue, including but not limited to their ID, name, and location.

Usage

get_venues()

Value

tibble with one row per venue

Examples

all_venues <- get_venues()

Get World Showcase (WSC) play-by-play by game

Description

get_wsc_play_by_play() retrieves WSC-provided information on each play for a given game, including but not limited to their ID; time and strength state of occurrence; winning, losing, blocking, shooting, hitting, hit, scoring, assisting, committed-by, drawn-by, and/or served-by player IDs; and X and Y coordinates. Access get_games() for game reference.

Usage

get_wsc_play_by_play(game = 2024020602)

Arguments

game

integer Game ID

Value

tibble with one row per play

Examples

wsc_pbp_2024030411 <- get_wsc_play_by_play(game=2024030411)

Call NHL API

Description

Call NHL API

Usage

nhl_api(path, query = list(), type)

Arguments

path

String

query

list

type

integer where 1=api-web, 2=api.nhle, and 3=records.nhl

Value

parsed JSON


Ping

Description

ping() retrieves information on the API status.

Usage

ping()

Value

boolean TRUE=OK

Examples

online <- ping()