nhl_games {nhlapi} | R Documentation |
Retrieve metadata on NHL games from the API
Description
Retrieve metadata on NHL games from the API
Usage
nhl_games(gameIds, element)
nhl_games_content(gameIds)
nhl_games_feed(gameIds)
nhl_games_boxscore(gameIds)
nhl_games_linescore(gameIds)
Arguments
gameIds |
|
element |
|
Value
list
, with information on games, one element per game
and element combination.
Functions
-
nhl_games_content
: Complex endpoint returning multiple types of media relating to the game including videos of shots, goals and saves. -
nhl_games_feed
: returns all data about a specified game id including play data with on-ice coordinates and post-game details like first, second and third stars and details about shootouts. Note that the data returned is sizable, often over 30 000 lines. -
nhl_games_boxscore
: Returns far less detail thannhl_games_feed()
and may be more suitable for analyzing post-game statistics including goals, shots, penalty minutes, blocked, takeaways, etc. -
nhl_games_linescore
: Returns even fewer details thannhl_games_boxscore()
. Has goals, shots on goal, power-play and goalie pulled status, number of skaters and shootout information if applicable.
Examples
## Not run:
# Get content for one game
nhl_games(2017010001, "content")
# Get both box score and content for 2 games
nhl_games(c(2017010001, 2017010002), c("content", "boxscore"))
# Get content for a game
nhl_games_content(2017010001)
# Get the game feed for a game
nhl_games_feed(2017010001)
# Get the box score for a game
nhl_games_boxscore(2017010001)
# Get the line score for a game
nhl_games_linescore(2017010001)
## End(Not run)