Showing posts from April, 2024

NHL Stats API Functions

  Introduction This document describes functions for pulling skater stats from the NHL’s API using the R programming language. My initial goal was to write a function that would quickly pull detailed time-on-ice data. I got carried away though and wrote a few new functions that will quickly pull various types of data for specified time periods. These functions omit lots of the data available through the NHL’s API. My decisions about what to include were influenced by how I personally use the data (ie, trying to win my fantasy hockey leagues). If you’re interested in other data it should be easy to modify these functions to get what you’re looking. For example, if you want to include a skater’s penalty minutes it would be easy to add that to the data selected in the peripherals function below. If you’re new to the NHL’s API then hopefully these functions (and the descriptive notes) will push you up the learning curve. It can be a challenge to get started as there’s no documentation for