nhl_url_games {nhlapi}R Documentation

Create an NHL API URL for games

Description

Create an NHL API URL for games

Usage

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

  nhlapi:::nhl_url_games(2017010001, "content")
  nhlapi:::nhl_url_games(
    c(2017010001, 2017010002),
    c("content", "boxscore")
  )


[Package nhlapi version 0.1.4 Index]