NHL API

Sports API · Works globally · NHL hockey stats · No API key

TL;DR

The unofficial NHL API provides comprehensive access to National Hockey League statistical data. Query team rosters, player stats, game schedules, live scores, standings, draft history, and playoff brackets. Get real-time game data including shots on goal, penalties, power play stats, and period-by-period scoring. JSON format, no API key, CORS-friendly. A must-have for hockey analytics projects and fan applications.

Quick start: https://api-web.nhle.com/v1/standings/now

No API key needed — just make a request!

How to Use This API

1. Current Standings

https://api-web.nhle.com/v1/standings/now

2. Team Roster

https://api-web.nhle.com/v1/roster/team/10/20232024

3. JavaScript — Team Standings

fetch('https://api-web.nhle.com/v1/standings/now')
  .then(r => r.json())
  .then(data => {
    data.standings.forEach(t => {
      console.log(`${t.teamName.default} — ${t.wins}W-${t.losses}L-${t.otLosses}OTL`);
      console.log(`  Pts: ${t.points}, GF: ${t.goalFor}, GA: ${t.goalAgainst}`);
    });
  });

4. Python — Get Player Stats

import requests

# Get roster for Toronto Maple Leafs (team 10)
roster = requests.get(
    'https://api-web.nhle.com/v1/roster/team/10/20232024'
).json()

print("Toronto Maple Leafs — 2023/24 Roster:")
for position in ['forwards', 'defensemen', 'goalies']:
    players = roster.get(position, [])
    for p in players:
        print(f"  #{p.get('sweaterNumber', '?')} {p['firstName']['default']} "
              f"{p['lastName']['default']} — {position[:3].upper()}")
Current NHL standings: https://api-web.nhle.com/v1/standings/now

Frequently Asked Questions

What data endpoints are available?
Standings, team stats, player stats, game schedule (daily/monthly), game live data, play-by-play, shot charts, draft history, and team rosters.
How do I find team IDs?
Use the /v1/team endpoint to list all teams with their IDs. Example: Toronto Maple Leafs = 10, Montreal Canadiens = 1, Edmonton Oilers = 25.
Can I get live game data?
Yes, the /v1/gamecenter/{gameId}/play-by-play endpoint provides real-time play-by-play data including goals, penalties, and shots.
How do I search for a specific season?
Use the season format YYYYZZZZ (e.g., 20232024 for 2023-24 season) in roster and stats endpoints.
Does the API include historical data?
Yes, historical data is available from the 1917-18 season onward, including player career stats and team season-by-season records.
Is this an official NHL API?
This is the same API used by NHL.com and the official NHL app. While not publicly documented, it is widely used by developers and analytics platforms.

API Details

API URL
https://api-web.nhle.com/v1
Documentation
NHL API Reference (community)
Category
Sports
Authentication
Not Required
Geographic Coverage
North America (NHL)

What You Can Build