GithubHelp home page GithubHelp logo

nhlrapi's Introduction

NHL API for R

CRAN Travis build status AppVeyor build status Coverage status

Introduction

The NHL has a poorly documented API that has a lot of information available in it for absolutely free. There are statistics and records available, focusing on teams, players, games, drafts, prospects, and awards. This package aims to provide a basic API wrapper for use in R. Significant information required for the development of this package comes from https://gitlab.com/dword4/nhlapi.

The package is still under development and may undergo rapid changes, including breaking changes, without warning. Please test any code using this package regularly.

The package may make it to CRAN one day, once stability is achieved. Please watch for that.

Installation

This package can be installed by running the following command in an R session:

devtools::install.github('pbulsink/nhlRapi')

Then, load the package into the R namespace:

library(nhlRapi)

Usage

Initially this API will be a dumb wrapper only, calling the API and returning the data as a json object as recieved. Future versions may initiate data cleaning or other manipulations.

API Coverage

The following items are covered by this API:

STATS

  • Teams
  • Divisions
  • Conferences
  • People
  • Game-IDs
  • Schedule
  • Standings
  • Standings Types
  • Stats Types
  • Team Stats
  • Draft
  • Prospects
  • Awards
  • Venues
  • Tournaments (new)
  • Seasons (new)

Stats Types and Standings Types are modifiers for People Stats and Standings, respectively

RECORDS

  • Attendance
  • Draft
  • Records
  • Franchise
  • Player
  • Playoffs
  • Trophy
  • Milestones
  • Officials

Filtering

Some functions contain introductory filter options. Further filtering can be done once data is retrieved by the API. For example, the API can get all attendance records getAttendance() or a specific season getAttendance(season = 20152016). While the web API allows for other field filtering (e.g. a call for playoffAttendance>1000000), the R api functions do not have all of these built in.

Instead, use R to perform these filters:

attendance<-getAttendance()
attendance<-attendance$data[attendance$data$playoffAttendance > 1000000, ]

Good API Etiquette

There are no rate limiters built into the API to prevent over-usage of the API. However, significant requests may induce the NHL to throttle or ban your IP address and prevent you from getting data. If using this API, please rate limit yourself.

Rate limiting may be added in future versions.

Copyright

All data, teams, logos, and information is copyright NHL and its teams, with compliance to the copyright statement recieved from the API call (from getCopyright()).

nhlrapi's People

Contributors

pbulsink avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.