nhlapi
A minimum-dependency R interface to the NHL API.
Installation
You can install nhlapi from CRAN.
install.packages("nhlapi")
You can also install the latest development version from the master branch on GitHub using the remotes package:
remotes::install_github("jozefhajnala/nhlapi")
Usage
You retrieve the data from the NHL API by calling the functions exported by the nhlapi package. They start with nhl_
so you can easily find them with autocomplete in your favourite editor:
Implemented API endpoints
Major endpoints
Teams
- Team Metadata
nhl_teams()
- Team Rosters
nhl_teams_rosters()
- Team Schedules
nhl_teams_shedule_next()
,nhl_teams_shedule_previous()
- Team Stats
nhl_teams_stats()
- Team Metadata
People (Players)
- Players metadata
nhl_players
- Players season/playoff stats
nhl_players_seasons()
- Players all season stats
nhl_players_allseasons()
- Players metadata
Games
- Games content
nhl_games_content()
- Games full live feed
nhl_games_feed()
- Games box score info
nhl_games_boxscore()
- Games line score info
nhl_games_linescore()
- Games content
Tournaments
- Playoffs
nhl_tournaments_playoffs()
- Olympics
nhl_tournaments_olympics()
- World Cups
nhl_tournaments_worldcups()
- Playoffs
Schedule
- Generic API with all parameters
nhl_schedule()
- Today
nhl_schedule_today()
- Custom seasons
nhl_schedule_seasons()
- Custom date ranges
nhl_schedule_date_range()
- Generic API with all parameters
Standings
nhl_standings()
Minor endpoints
- Divisions
nhl_divisions()
- Conferences
nhl_conferences()
- Drafts
nhl_drafts()
- Seasons
nhl_seasons()
- Awards
nhl_awards()
- Venues
nhl_venues()
- Draft prospects
nhl_draft_prospects()
Metadata endpoints
- Game Types
nhl_md_game_types()
- Game Statuses
nhl_md_game_statuses()
- Play Types
nhl_md_play_types()
- Tournament Types
nhl_md_tournament_types()
- Standings Types
nhl_md_standings_types()
- Stats Types
nhl_md_stat_types()
- Event Types
nhl_md_event_types()
Acknowledgments
Thanks go to Drew Hynes for documenting this so well in https://gitlab.com/dword4/nhlapi/blob/master/stats-api.md
Copyright message
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. © NHL 2020. All Rights Reserved.