The NHL REST API is the easiest way to gather current statistics and information about National Hockey League players and teams.
Please see the official API documentation on RapidAPI for the complete, up-to-date specification, including response formats and pricing plans.
Overview
The NHL REST API is a full-featured service for gathering current player statistics and team standings for the National Hockey League. It is hosted on RapidAPI, and allows for different calls to be made based on what your needs are.
The API is perfect for pulling stats and standings for the following use cases:
- Fantasy hockey websites that need current stats for the season
- News sites that want to pull the current standings and display them in the page
- Hockey fan sites that want up-to-date player and team performance data
Key Features
- Player Search: Fuzzy search across player names, teams, and positions
- Skater Statistics: Scoring stats for any skater, or every skater on a team
- Goaltender Statistics: Goaltending stats for any goalie, or every goalie on a team
- Standings: Current standings for every division
- Batch Queries: Fetch stats for up to 10 players in a single request
Getting Started
Requests go through RapidAPI, so every call needs your RapidAPI key. Subscribe to the API on RapidAPI to get one, then send it with each request:
curl "https://nhl-statistics-api.p.rapidapi.com/search?q=connor+mcdavid" \ -H "X-RapidAPI-Key: YOUR_RAPIDAPI_KEY" \ -H "X-RapidAPI-Host: nhl-statistics-api.p.rapidapi.com"Each player in the system has a unique id that never changes and can be used to identify the player on subsequent API calls. Each player also has a slug, which is more human-readable but not absolutely guaranteed to be unique. Many players have non-Latin characters, hyphens or suffixes in their names, so slugs aren’t always easy to guess; use the search endpoint to find a player’s id and slug. Either value can be used on the stats endpoints.
The statistics and standings endpoints always return a modified timestamp (in UTC) for when the data was last refreshed. You can use this to determine how fresh the data is.
Endpoints
Search for Players
GET /search?q={search-criteria}
Searches for a player by name, team, or position. Returns up to 10 matching players, each with their id, name, slug, team and pos.
Example:
GET /search?q=connor+mcdavidGet Skater Statistics
GET /stats/scoring/{id-or-slug}
Gets scoring statistics for a single skater. Accepts either player ID or slug.
Example:
GET /stats/scoring/connor-mcdavidGet Goaltender Statistics
GET /stats/goaltending/{id-or-slug}
Gets goaltending statistics for a single goalie. Accepts either player ID or slug.
Example:
GET /stats/goaltending/connor-hellebuyckGet Multiple Skaters
GET /stats/scoring?ids={id1,id2,...}
Gets scoring stats for up to 10 skaters at a time. IDs and slugs are comma-separated and can be mixed.
Example:
GET /stats/scoring?ids=connor-mcdavid,leon-draisaitl,auston-matthewsGet Multiple Goaltenders
GET /stats/goaltending?ids={id1,id2,...}
Gets goaltending stats for up to 10 goalies at a time. IDs and slugs are comma-separated and can be mixed.
Example:
GET /stats/goaltending?ids=connor-hellebuyck,andrei-vasilevskiyGet Team Skater Statistics
GET /stats/scoring/team/{team}
Gets scoring statistics for every skater on a team, using the team’s abbreviation (for example EDM, COL or DAL).
Example:
GET /stats/scoring/team/EDMGet Team Goaltender Statistics
GET /stats/goaltending/team/{team}
Gets goaltending statistics for every goalie on a team, using the team’s abbreviation.
Example:
GET /stats/goaltending/team/DALGet Division Standings
GET /standings/{conference}/{division}
Gets the current standings for a division. Each team includes games played, wins, losses, overtime losses, points, goals for and goals against.
| Conference | Divisions |
|---|---|
east |
atlantic, metro |
west |
central, pacific |
Example:
GET /standings/west/centralSupport
Please contact us with any issues you are having by emailing us at support@moonlabs.app. If there is a feature you’d like us to add, please let us know!
