nhl_url_games: Create an NHL API URL for games

Description Usage Arguments Value Examples

View source: R/nhl_games.R

Description

Create an NHL API URL for games

Usage

1
nhl_url_games(gameIds, element)

Arguments

gameIds

numeric(), vector of one or more game ids. The game id is a 10 digit number where the

  • first 4 digits identify the season of the game, for instance 2017 for the 2017-2018 season.

  • next 2 digits give the type of game, where

    • 01 - preseason,

    • 02 - regular season,

    • 03 - playoffs,

    • 04 - all-star.

  • final 4 digits identify the specific game number

    • for regular season and preseason games, this ranges from 0001 to the number of games played. That is 1271 for seasons with 31 teams and 1230 for seasons with 30 teams.

    • for playoff games, the

      • second digit gives the round of the playoffs

      • third digit specifies the match-up

      • fourth digit specifies the game (out of 7)

element

character() vector of one or more valid elements. Currently the valid elements seem to be:

  • "linescore"

  • "boxscore"

  • "content"

  • "feed/live"

Value

character(), of same length as gameIds.

Examples

1
2
3
4
5
  nhlapi:::nhl_url_games(2017010001, "content")
  nhlapi:::nhl_url_games(
    c(2017010001, 2017010002),
    c("content", "boxscore")
  )

nhlapi documentation built on Feb. 20, 2021, 9:06 a.m.