API example
NHL endpoints
All NHL endpoints live under https://api.balldontlie.io/stories/nhl. Every request requires a Bearer API key in the Authorization header.
List games
Returns all NHL games scheduled on a given date. Use this endpoint first to discover game IDs, then pass those IDs to the story endpoints below.
/stories/nhl/gamesQuery parameters
| Name | Type | Required | Description |
|---|---|---|---|
| date | string | Yes | ISO-8601 calendar date in YYYY-MM-DD format (e.g. 2026-04-12). |
| timezone | string | No | IANA timezone name used to resolve the date boundary. Defaults to UTC. |
Example request
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://api.balldontlie.io/stories/nhl/games?date=2026-04-13&timezone=America/New_York"Example response
{
"data": [
{
"id": 178503,
"home_team": {
"id": 56,
"full_name": "Anaheim Ducks",
"tricode": "ANA",
"conference_name": "Western",
"division_name": "Pacific"
},
"away_team": {
"id": 60,
"full_name": "Vancouver Canucks",
"tricode": "VAN",
"conference_name": "Western",
"division_name": "Pacific"
},
"start_time": "2026-04-13T22:00:00.000-04:00"
}
]
}Response schema
data
Games scheduled on the requested date, ordered by start_time ascending.
| Field | Type | Description |
|---|---|---|
| id | integer | Game identifier. Pass this value as :game_id to the story endpoints below. |
| home_team | object | Home team. See Team below. |
| away_team | object | Away team. See Team below. |
| start_time | string (date-time) | Scheduled tipoff in RFC 3339 format. The UTC offset reflects the timezone query parameter (UTC when omitted). |
Team
Returned on both home_team and away_team for every NHL game.
| Field | Type | Description |
|---|---|---|
| id | integer | Stable BallDontLie team identifier. Joins to the NHL teams endpoint. |
| tricode | string | Three-letter team code (e.g. ANA). |
| full_name | string | Full display name (e.g. Anaheim Ducks). |
| conference_name | string| null | Conference (Eastern or Western). |
| division_name | string| null | Division (e.g. Pacific). |
Get pregame story
Returns a single aggregated pregame story. Generated within 1 hour before the scheduled start time. Returns 404 if the story has not been generated yet (game is more than 1 hour away).
/stories/nhl/games/{game_id}/pregameQuery parameters
| Name | Type | Required | Description |
|---|---|---|---|
| audience | string | No | Either betting or stats. Defaults to betting. |
| tone | string | No | Either editorial or humor. Defaults to editorial. |
Example request
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://api.balldontlie.io/stories/nhl/games/178503/pregame?audience=betting&tone=editorial"Example response
{
"game": { "id": 178503 },
"story": {
"id": 192180,
"created_at": "2026-04-12T23:00:46.387Z",
"content": "VAN's Filip Hronek has hit over 1.5 SOG in 5 straight, and ANA's puck line swung from +125 on -2.5 to -130 on -1.5. ANA enters 42-32-5; VAN is 23-48-8.",
"entity_tags": {
"teams": [
{ "id": 56, "name": "Anaheim Ducks", "abbreviation": "ANA" },
{ "id": 60, "name": "Vancouver Canucks", "abbreviation": "VAN" }
],
"players": [
{ "id": 474, "name": "Filip Hronek" },
{ "id": 397, "name": "Jake DeBrusk" }
]
}
}
}Response schema
game
Compact reference to the game this response is scoped to. Echoes the :game_id path parameter.
| Field | Type | Description |
|---|---|---|
| id | integer | Game identifier matching the one supplied in the request path. |
story
The single narrative object for this phase. Deterministic for a given (game_id, audience, tone) tuple.
| Field | Type | Description |
|---|---|---|
| id | integer | Stable story identifier. Safe to use as an idempotency key. |
| created_at | string (date-time) | RFC 3339 timestamp (UTC) marking when the narrative was written. |
| content | string| null | Tweet-length narrative body (≤280 characters). Null only in the rare case that the requested tone has not yet been rendered for this story. |
| entity_tags | object | Teams and players referenced in content. See entity_tags below. |
entity_tags
Structured list of the teams and players referenced in the narrative. Use the IDs to join to the corresponding BallDontLie sport APIs.
| Field | Type | Description |
|---|---|---|
| teams | array<object> | Teams mentioned in the story. Each element is { id: integer, name: string, abbreviation: string }. |
| players | array<object> | Players mentioned in the story. Each element is { id: integer, name: string, team?: string }, where team is the abbreviation when known. |
Get live stories
Returns event-driven stories for a live game, sorted oldest to newest by created_at. Live games produce guaranteed period-end checkpoints plus conditional stories triggered by momentum shifts, prop breaches, and milestones. Returns an empty array if no live stories have been generated yet.
/stories/nhl/games/{game_id}/liveQuery parameters
| Name | Type | Required | Description |
|---|---|---|---|
| audience | string | No | Either betting or stats. Defaults to betting. |
| tone | string | No | Either editorial or humor. Defaults to editorial. |
Example request
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://api.balldontlie.io/stories/nhl/games/178503/live?audience=betting&tone=editorial"Example response
{
"game": { "id": 178503 },
"data": [
{
"id": 192434,
"created_at": "2026-04-13T22:18:00.000Z",
"type": "prop_exceeded",
"content": "Cutter Gauthier has already cleared a 0.5 anytime-goal line, scoring the opener as ANA leads VAN 1-0 early in the 1st.",
"entity_tags": {
"teams": [
{ "id": 56, "name": "Anaheim Ducks", "abbreviation": "ANA" },
{ "id": 60, "name": "Vancouver Canucks", "abbreviation": "VAN" }
],
"players": [
{ "id": 635420, "name": "Cutter Gauthier", "team": "ANA" }
]
},
"game_snapshot": {
"period": 1,
"home_score": 1,
"away_score": 0,
"minutes_remaining": 16
}
}
]
}Response schema
game
Compact reference to the game this response is scoped to. Echoes the :game_id path parameter.
| Field | Type | Description |
|---|---|---|
| id | integer | Game identifier matching the one supplied in the request path. |
data
Array of live stories for the game, ordered oldest to newest by created_at. Empty if no live stories have fired yet.
| Field | Type | Description |
|---|---|---|
| id | integer | Stable story identifier. Safe to use as an idempotency key. |
| created_at | string (date-time) | RFC 3339 timestamp (UTC) marking when the narrative was written. |
| type | string | Detection module that produced this story (e.g. game_over, close_game, prop_exceeded, batter_breakout). Useful for routing stories into downstream product surfaces. |
| content | string| null | Tweet-length narrative body (≤280 characters). Null only in the rare case that the requested tone has not yet been rendered for this story. |
| entity_tags | object | Teams and players referenced in content. See entity_tags below. |
| game_snapshot | object | Score and clock at the moment the story fired. See game_snapshot below. |
entity_tags
Structured list of the teams and players referenced in the narrative. Use the IDs to join to the corresponding BallDontLie sport APIs.
| Field | Type | Description |
|---|---|---|
| teams | array<object> | Teams mentioned in the story. Each element is { id: integer, name: string, abbreviation: string }. |
| players | array<object> | Players mentioned in the story. Each element is { id: integer, name: string, team?: string }, where team is the abbreviation when known. |
game_snapshot
Point-in-time state of the game when the story was generated. Useful for rendering a score banner alongside the narrative.
| Field | Type | Description |
|---|---|---|
| home_score | integer | Home team score at the moment the story fired. |
| away_score | integer | Away team score at the moment the story fired. |
| period | integer | Period number. 1–3 for regulation, 4 for overtime, 5 for shootout. |
| minutes_remaining | integer | Whole minutes remaining in the current period. |
| clock | string| null | Raw game-clock string when available (e.g. "6:22"). Present on most live triggers; may be absent on period-boundary events. |
Get postgame story
Returns the most recent postgame story, generated immediately after the game goes final. Evaluates the pregame narrative against actual results. Returns 404 if no postgame story has been generated yet.
/stories/nhl/games/{game_id}/postgameQuery parameters
| Name | Type | Required | Description |
|---|---|---|---|
| audience | string | No | Either betting or stats. Defaults to betting. |
| tone | string | No | Either editorial or humor. Defaults to editorial. |
Example request
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://api.balldontlie.io/stories/nhl/games/178503/postgame?audience=betting&tone=editorial"Example response
{
"game": { "id": 178503 },
"story": {
"id": 193099,
"created_at": "2026-04-14T01:42:55.812Z",
"content": "VAN stunned ANA 4-3 in OT as a +260 underdog, and the 7-goal total pushed. Cutter Gauthier scored 2 for Anaheim, but Brock Boeser and Jake DeBrusk each scored for Vancouver.",
"entity_tags": {
"teams": [
{ "id": 56, "name": "Anaheim Ducks", "abbreviation": "ANA" },
{ "id": 60, "name": "Vancouver Canucks", "abbreviation": "VAN" }
],
"players": [
{ "id": 635420, "name": "Cutter Gauthier", "team": "ANA" },
{ "id": 397, "name": "Jake DeBrusk", "team": "VAN" }
]
}
}
}Response schema
game
Compact reference to the game this response is scoped to. Echoes the :game_id path parameter.
| Field | Type | Description |
|---|---|---|
| id | integer | Game identifier matching the one supplied in the request path. |
story
The single narrative object for this phase. Deterministic for a given (game_id, audience, tone) tuple.
| Field | Type | Description |
|---|---|---|
| id | integer | Stable story identifier. Safe to use as an idempotency key. |
| created_at | string (date-time) | RFC 3339 timestamp (UTC) marking when the narrative was written. |
| content | string| null | Tweet-length narrative body (≤280 characters). Null only in the rare case that the requested tone has not yet been rendered for this story. |
| entity_tags | object | Teams and players referenced in content. See entity_tags below. |
entity_tags
Structured list of the teams and players referenced in the narrative. Use the IDs to join to the corresponding BallDontLie sport APIs.
| Field | Type | Description |
|---|---|---|
| teams | array<object> | Teams mentioned in the story. Each element is { id: integer, name: string, abbreviation: string }. |
| players | array<object> | Players mentioned in the story. Each element is { id: integer, name: string, team?: string }, where team is the abbreviation when known. |