NHL API: Get NHL Career Stats
Introduction The NHL has a publicly accessible Application Programming Interface (or API ) that allows users to obtain a lot of useful data (including detailed play-by-play data). There are a couple of obstacles though: 1) the NHL API does not come with a user manual; and 2) the NHL API is most easily accessed using a programming language such as R or Python. To help you overcome those obstacles I’m writing articles that provide the code (in the R programming language) for functions that pull data from the NHL API. In this article I provide a function that pulls a skater’s NHL career stats. The Data Before I provide the code, here’s a sample of the data. player_id: 8478402 player: Connor McDavid gp: 569 toi_as: 742323 toi_es: 600275 toi_pp: 119736 toi_sh: 22312 goals: 303 assists: 547 points: 850 shots: 1948 hits: 375 blocks: 223 pim: 219 goals_es: 225 goals_pp: 71 goals_sh:...