NHL Records and Stats API

⭐ Beginner's Pick Sports & Fitness / No Auth Required Beginner HTTPS
Free to Use Varies (check documentation)

Overview

NHL Records and Stats is a free, open API that provides historical NHL data including player records, season stats, team standings, and game details. No API key is required, so you can start exploring hockey data immediately. It is well-documented on GitLab with community-maintained endpoint references.

💡

Beginner Tip

The NHL API is unofficial and undocumented by the NHL itself, but the community GitLab page lists all known endpoints. Start with /api/v1/teams to get a list of all teams before drilling into specific data.

Available Data

NHL Records and Stats data via REST API
JSON-formatted response data
Freely accessible without authentication

Example Response

JSON Response
{
  "match_id": 4521,
  "home_team": "Team A",
  "away_team": "Team B",
  "score": {
    "home": 2,
    "away": 1
  },
  "status": "Full Time",
  "date": "2025-01-15",
  "league": "Premier League"
}

Field Reference

teams[].id Unique NHL team identifier
teams[].name Full team name, e.g. Toronto Maple Leafs
teams[].abbreviation Three-letter team abbreviation, e.g. TOR
teams[].division.name Name of the division the team belongs to
teams[].venue.name Name of the team home arena

Implementation Example

const url = "https://gitlab.com/dword4/nhlapi";
const response = await fetch(url);
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

Common Errors & Troubleshooting

404 Not Found Team ID or player ID does not exist
Fetch /api/v1/teams first to get valid team IDs, then use those IDs in further requests
Unexpected null fields Some historical records lack complete data
Always check for null values before accessing nested fields like roster or stats
Slow or timeout response Requesting large datasets like full season schedules
Add query parameters such as startDate and endDate to limit the response size

Matrix Score Breakdown

🌐 Reachability 30/30
⚡ Speed 15/20
🔒 Security 15/15
🛠 Developer XP 15/20
✓ Reliability 7/15
Response Time 452ms

Fully tested on Apr 5, 2026

Technical Specifications

Auth No Auth
HTTPS REQUIRED
CORS UNKNOWN
Category Sports & Fitness
Difficulty Beginner
Verified: 2026-04-04

Similar APIs

View All →