MyNixOS website logo
Description
A Minimum-Dependency 'R' Interface to the 'NHL' API
Retrieves and processes the data exposed by the open 'NHL' API. This includes information on players, teams, games, tournaments, drafts, standings, schedules and other endpoints. A lower-level interface to access the data via URLs directly is also provided.

nhlapi

A minimum-dependency R interface to the NHL API.

CRAN Version CRAN Checks Dependencies Remote API Tests Coverage

{nhlapi} is an R package that provides functionality to retrieve and process the data exposed by the open NHL API. This includes information on players, teams, games, tournaments, drafts, standings, schedules and other endpoints. A lower-level interface to access the data via URLs directly is also provided. See below for a full list of endpoints.

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} or {devtools} packages:

# With remotes
remotes::install_github("jozefhajnala/nhlapi")

# Or with devtools
devtools::install_github("jozefhajnala/nhlapi")

Use and develop with Docker

The Docker image jozefhajnala/nhlapi has RStudio and a set of useful packages for both interactive use of the {nhlapi} package and its development.

Running the following command and opening localhost:8787 in a web browser should open RStudio with a setup ready for analysis and development. Login user is rstudio and password is pass:

# Password can be changed by changing the PASSWORD option below:
# If you need root permissions, add `-e ROOT=true`
docker run --rm -p 8787:8787 -e PASSWORD=pass jozefhajnala/nhlapi

Usage

We 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 auto-complete in your favorite editor:

nhlapi Preview

In-depth look at use

The package's vignettes provide a more detailed overview of some of the functionality:

Implemented API endpoints

Major endpoints

  • [x] Teams

    • [x] Team Metadata nhl_teams()
    • [x] Team Rosters nhl_teams_rosters()
    • [x] Team Schedules nhl_teams_shedule_next(), nhl_teams_shedule_previous()
    • [x] Team Stats nhl_teams_stats()
  • [x] People (Players)

    • [x] Players metadata nhl_players
    • [x] Players season/playoff stats nhl_players_seasons()
    • [x] Players all season stats nhl_players_allseasons()
  • [x] Games

    • [x] Games content nhl_games_content()
    • [x] Games full live feed nhl_games_feed()
    • [x] Games box score info nhl_games_boxscore()
    • [x] Games line score infonhl_games_linescore()
  • [x] Tournaments

    • [x] Playoffs nhl_tournaments_playoffs()
    • [x] Olympics nhl_tournaments_olympics()
    • [x] World Cups nhl_tournaments_worldcups()
  • [x] Schedule

    • [x] Generic API with all parameters nhl_schedule()
    • [x] Today nhl_schedule_today()
    • [x] Custom seasons nhl_schedule_seasons()
    • [x] Custom date ranges nhl_schedule_date_range()
  • [x] Standings nhl_standings()

Minor endpoints

  • [x] Divisions nhl_divisions()
  • [x] Conferences nhl_conferences()
  • [x] Drafts nhl_drafts()
  • [x] Seasons nhl_seasons()
  • [x] Awards nhl_awards()
  • [x] Venues nhl_venues()
  • [x] Draft prospects nhl_draft_prospects()

Metadata endpoints

  • [x] Game Types nhl_md_game_types()
  • [x] Game Statuses nhl_md_game_statuses()
  • [x] Play Types nhl_md_play_types()
  • [x] Tournament Types nhl_md_tournament_types()
  • [x] Standings Types nhl_md_standings_types()
  • [x] Stats Types nhl_md_stat_types()
  • [x] Event Types nhl_md_event_types()

Acknowledgments

Thanks go to Drew Hynes for documenting this so well on GitLab.

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 2021. All Rights Reserved.

Metadata

Version

0.1.4

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows