Highlight API Documentation
Real-time sports content, structured for your app. Pair play-by-play events with the highlight clip that shows them, and receive selected insider reports parsed into typed events. REST API, JSON responses.
Overview
Highlight API is two products behind one REST interface. Clip matching pulls highlight videos from official team, league, and broadcast-partner X accounts and pairs each one with the exact play it shows in the official play-by-play feed. Breaking news watches verified insiders (Shams, Schefter, Passan, Rosenthal, Fabrizio Romano, Ornstein, and more) and extracts typed events with structured facts. Delivery timing depends on the enabled ingestion path, extraction, and client transport. See News latency and evaluation.
Both pipelines pre-compute everything upfront. We scrape clips, feed each video into our matching model along with candidate plays from that game's play-by-play, and store the structured match. We scrape insider tweets, classify each as breaking or not, and extract structured event facts (players, teams, contract terms, injury details) when they are. By the time your app asks for either, the work has already happened. Lookups are a single indexed SQL query.
Coverage by product
The implemented clip API uses /v1/nba/ routes. NFL and other sport demonstrations do not establish live API coverage. Confirm specific games and historical availability before integrating.
The configured insider-news registry covers nba, nfl, mlb, nhl, and soccer. Inspect GET /v1/news/sources for configured handles; a listed handle does not prove that ingestion is currently active. Coverage is based on selected source reports, not exhaustive official injury reports or confirmed lineups. College sports and WNBA coverage are not currently listed in this registry.
What you get
- A tweet ID and embed URL for every matched clip. You render the official X embed.
- A structured match object linking the clip to an exact play: period, game clock, player, action type, score, and more.
- A confidence level (
high,medium,low) so you can set your own thresholds. Confidence is a model assessment, not an accuracy guarantee. Evaluate matches against your own labeled sample. - Live polling support via a
sincecursor for in-progress games. - A structured NewsEvent for extracted insider reports, with a top-level
type(trade,extension,signing,injury,firing,hiring,suspension, …), a unifiedsubjects[]array, a type-specific detail block (contract,injury,tenure), and a ready-to-renderheadline+subheadlinepair sized for push notifications.
News usage and evaluation terms
A text-only integration does not require displaying video or images. It does not establish unrestricted redistribution rights. Before public use, agree in writing on permitted feed cards, generated summaries, push notifications, source attribution and links, storage/retention, deletions and takedowns. Upstream source permissions must support the agreed use; an API subscription alone is not proof of those permissions.
Relevant upstream references: X Developer Agreement and X Developer Policy. These references are not a grant of rights from Highlight API. We do not provide a video or image license through the news feed.
Request a representative payload sample at support@highlightapi.com, specifying sports and intended feed/push use. Before starting a live pilot, agree on source scope, activation date, duration, price, support owner, delivery expectations and permitted use. No public price, free-trial entitlement or production SLA is established here.
Evaluate in a shadow feed before automatic public push: grade extraction accuracy, missed source reports, duplicate stories, entity matches and corrections; measure source-to-receipt latency including failures; test disconnect recovery and webhook retry handling. Set acceptance thresholds together before collecting results. A successful sample is not a production-readiness guarantee.
Breaking news for sports apps
Turn trusted sports reporting into player updates, developing stories and timely notifications. One feed combines structured facts, source attribution, entity IDs and publication controls. Your app keeps its own design and editorial policy.
News v2 product contract. The specification below defines the intended design-partner offer. Coverage, activation and delivery terms are agreed during onboarding. Existing v1 endpoints remain documented below on this page.
Get a sample feed · Inspect the event contract · v1 endpoint reference
One integration. Your editorial policy.
- Choose scope. Select leagues, teams, players and event types. Supply your entity provider or ID map once.
- Choose delivery. Receive signed webhooks or SSE. Use REST for snapshots, history and reconciliation.
- Upsert the story. Store
storyIdandrevision; use the supplied entity IDs to place it in your feed. - Apply a publication profile. Notify at first eligible reporting, require independent corroboration, or wait for a scoped authoritative announcement.
- Handle changes. Updates, corrections and retractions refer to the same story and explicitly identify the revision they replace.
A complete source ladder
Report certainty, source authority and independent corroboration are separate signals. Two accounts repeating one original report are one evidence chain, not two confirmations.
Reported
An eligible source reports a fact. Preserve qualifications such as “expected,” “in talks” and “according to sources.” The source and its original post stay attached.
Corroborated
Two or more independently sourced evidence chains support the same material claim. Relays, quotes and shared upstream citations do not count again. Uncertain independence stays unknown.
Team announced
A verified team or authorized representative explicitly announces the claim within its authority. A team's confirmation of an injury does not confirm a separate return date.
League official
A league announcement or official transaction record establishes the relevant claim. League confirmation applies to that claim, not every detail in the story.
Stories can jump directly to an authoritative announcement. Team confirmation does not require two earlier reporters. The ladder describes evidence, not a truth percentage; your policy can accept an appropriate authority without waiting for every rung.
Disputes are a separate branch
disputed, corrected and retracted describe the story lifecycle. They can change publication eligibility and lower the supported confirmation level. A retraction never disappears behind a monotonically increasing badge.
The event contract
The target news.v2 contract separates one delivery from one evolving story. This synthetic example illustrates the schema, not a real report or measured delivery.
{
"schemaVersion": "news.v2",
"eventId": "evt_example_004",
"eventType": "story.updated",
"cursor": "opaque_checkpoint_example",
"storyId": "story_example_001",
"revision": 4,
"supersedesRevision": 3,
"sport": "nba",
"type": "availability",
"lifecycle": "active",
"headline": "Example player ruled out tonight",
"summary": "The team announced an ankle injury.",
"entities": [{
"id": "player_example_001",
"kind": "player",
"name": "Example player",
"externalIds": { "real": "real_player_example_001" },
"teamId": "team_example_001",
"resolution": "resolved"
}],
"facts": [{
"entityId": "player_example_001",
"action": "availability_changed",
"field": "gameAvailability",
"previous": "questionable",
"current": "out",
"scope": { "gameId": "game_example_001" },
"qualification": "announced",
"evidenceIds": ["evidence_example_team"]
}],
"confirmation": {
"level": "team_announced",
"independentOriginCount": 1,
"independence": "established",
"supportsFactIndexes": [0]
},
"sources": [{
"evidenceId": "evidence_example_team",
"sourceId": "source_example_team",
"role": "team",
"relationship": "origin",
"originEvidenceId": null,
"url": "https://example.com/announcement"
}],
"routing": {
"playerIds": ["player_example_001"],
"teamIds": ["team_example_001"],
"gameIds": ["game_example_001"],
"mappingVersion": "real_example_v1"
},
"publication": {
"decision": "eligible",
"cardAction": "update",
"notificationAction": "send",
"notificationKey": "story_example_001:availability_out:game_example_001",
"policyId": "team_announcements_v1",
"reasonCodes": ["SCOPED_TEAM_ANNOUNCEMENT"]
},
"timestamps": {
"sourcePublishedAt": "2026-11-13T18:00:00Z",
"observedAt": "2026-11-13T18:00:03Z",
"finalizedAt": "2026-11-13T18:00:04Z"
}
}
Contract rules
eventIduniquely identifies the event and is stable across retries;storyIdidentifies the story; revisions increase within that story.facts[]carries entity, action, before/after values, time or game scope and supporting evidence. Unknown previous state staysnull; it is never inferred from missing coverage.qualificationpreserves tentative reporting.confirmationdescribes supporting evidence.publicationis the result of your configured policy, not a legal permission or a guarantee of truth.- Dates for reevaluation, expected return and confirmed availability remain distinct. Multi-player posts produce separate scoped facts.
- Entity matches that are ambiguous remain unresolved and can be held for review. No invented external IDs or silent surname-only matches.
- The target type taxonomy covers availability, injury, lineup, trade, signing, extension, release, retirement, suspension, ruling, hiring, firing, draft, award and milestone. Unknown types are preserved for review; clients must tolerate additive fields and future enum values.
Updates without duplicate alerts
story.created opens the story. story.updated changes facts or evidence. story.corrected identifies inaccurate earlier facts and their replacements. story.retracted withdraws the claim. Each event contains a complete current snapshot plus changedFields and a revision link.
A relay adds attribution without triggering another “breaking” notification. A new independent origin can change confirmation. Material changes can trigger a new alert under your policy; spelling fixes and repeated reporting do not have to.
Correction example
A report identifies the wrong player as ruled out. A correction identifies the mistaken player and the correct player, links the inaccurate revision, replaces the affected facts, and supplies replacement display copy. The original source and earlier version remain in the permitted audit history. By contrast, accurately reported trade talks later ending is a story update: circumstances changed, rather than the earlier reporting necessarily being wrong.
Publication actions: cardAction is create, update, withdraw or none. notificationAction is send, correction, suppress or review. Persist notificationKey to suppress repeated delivery of the same alert decision. Corrections and retractions reach subscriptions that received the affected earlier revisions even when the new revision no longer matches their content filters. Withdrawing a card cannot recall an already delivered device push; a correction notification is a separate policy decision.
A correction is an explicit event even if the headline stays similar. Out-of-order delivery cannot overwrite a newer revision. An absent event or an unavailable source is not a retraction.
Delivery you can reconcile
Target interfaces: GET /v2/news/events, GET /v2/news/stream, GET /v2/news/stories/:id, GET /v2/news/sources, and signed webhook subscriptions. These paths define the proposed contract, not currently activated endpoints.
- REST: opaque, totally ordered cursors with
nextCursorandhasMore. Timestamp ties cannot skip events. Filters and cursor scope stay consistent across pages. - SSE: the same envelope and cursor; reconnect with
Last-Event-ID. Reconcile buffered live events and REST history usingeventId. - Webhooks: HMAC signatures, timestamp validation, retries and a delivery ledger. Acknowledge after durable enqueue, then process asynchronously. Delivery is at least once; deduplicate by
eventId. - Recovery: agreed retention, explicit cursor-expiry errors and a snapshot/reconciliation path. Gaps are surfaced instead of silently appearing complete.
- Security: server-side credentials, scoped subscriptions and key rotation. Keep account keys out of app binaries and browser bundles.
Measure the clocks that matter
Preserve source publication, first observation and finalization timestamps, plus your own receipt timestamp. Pilot reporting includes source-to-receipt distribution, failed deliveries, missing source events and source freshness. Service targets, coverage hours, outage handling and support escalation are agreed for the selected scope. Synthetic examples are not latency evidence.
Coverage that matches your users
Start with the leagues and sources your audience follows, then expand by demand. Scope NBA, NFL, MLB, NHL and soccer separately, including event types, notable reporters, team announcements and league records. Each source has an identity, authority scope, attribution rules and operational freshness state.
routing lists affected player, team and game IDs explicitly. The synthetic example uses illustrative Real IDs, not actual customer mappings. Each supplied ID resolves through the agreed mapping export, including entity roles and effective dates. Trades route to the player and both origin and destination teams; unresolved IDs are flagged and held or sent to an agreed league-level review queue, never silently guessed. Mapping versions let consumers reconcile changes without parsing display text.
Maintain stable internal player, team and game IDs with agreed provider mappings. Keep an unresolved queue for ambiguous identities. Reports can be routed to player follows, team communities, game pages and league feeds without making your team parse headlines.
A quiet source is different from a disconnected source. Coverage reporting distinguishes eligible posts, extracted events, skips, unknowns and outages. A source roster is a scope agreement, not a claim to capture every sports story.
Your publication rules, applied consistently
Choose a first-report profile for selected trusted sources, an independently corroborated profile, or an authority-only profile. Add sport, team, player, topic, impact and quiet-hour rules. Hold tentative or disputed stories, suppress repeated alerts and route corrections to the same user-facing story.
Each eligible decision includes the policy version and reason, so your team can explain why an alert was sent. Your app retains final editorial control.
Text-first usage
Use structured facts and attributed summaries without video or image integration. Before activation, the agreement specifies feed-card and notification usage, source attribution, retention, deletion and takedown handling. Upstream permissions must support the agreed use; this specification does not grant unrestricted redistribution rights.
See it in your feed
Send us your first two leagues and the news experience you want to improve. We will scope a representative sample with initial reports, corroboration, updates and a correction sequence, plus the IDs your app expects.
Agree on a bounded evaluation with a named integration owner, fixed scope and price, acceptance criteria and an activation date. Validate editorial time saved, useful coverage, duplicate suppression, correction behavior and delivery timing before expanding.
Quickstart
Fetch an available NBA matched clip with the examples below. News uses the separate /v1/news routes and a sport query filter.
# 1. List games for a date
curl https://api.highlightapi.com/v1/nba/games?date=2026-04-06 \
-H "X-API-Key: YOUR_API_KEY"
# 2. Fetch matched clips for a game
curl https://api.highlightapi.com/v1/nba/games/nba-2026-04-06-nyk-atl/clips \
-H "X-API-Key: YOUR_API_KEY"
const res = await fetch(
'https://api.highlightapi.com/v1/nba/games/nba-2026-04-06-nyk-atl/clips',
{ headers: { 'X-API-Key': process.env.HIGHLIGHT_API_KEY } }
);
const { clips } = await res.json();
for (const clip of clips) {
console.log(clip.matchedPlay.description, '→', clip.embedUrl);
}
// For live games, hold open one SSE connection instead of polling:
// new EventSource('.../clips/stream?apiKey=...').onmessage = ...
// See "Streaming (recommended for live)" under List clips below.
Authentication
All production endpoints under /v1/nba/* require an API key, passed in the X-API-Key header. Keys are issued per client and can be rotated at any time.
X-API-Key: sk_live_a1b2c3d4e5f6...
Browser EventSource clients (used by the streaming endpoints) can't attach custom headers, so the same key is also accepted as an ?apiKey= query param. Server-side clients should always prefer the header.
Requests with a missing or invalid key return 401 Unauthorized.
Base URL & versioning
All API calls are made over HTTPS to:
https://api.highlightapi.com
The current API version is v1, included in the path. Any breaking changes will ship under a new version prefix. Additive changes (new fields, new optional parameters) can land in v1 without notice; clients should ignore unknown fields.
How matching works
Matching is pre-computed, so API calls hit a single indexed SQL query. Here is what happens between a player hitting a shot and the clip landing in your app:
- Scrape. We poll every team, league, and active broadcast-partner account on X every couple of minutes.
- Resolve game. Each clip is tagged with a
gameIdbased on the posting account and timestamp (for team posts) or caption and broadcaster schedule (for league and partner posts). - Download and analyze. A background worker pulls the video and runs it through our matching model along with candidate plays from the game's play-by-play. The window starts narrow (around 15 minutes around the post) and widens to 30 minutes or the full game if needed.
- Match and store. The model returns the exact play with a confidence level, which we store on the clip row.
- Serve. When you query the API, we return the pre-matched clip. No per-request AI cost.
Game IDs
Every game has two IDs you can use to reference it:
| Field | Format | Description |
|---|---|---|
| id | string | Our deterministic ID: nba-{date}-{away}-{home} in lowercase (e.g. nba-2026-04-06-nyk-atl). Stable and human-readable. |
| nbaGameId | string | The official 10-digit NBA game ID. Use it to join records from providers that expose NBA IDs. |
If your system already has a league-assigned game ID, use GET /v1/nba/games/by-nba-id/:nbaGameId to translate to our ID.
Integration patterns
Live game streaming (recommended)
Hold open one EventSource per game and each clip is pushed the moment our matcher finishes it. Same per-clip shape as the list endpoint. Browser clients pass the API key as ?apiKey= because EventSource can't set custom headers; server-side clients can use either the query param or the X-API-Key header. Reconnect is automatic and replays the last 15 minutes via Last-Event-ID.
const es = new EventSource(
`/v1/nba/games/${gameId}/clips/stream?apiKey=${key}`
);
es.onmessage = (msg) => {
const clip = JSON.parse(msg.data);
renderClip(clip);
};
Live game polling (fallback)
For server environments that can't hold an open HTTP connection, poll the clips endpoint with a since cursor every 30 seconds.
let lastSeen = '2026-04-06T23:00:00Z';
setInterval(async () => {
const url = `/v1/nba/games/${gameId}/clips?since=${lastSeen}`;
const { clips } = await (await fetch(url, { headers })).json();
for (const clip of clips) {
renderClip(clip);
lastSeen = clip.postedAt;
}
}, 30_000);
Point-in-time lookup
For ad-hoc lookups ("give me the clip for this specific play"), use the match endpoint. Pass the play details and we return the best matching clip.
const res = await fetch('/v1/nba/clips/match', {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'X-API-Key': key },
body: JSON.stringify({
gameId: 'nba-2026-04-06-nyk-atl',
wallClockTime: '2026-04-07T02:14:00Z',
playType: 'three_pointer',
players: ['J. Brunson'],
}),
});
Batch hydration
Have a list of past plays you want to find clips for? Call the clips endpoint once for the game and join locally against the matchedPlay.timeActual and matchedPlay.player fields. This is far cheaper than per-play lookups.
News latency and evaluation
Production latency percentiles and a delivery SLA are not verified by this documentation. Before a live evaluation, confirm the feed is enabled, the selected sources are active, and the delivery transport is operating. Historical examples and source registries are not evidence of a running live service. Any SLA, measurement window, exclusions and remedies must be agreed in writing after measurement.
The code supports an X filtered stream and optional Apify polling. Legacy polling checks Tier A sources every 60 seconds and Tier B sources every five minutes. Ingestion, model extraction, queueing, retries and customer receipt all affect end-to-end delivery. No path should be assumed to deliver before a person can read the source.
postedAt records source publication and extractedAt records extraction finalization. latencyMs measures the difference, not customer receipt. The public event does not provide a complete ingestion, dispatch, and receipt timestamp chain. To benchmark delivery, record your receipt time alongside the source and extraction timestamps and report sample size, errors, and missing events.
SSE reconnect replay is capped at 15 minutes. For longer gaps, use sinceExtracted to query retained finalized rows and deduplicate by tweetId. This is not a guaranteed historical retention period. Source corroboration in story clusters is not a corrections or retractions guarantee, nor an authoritative lineup service. Agree on trial sources, limits, history, pricing, permitted display and alert uses, and correction handling before integration.
Breaking news streaming (recommended)
News breaks aren't tied to a game, so you subscribe to one global stream. Hold open a EventSource connection to /v1/news/stream and each finalized event is pushed the moment we store it, after extraction completes. Measure customer receipt separately from extraction latency. Filter by sport, category, or the breaking flag so you only wake up for the events that matter. Reconnect is automatic and resumes via Last-Event-ID, with replay limited to 15 minutes and 500 retained rows. See the recovery limitations above.
const es = new EventSource(`/v1/news/stream?breaking=true&sport=nfl`);
es.onmessage = (msg) => {
const evt = JSON.parse(msg.data);
enqueueForEditorialReview(evt); // application hook: validate, persist and deduplicate first
};
Breaking news polling (fallback)
For server environments that cannot hold an open HTTP connection, poll GET /v1/news with a sinceExtracted cursor. Results are ordered by extraction time, so delayed extractions are not missed by advancing a source-post cursor. Choose a polling interval for your latency and request budget; the 60-second example below is a client choice, not the ingestion cadence. The example below fetches one page. For catchup, drain pages before saving a cursor. Timestamp cursors are exclusive; retain overlap and deduplicate by tweetId to handle ties. If a full page shares one timestamp, contact us to recover the gap rather than assuming pagination is complete.
let lastSeen = new Date(Date.now() - 10 * 60 * 1000).toISOString();
setInterval(async () => {
const url = `/v1/news?breaking=true&sport=nfl&sinceExtracted=${lastSeen}`;
const { items } = await (await fetch(url, { headers })).json();
for (const evt of items) {
enqueueForEditorialReview(evt); // application hook: validate, persist and deduplicate first
lastSeen = evt.extractedAt;
}
}, 60_000);
Outgoing webhooks (push to your server)
For platforms where holding open a long-lived SSE connection is inconvenient (Elastic Beanstalk, App Runner, Cloud Run, any autoscaled web tier behind an ALB), register a webhook and we POST each finalized event to a URL you own. Every delivery is a normal short-lived HTTPS request your web tier can service directly, no dedicated consumer process required.
Clips and news share one subscription model. Pick the events you care about, provide optional filters (sport, game, breaking, category), and we retry with HMAC-signed requests until you 2xx or we exhaust the retry budget. Full details including signature verification, envelope shape, and retry policy live in the Outgoing webhooks section.
// One-time setup: create a subscription for both feeds.
const res = await fetch('https://api.highlightapi.com/v1/webhooks', {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'X-API-Key': key },
body: JSON.stringify({
url: 'https://yourapp.com/webhooks/highlightapi',
events: ['news.finalized', 'clips.finalized'],
filters: { sport: 'nba' },
}),
});
const { id, secret } = await res.json();
// Store `secret` immediately. It's shown exactly once and is what you
// verify the X-Highlight-Signature header against on each delivery.
List games
Returns all games in a sport for a given date, ordered by start time.
Query parameters
| Parameter | Type | Description |
|---|---|---|
| date Required | string | Date in YYYY-MM-DD format (U.S. Eastern calendar date). Example: 2026-04-06. |
Response
{
"date": "2026-04-06",
"count": 7,
"games": [
{
"id": "nba-2026-04-06-nyk-atl",
"nbaGameId": "0022501178",
"date": "2026-04-06",
"homeTeam": "ATL",
"awayTeam": "NYK",
"status": "final",
"startTime": "2026-04-06T23:30:00Z"
}
]
}
Lookup game by league ID
Look up an NBA game using its official 10-digit NBA game ID. Other providers' identifiers must be mapped to that NBA ID first.
Path parameters
| Parameter | Type | Description |
|---|---|---|
| nbaGameId Required | string | The league's official game ID (e.g. 0022501178 for NBA). |
Response
{
"game": {
"id": "nba-2026-04-06-nyk-atl",
"nbaGameId": "0022501178",
"homeTeam": "ATL",
"awayTeam": "NYK",
"status": "final",
"date": "2026-04-06",
"startTime": "2026-04-06T23:30:00Z"
}
}
Game coverage
Returns clip availability stats for a game. Use it to decide whether to start polling clips, or to gate UI state on whether any matched clips exist yet.
Response
{
"gameId": "nba-2026-04-06-nyk-atl",
"game": {
"status": "final",
"homeTeam": "ATL",
"awayTeam": "NYK",
"date": "2026-04-06"
},
"coverage": {
"totalClips": 73,
"matchedClips": 51,
"processedClips": 73,
"pendingClips": 0,
"latestClipAt": "2026-04-07T02:48:11Z"
}
}
| Field | Description |
|---|---|
| totalClips | Every clip ingested for this game, regardless of match status. |
| matchedClips | Clips with a model match at high or medium confidence. These are the ones most apps will want to surface. |
| processedClips | Clips that have finished model processing (matchStatus = 'done'). Includes matched clips and any that came back without a confident match. |
| pendingClips | Clips still queued or in flight (matchStatus of pending or processing). Poll again in 30 to 60 seconds. |
| latestClipAt | Timestamp of the most recently posted clip for this game. Useful as an initial since cursor. |
Game highlights
Returns official highlight videos for a game, grouped by type. For NBA games, fullGame may contain uploads from the official NBA YouTube channel. The response shape is forward-compatible with future types such as recap, topPlays, and condensed.
Response
{
"gameId": "nba-2026-04-06-nyk-atl",
"game": {
"status": "final",
"homeTeam": "ATL",
"awayTeam": "NYK",
"date": "2026-04-06",
"nbaGameId": "0022501178"
},
"count": 1,
"highlights": {
"fullGame": [
{
"videoId": "abc123XYZ",
"title": "Knicks vs. Hawks FULL GAME HIGHLIGHTS",
"embedUrl": "https://www.youtube.com/embed/abc123XYZ",
"watchUrl": "https://www.youtube.com/watch?v=abc123XYZ",
"thumbnailUrl": "https://i.ytimg.com/vi/abc123XYZ/hqdefault.jpg",
"postedAt": "2026-04-07T04:12:03Z",
"ingestSource": "webhook"
}
]
}
}
Full-game highlights typically land 1 to 2 hours after the final buzzer. Ingest happens via the YouTube PubSubHubbub webhook in seconds, with a game-end-aware RSS poller as a fallback.
List clips
The primary endpoint. Returns all clips for a game, sorted chronologically by posting time. Each clip includes the matched play event.
Path parameters
| Parameter | Type | Description |
|---|---|---|
| gameId Required | string | Our game ID (e.g. nba-2026-04-06-nyk-atl). |
Query parameters
| Parameter | Type | Description |
|---|---|---|
| status Optional | string |
Filter by match status. One of:
matched (default): clips with a model match at high, medium, or low confidence.pending: clips still queued or being processed.all: every clip, including unmatched and skipped non-play content.
|
| since Optional | string | ISO 8601 timestamp. Return only clips posted after this time (tweet post time). Use for incremental polling against a game feed. |
| sinceProcessed Optional | string | ISO 8601 timestamp. Return only clips whose match finalized after this time (matchProcessedAt > value), sorted oldest-first. Use this as the sanctioned catchup path after an outgoing webhook retry budget exhausts: pass the last delivered event's occurredAt to reconcile retained clips in finalization order. This is bounded reconciliation, not a complete-recovery guarantee. Pending and skipped rows are excluded. |
Response
{
"gameId": "nba-2026-04-06-nyk-atl",
"game": {
"status": "final",
"homeTeam": "ATL",
"awayTeam": "NYK",
"date": "2026-04-06",
"nbaGameId": "0022501178"
},
"count": 51,
"clips": [
{
"id": 109,
"tweetId": "2041302975646179663",
"teamAccount": "nbaonnbc",
"teamId": null,
"gameId": "nba-2026-04-06-nyk-atl",
"postedAt": "2026-04-06T23:52:09.000Z",
"caption": "KAT beats everyone down the floor for the SLAM.",
"embedUrl": "https://x.com/nbaonnbc/status/2041302975646179663",
"thumbnailUrl": "https://pbs.twimg.com/media/HFQqN-PW8AAPeo5.jpg",
"playType": ["dunk"],
"playersMentioned": [],
"quarter": null,
"gameClock": null,
"clipType": "single_play",
"matchStatus": "done",
"matchConfidence": "high",
"matchedPlay": {
"timeActual": "2026-04-06T23:27:58.0Z",
"period": 1,
"clock": "PT04M59.00S",
"actionType": "2pt",
"subType": "DUNK",
"player": "K. Towns",
"teamTricode": "NYK",
"description": "K. Towns running DUNK (5 PTS) (M. McBride 1 AST)",
"scoreHome": "15",
"scoreAway": "20",
"assistPlayerNameInitial": "M. McBride"
}
}
]
}
game object and a matchedPlay stripped to client-useful fields. Internal metadata (videoUrl, matchWindow, matchReasoning) is excluded. matchedPlay can be null even on a done clip if the model processed the video but could not tie it to a specific PBP action. Filter by matchedPlay != null on the client if you only want fully-resolved matches.
Streaming (recommended for live)
Hold open one Server-Sent Events connection per game and each clip is pushed the moment the model finishes matching it. Each event carries the same per-clip shape as the list response above. Browser clients pass the API key as a query param because EventSource can't set custom headers; server-side clients can use either the query param or the X-API-Key header. EventSource reconnects automatically and replays the last 15 minutes via Last-Event-ID.
Accepts status=matched (default, only emits done + high/medium/low confidence) or status=all (every finalized clip including failed and skipped). Pending and processing transitions are never streamed.
const es = new EventSource(
`/v1/nba/games/${gameId}/clips/stream?apiKey=${key}`
);
es.onmessage = (msg) => {
const clip = JSON.parse(msg.data);
renderClip(clip);
};
Match a play
Convenience endpoint. Given a play event, return the best matching clip. The API first checks pre-matched clips from our model (instant indexed lookup) and falls back to heuristic scoring on caption and timing for clips that are still in the processing queue.
Request body
| Field | Type | Description |
|---|---|---|
| gameId Required | string | Our game ID. |
| wallClockTime Required | string | ISO 8601 timestamp of when the play occurred in real time. |
| playType Optional | string | One of our supported play types (see Play types). Improves match quality. |
| players Optional | string[] | Player names involved in the play. Full or last name is fine. |
| description Optional | string | The raw play-by-play description. Helps disambiguation. |
| team Optional | string | Team tricode or short code of the play-maker (e.g. NYK, NE, LIV). |
| period Optional | number | Game period (quarter, half, inning, or set depending on the sport). |
POST /v1/nba/clips/match
Content-Type: application/json
X-API-Key: sk_live_...
{
"gameId": "nba-2026-04-06-nyk-atl",
"wallClockTime": "2026-04-07T02:19:48Z",
"playType": "dunk",
"players": ["O. Anunoby"],
"description": "Anunoby Dunk (16 PTS)",
"team": "NYK",
"period": 3
}
Response
{
"match": {
"tweetId": "2041319802384347608",
"caption": "YESSSIRRR OG",
"embedUrl": "https://x.com/nyknicks/status/2041319802384347608",
"playType": ["dunk"],
"playersMentioned": ["Anunoby"],
"matchedPlay": { /* see MatchedPlay model */ },
"matchConfidence": "high"
},
"confidence": 0.96,
"source": "model",
"candidates": [ /* other close matches */ ]
}
| Field | Description |
|---|---|
| match | The best matching clip, or null if no clip met the minimum threshold. |
| confidence | Numeric confidence score from 0.00 to 1.00. See Confidence levels. |
| source | model for clips already matched by our modeling pipeline (the common case), heuristic for fallback matches served while the clip is still in the processing queue. |
| candidates | Up to 5 runner-up clips with scores, for debugging or UI "related clips" sections. |
List news events
Returns source posts from our tracked insiders, newest first by default. Filter by sport, category, or breaking. Extracted rows include the structured NewsEvent fields; skipped, pending, and legacy rows may use the base shape. Use breaking=true for breaking events.
category filters the stored category (for example injury or trade). type, impact, and reporter are not supported query filters; filter those response fields in your client.
Query parameters
| Parameter | Type | Description |
|---|---|---|
| sport Optional | string | Filter by sport: nba, nfl, mlb, nhl, soccer. Omit to receive cross-sport events. |
| breaking Optional | boolean | true selects breaking rows; false selects non-breaking rows. Omit to include all rows, including pending classification. |
| since Optional | string | ISO 8601 timestamp. Filters source post time only. For incremental ingestion use sinceExtracted, so delayed extraction of older posts is not missed. |
| sinceExtracted Optional | string | ISO 8601 timestamp. Returns only events whose extractor verdict finalized after this time (extractedAt > value), sorted oldest-first. Use this as the sanctioned catchup path after an outgoing webhook retry budget exhausts: pass the last delivered event's occurredAt to reconcile retained rows in extraction order. Pages are limited and timestamp ties can leave gaps; use overlap, deduplicate and escalate incomplete recovery. Rows still pending extraction are excluded. |
| limit Optional | number | Max results. Default 50, hard ceiling 200. |
Response
{
"count": 1,
"items": [
{
"id": "news_2045190996686680171",
"type": "extension",
"sport": "nfl",
"impact": "record",
"postedAt": "2026-04-17T17:21:36Z",
"extractedAt": "2026-04-17T17:22:14Z",
"tweetId": "2045190996686680171",
"latencyMs": 38000,
"headline": "Will Anderson signs $150M extension",
"subheadline": "Highest-paid non-QB in NFL history. $100M guaranteed.",
"source": {
"reporter": "Adam Schefter",
"handle": "AdamSchefter",
"outlet": "ESPN"
},
"subjects": [
{
"kind": "player",
"name": "Will Anderson Jr.",
"position": "DE",
"teamTricode": "HOU"
}
],
"contract": {
"years": 3,
"totalValueUsd": 150000000,
"guaranteedUsd": 100000000,
"avgPerYearUsd": 50000000,
"noTradeClause": true
},
"tweet": {
"id": "2045190996686680171",
"url": "https://x.com/AdamSchefter/status/2045190996686680171"
}
}
]
}
Structured extracted events share the envelope below; legacy and skipped rows may omit these fields: type, sport, impact, source, subjects[], headline, subheadline, and tweet. A type-specific detail block (contract, injury, tenure) is attached when it applies. headline + subheadline are sized to drop straight into a push notification. See NewsEvent for the full shape.
Streaming (recommended for live)
Hold open one Server-Sent Events connection and each finalized event is pushed the moment we store it after extraction completes. SSE avoids an additional client polling interval; extraction latency excludes customer receipt. Each SSE event carries the same NewsEvent payload as the list endpoint. The browser's EventSource reconnects automatically and resumes via Last-Event-ID; on reconnect we replay events from the last 15 minutes.
Accepts the same sport, breaking, and category filters as the list endpoint. Default is breaking=true (only extracted, structured events). Pass breaking=all to receive every finalized row, including ones the extractor skipped.
// News reads are currently public; keep production consumption server-side.
// Confirm access policy before activation.
const es = new EventSource(
`https://api.highlightapi.com/v1/news/stream?sport=nfl`
);
es.onmessage = (msg) => {
const event = JSON.parse(msg.data);
enqueueForEditorialReview(event);
};
es.onerror = () => {
// EventSource auto-reconnects with the last event id it saw,
// so we replay anything finalized during the outage (up to 15m).
};
Server-side clients that can't use EventSource should send the Last-Event-ID header themselves on reconnect. The value is the extractedAt ISO timestamp of the last event you received.
List insider sources
Returns the configured registry: handle, reporter name, outlet, and primary sport. This is not a live-health or entitlement endpoint. Before evaluation, agree on a dated active-source roster, categories, freshness monitoring and a support contact.
Response
{
"count": 26,
"sources": [
{
"handle": "ShamsCharania",
"name": "Shams Charania",
"outlet": "ESPN",
"sport": "nba"
}
]
}
Story clusters
Story clusters group related source reports so a sports app can keep one developing story card rather than creating a card for every post. The API field is named confidence, but it is a source-count ladder, not a probability of truth or proof of independent confirmation. Only single and multi are implemented today.
The confidence ladder
Every cluster carries a confidence value that only ever moves forward. Each transition fires a cluster.upgraded webhook and an SSE frame so your system reacts in real time.
| Rung | Meaning | Lights up when |
|---|---|---|
| single | Fewer than two distinct qualifying Tier-A handles, including Tier-B-only stories. | Any Tier-A reporter breaks a new story, or a Tier-B aggregator tweet creates a cluster that no Tier-A has touched yet. |
| multi | At least two distinct Tier-A handles appear in the cluster. They may cite the same upstream source. | A second distinct Tier-A handle posts on the same story. Same-reporter follow-ups (Shams tweeting about Shams) do not count. |
| team | The team's official PR account posted it. | Not emitted. Requires verified team-source ingestion and evaluator changes before launch. |
| official | The league office posted or confirmed it. | Not emitted. Requires verified league-source ingestion and evaluator changes before launch. |
reporters[] and members[] (you get their tweets), but only distinct Tier A handles (weight >= 1.0) count toward multi. This is load-bearing: in backtests, 11 of 14 multi-member clusters were one reporter echoing their own story 2-4 times. Counting tweet volume instead of distinct handles would have falsely upgraded all of them.
How clustering works
Each extracted insider tweet is assigned a canonical key shaped like ${type}:${sport}:${normalized_last_name}, where the last name is pulled from the first subject and normalized (NFKD + diacritic strip, suffixes like Jr. / III removed). Tweets hashing to the same key within a 12-hour rolling window join the same cluster. Each new member extends the window another 12 hours; a stale story whose last member is 13 hours old forks into a fresh cluster instead of false-merging.
The cluster's rolledUpPayload is the NewsEvent shape merged across every member. Headline and subheadline stick to the first member (the initial break sets the framing). Top-level impact and report status take the highest configured rank. Subjects merge by normalized surname; contract, injury and tenure blocks prefer the entry with more populated fields. These rules do not resolve contradictions or establish the latest true state. You also get the raw members[] array with each member's own structuredPayload, so if you want to implement your own dispute or contradiction logic client-side, the inputs are already there.
List clusters
Returns recent story clusters, newest first by updatedAt. Each cluster carries its full StoryCluster envelope including members[] and reporters[].
Query parameters
| Parameter | Type | Description |
|---|---|---|
| sport Optional | string | Filter by sport: nba, nfl, mlb, nhl, soccer. |
| type Optional | string | Filter by event type: trade, extension, signing, injury, firing, hiring, suspension, retirement, lineup, ruling, draft, award, milestone, other. |
| confidence Optional | string | Exact rung match: single, multi, team, official. This is an exact match, not a minimum: confidence=single returns only single clusters. |
| since Optional | string | ISO 8601 timestamp. Returns only clusters whose updatedAt is after this value. Use for incremental polling. |
| limit Optional | number | Max results. Default 50, hard ceiling 200. |
Response
{
"count": 1,
"clusters": [
{
"id": "7a1c8b24-3e9f-4a2b-9d6c-8f12aa34e501",
"canonicalKey": "injury:nba:wembanyama",
"keyVersion": 1,
"sport": "nba",
"type": "injury",
"impact": "high",
"confidence": "multi",
"headline": "Wembanyama out indefinitely with concussion",
"subheadline": "Stepped into protocol after last night's contact.",
"subjects": [
{ "kind": "player", "name": "Victor Wembanyama", "teamTricode": "SAS" }
],
"injury": { "status": "out", "bodyPart": "concussion protocol", "seasonEnding": false },
"firstMemberPostedAt": "2026-04-22T23:14:08Z",
"updatedAt": "2026-04-22T23:15:11Z",
"reporters": [
{ "handle": "ShamsCharania", "tier": "A", "weight": 1.0, "firstConfirmedAt": "2026-04-22T23:14:08Z" },
{ "handle": "ChrisBHaynes", "tier": "A", "weight": 1.0, "firstConfirmedAt": "2026-04-22T23:15:11Z" }
],
"members": [
{
"tweetId": "2045321...",
"handle": "ShamsCharania",
"postedAt": "2026-04-22T23:14:08Z",
"extractedAt": "2026-04-22T23:14:16Z",
"ingestSource": "x-stream",
"embedUrl": "https://x.com/ShamsCharania/status/2045321...",
"reporter": { "name": "Shams Charania", "outlet": "ESPN", "tier": "A", "weight": 1.0 },
"structuredPayload": { /* ExtractedNews shape for this specific tweet */ }
}
],
"contradictions": null,
"disputedBy": null
}
]
}
/v1/news. Clustered news events on GET /v1/news now carries a cluster: { id, confidence, reporterCount } stub. For a badge, use "Multiple tracked reporters" for multi. reporterCount includes Tier B; it is not an independent-confirmation count.
Stream clusters (SSE)
Server-Sent Events. Hold one connection open and receive a frame on every cluster transition: creation at single, progression to multi, and the future team / official rungs the moment they come online.
Accepts the same sport, type, and confidence filters as the list endpoint. The confidence filter gates on the cluster's current rung, so confidence=multi streams only frames where the transition leaves the cluster at multi.
Frame shape
id: 2026-04-22T23:15:11Z
data: {
"transition": {
"previous": "single",
"current": "multi",
"triggeringTweetId": "2045321...",
"skippedRungs": []
},
"cluster": { /* full StoryCluster envelope */ }
}
The id field on each SSE frame is the cluster's updatedAt ISO timestamp. EventSource replays this on reconnect via Last-Event-ID and we emit the current state of every cluster whose updatedAt is past the cursor (capped at 15 minutes). On replay, transition is null because we don't persist a transition log; treat replay frames as "catch me up to current state."
transition.previous: null and transition.current: "single". Filter with transitions: ["creation"] (webhooks) or check transition.previous === null (SSE) to distinguish it from a progression.
Get a cluster
Full StoryCluster envelope for one cluster by ID. Same shape as items in the list response.
Returns 404 if the cluster ID doesn't exist. id is the UUID v4 returned on every cluster envelope and on the cluster.id stub attached to /v1/news rows.
Outgoing webhooks
Webhooks are the third delivery option alongside REST polling and Server-Sent Events. Register a URL you own, and we POST each finalized event as a signed HTTPS request. Each delivery is short-lived, so your autoscaled web tier can serve webhooks the same way it serves any other request. No long-lived connections, no dedicated consumer process, no fan-out queue.
Clips, news, and story-cluster upgrades share one subscription model. A single subscription can receive any combination of news.finalized, clips.finalized, and cluster.upgraded, with filters scoped per event type.
How a delivery looks
Every webhook is an HTTPS POST with a JSON envelope body and a set of signature headers. For news.finalized and clips.finalized, the data field carries the same payload as the corresponding list endpoint (GET /v1/nba/games/:gameId/clips for clips.finalized, GET /v1/news for news.finalized). For cluster.upgraded, the envelope is lifted (no data wrapper): the transition and cluster are first-class fields at the top level. See below for the shape.
POST https://yourapp.com/webhooks/highlightapi
Content-Type: application/json
User-Agent: HighlightAPI-Webhook/1.0
X-Highlight-Delivery: 4c3a1e7b-9a2b-4d6f-a1b3-5f7c9d0e8a2c
X-Highlight-Event: news.finalized
X-Highlight-Timestamp: 1745884817
X-Highlight-Signature: sha256=3b8a7f1d...
{
"event": "news.finalized",
"deliveryId": "4c3a1e7b-9a2b-4d6f-a1b3-5f7c9d0e8a2c",
"attempt": 1,
"occurredAt": "2026-04-20T01:00:06Z",
"data": {
// Exactly the NewsEvent shape from GET /v1/news (see #model-news-event)
"type": "signing",
"sport": "nba",
"impact": "medium",
"headline": "Joe Smith signs 2-year deal with Lakers",
"subheadline": "$12M total, second year non-guaranteed.",
"source": { "reporter": "Shams Charania", "handle": "ShamsCharania", "outlet": "ESPN" },
"subjects": [ { "kind": "player", "name": "Joe Smith", "teamTricode": "LAL" } ],
"tweet": { "id": "2045190996686680171" },
"latencyMs": 6000
}
}
| Field | Type | Description |
|---|---|---|
| event | string | Event name: news.finalized, clips.finalized, cluster.upgraded, or ping. |
| deliveryId | string | UUID that stays stable across retries of the same delivery. Use it to dedupe if your receiver is idempotent. |
| attempt | number | Send attempt counter, starting at 1 and incrementing on every retry. The same deliveryId with attempt=2 means we re-sent after a failure or timeout. |
| occurredAt | string | ISO 8601 time the event finalized on our side (extractedAt for news, matchProcessedAt for clips, updatedAt for cluster upgrades). Use this as the cursor when catching up via the sinceExtracted / sinceProcessed REST params after a retry budget exhausts. |
| data | object | Present on news.finalized and clips.finalized. The same payload shape as the corresponding list endpoint. No shape drift between REST, SSE, and webhooks. Not present on cluster.upgraded: that envelope carries transition and cluster at the top level instead. |
Verify the signature
Every delivery is signed with HMAC-SHA256 over the exact raw request body using the subscription's secret. Verify on every request before you trust the body. The secret is returned exactly once when you create the subscription, so store it immediately.
X-Highlight-Signature is formatted as sha256=<hex digest>. Do a constant-time compare against the value you compute, not a plain string equality.
// Node.js / Express. The raw body is required, not JSON-parsed output.
import crypto from 'node:crypto';
import express from 'express';
const app = express();
app.post(
'/webhooks/highlightapi',
express.raw({ type: 'application/json' }),
(req, res) => {
const expected = 'sha256=' + crypto
.createHmac('sha256', process.env.HIGHLIGHT_WEBHOOK_SECRET)
.update(req.body)
.digest('hex');
const received = req.headers['x-highlight-signature'] || '';
const a = Buffer.from(expected);
const b = Buffer.from(received);
if (a.length !== b.length || !crypto.timingSafeEqual(a, b)) {
return res.status(401).end();
}
const envelope = JSON.parse(req.body.toString());
enqueue(envelope); // 2xx fast; do real work async
res.status(202).end();
},
);
# Python / Flask
import hmac, hashlib, os
from flask import Flask, request, abort
app = Flask(__name__)
SECRET = os.environ['HIGHLIGHT_WEBHOOK_SECRET'].encode()
@app.post('/webhooks/highlightapi')
def receive():
expected = 'sha256=' + hmac.new(SECRET, request.data, hashlib.sha256).hexdigest()
received = request.headers.get('X-Highlight-Signature', '')
if not hmac.compare_digest(expected, received):
abort(401)
envelope = request.get_json(force=True)
enqueue(envelope)
return ('', 202)
JSON.parse then JSON.stringify and HMACing the result will fail verification. Capture req.body as a Buffer / bytes before any parsing (use express.raw() in Node, or request.data in Flask) and pass that exact buffer to the HMAC.
Retry policy
We retry any non-2xx response, connection error, or timeout on an exponential schedule with 20% jitter. Seven attempts total over roughly 31 hours:
| Attempt | Delay after previous failure | Wall-clock (cumulative) |
|---|---|---|
| 1 | (none) | t = 0 |
| 2 | 30 s | t ≈ 30 s |
| 3 | 2 min | t ≈ 2 min 30 s |
| 4 | 10 min | t ≈ 12 min 30 s |
| 5 | 1 h | t ≈ 1 h 12 min |
| 6 | 6 h | t ≈ 7 h 12 min |
| 7 | 24 h | t ≈ 31 h 12 min |
Each attempt has a 10-second total-request timeout (connect + response). If you return a Retry-After header (integer seconds or HTTP-date), we honor it as a floor. Your hint is used when it's larger than our next scheduled delay; our schedule is used when your hint is smaller. Pass Retry-After when you're in a deploy window or a downstream dependency is slow; leave it off otherwise.
After attempt 7 fails, the delivery is marked dead. Nothing else is sent for that event. To catch up, query the REST endpoint with the sinceExtracted / sinceProcessed cursor equal to the last delivered envelope's occurredAt; reconcile retained rows, using overlap and ID deduplication. Page limits, timestamp ties and retention may leave gaps. Cluster upgrades require cluster snapshot reconciliation and do not provide a historical transition log.
The cluster.upgraded event
Fires on every transition of a story cluster, including its creation (previous: null → current: "single") and every ladder progression (single → multi, and the reserved team / official rungs once those handle sets come online). The envelope is lifted: transition and cluster are first-class fields, not nested under data.
POST https://yourapp.com/webhooks/highlightapi
Content-Type: application/json
X-Highlight-Event: cluster.upgraded
{
"event": "cluster.upgraded",
"deliveryId": "b9e4...",
"attempt": 1,
"occurredAt": "2026-04-22T23:15:11Z",
"transition": {
"previous": "single",
"current": "multi",
"triggeringTweetId": "2045321...",
"skippedRungs": []
},
"cluster": {
// Full StoryCluster envelope from GET /v1/news/clusters/:id.
// Includes rolled-up payload + members[] with per-member structuredPayload.
}
}
Filter grammar
cluster.upgraded exposes a richer filter set than the other events. The same filters object on your subscription applies; keys that don't apply to a given event type are ignored, so one subscription can safely subscribe to multiple event types without dropping events on the wrong ones.
| Filter key | Type | Matches when |
|---|---|---|
| sport | string | Cluster's sport equals the value. Same semantics as on news.finalized. |
| type | string | Cluster's type equals the value (injury, trade, signing, …). |
| impact | string | Cluster's impact equals the value. Exact match, not a minimum. |
| transitions | string[] | string | Array or single value drawn from "creation", "progression", "any". creation matches when transition.previous === null; progression matches when it isn't; any (or omitting the key) matches both. |
| toRung | string[] | string | Allowed values for transition.current: single, multi, team, official. Matches on the rung the transition landed on, not rungs passed through. |
| teamTricode | string | Case-insensitive. Matches any teamTricode, fromTeam, or toTeam inside the cluster's rolled-up subjects[]. Useful for team-specific receivers. |
| breaking, category, gameId | Ignored for cluster.upgraded. |
Common filter recipes
// Only the "multiple tracked reporters" moment. Perfect for a trader's Slack alert:
// one notification per story at the point a second Tier-A insider confirms.
{ "events": ["cluster.upgraded"],
"filters": { "transitions": ["progression"], "toRung": ["multi"] } }
// Every new story the instant the first insider tweets it.
{ "events": ["cluster.upgraded"],
"filters": { "transitions": ["creation"] } }
// NBA injury news, all rungs, team-filtered:
{ "events": ["cluster.upgraded"],
"filters": { "sport": "nba", "type": "injury", "teamTricode": "LAL" } }
transition.previous: null and transition.current: "single". Subsequent Tier-B echoes on the same story join members[] but do not fire another webhook unless they move the ladder. This matches the intuition that a second identical-content alert five seconds later isn't useful.
Create a subscription
Returns the subscription, including the HMAC secret exactly once. Save it to your secret store immediately. Subsequent GETs will not include it, and there is no "show me the secret again" endpoint. To rotate, delete the subscription and create a new one.
Request body
| Field | Type | Description |
|---|---|---|
| url Required | string | Absolute HTTPS URL we'll POST to. http:// is rejected except on loopback for local testing (localhost, 127.0.0.1). |
| events Required | string[] | Subset of ["news.finalized", "clips.finalized", "cluster.upgraded"]. At least one. The canonical list is also returned by GET /v1/webhooks/supported-events. |
| filters Optional | object | Any combination of sport, breaking, category, gameId, type, impact, transitions, toRung, teamTricode. Filter keys that don't apply to an event type are ignored for that event (e.g. a gameId filter still lets every news.finalized event through; a transitions filter is only evaluated on cluster.upgraded). See the cluster.upgraded section for the full filter grammar on that event. |
const res = await fetch('https://api.highlightapi.com/v1/webhooks', {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'X-API-Key': key },
body: JSON.stringify({
url: 'https://yourapp.com/webhooks/highlightapi',
events: ['news.finalized', 'clips.finalized'],
filters: { sport: 'nba', breaking: 'true' },
}),
});
const sub = await res.json();
// sub.secret is shown once; store it now.
Response
{
"id": "ea3c9c4e-6c0a-4d1f-a0b2-9f8c6b1a5d34",
"url": "https://yourapp.com/webhooks/highlightapi",
"events": ["news.finalized", "clips.finalized"],
"filters": { "sport": "nba", "breaking": "true" },
"active": true,
"createdAt": "2026-04-22 00:27:34",
"updatedAt": "2026-04-22 00:27:34",
"secret": "5f2e1d3c7a9b4..."
}
List your subscriptions
Returns every subscription owned by the API key making the request. Secrets are never returned after creation.
{
"subscriptions": [
{
"id": "ea3c9c4e-6c0a-4d1f-a0b2-9f8c6b1a5d34",
"url": "https://yourapp.com/webhooks/highlightapi",
"events": ["news.finalized", "clips.finalized"],
"filters": { "sport": "nba" },
"active": true,
"createdAt": "2026-04-22 00:27:34",
"updatedAt": "2026-04-22 00:27:34"
}
]
}
Get one subscription
Returns the subscription without the secret. Cross-customer reads return 404 rather than 403 so we don't leak the existence of other tenants' subscriptions.
Update a subscription
Patch any subset of url, events, filters, active. Omitted fields are unchanged. Set active: false to pause delivery without deleting the subscription; flip back to true when you're ready. The secret is not patchable (delete and re-create to rotate).
await fetch(`https://api.highlightapi.com/v1/webhooks/${id}`, {
method: 'PATCH',
headers: { 'Content-Type': 'application/json', 'X-API-Key': key },
body: JSON.stringify({ active: false }), // pause delivery
});
Delete a subscription
Returns 204 on success. Cascades into the delivery history: pending retries for that subscription stop, and already-sent deliveries are purged from the listing endpoint.
Send a test delivery (ping)
Synthesize one delivery so you can verify your receiver end-to-end (HTTPS reachability, signature verification, response timing) without waiting for a live event. The ping is queued with event: "ping" and sent by the delivery worker exactly like any other event (same signing, same retry schedule).
POST /v1/webhooks/ea3c9c4e-.../ping
→ 202 Accepted
{ "deliveryId": "7f4d3b1e-9c8a-4a9f-b2a0-1c5d7e9f2b43" }
// Then on your receiver:
POST /webhooks/highlightapi { event: "ping", deliveryId: "7f4d3b1e-...", attempt: 1,
occurredAt: "...", data: { ok: true, subscriptionId: "..." } }
Inspect recent deliveries
Returns the most recent delivery attempts for a subscription, newest first. Useful for debugging: confirming we fired, reading the response code we got back, and seeing how the retry schedule played out. Default limit=50, hard ceiling 200.
| Field | Type | Description |
|---|---|---|
| id | string | The deliveryId we sent as X-Highlight-Delivery. |
| event | string | news.finalized / clips.finalized / cluster.upgraded / ping. |
| sourceId | string | The underlying event id: tweetId for news / clips, cluster UUID for cluster.upgraded, null for pings. |
| status | string | pending (waiting to fire or in backoff), sending (in flight), delivered (2xx received), dead (retry budget exhausted). |
| attempt | number | How many attempts have been made so far (0 before the first send). |
| maxAttempts | number | Total attempts allowed before dead-lettering. Defaults to 7. |
| lastResponseCode | number|null | HTTP status from the most recent attempt. null on connection errors or timeouts. |
| lastError | string|null | Short description of the most recent failure (first 500 chars of the response body, or a fetch error like fetch: TimeoutError). |
| nextAttemptAt | string | ISO 8601 timestamp for the next scheduled attempt. In the past when status is sending or terminal. |
| deliveredAt | string|null | Set when status becomes delivered. |
| createdAt | string | When we enqueued the delivery (right after the event finalized). |
Supported events
| Event | Fires when | data shape |
|---|---|---|
| news.finalized | Extractor writes a verdict on an insider tweet (either a structured NewsEvent or a skip). | Same as GET /v1/news. |
| clips.finalized | Our matcher finishes processing a clip (done, high/medium/low match, or failed). | Same as GET /v1/nba/games/:gameId/clips. |
| ping | You called POST /v1/webhooks/:id/ping. | { "ok": true, "subscriptionId": "<id>" }. |
The canonical list is also available at GET /v1/webhooks/supported-events so SDKs can introspect without hardcoding.
Data models
Game
| Field | Type | Description |
|---|---|---|
| id | string | Our deterministic game ID. |
| nbaGameId | string | The official 10-digit NBA game ID. |
| date | string | YYYY-MM-DD (ET calendar date). |
| homeTeam | string | Home team tricode (e.g. ATL). |
| awayTeam | string | Away team tricode. |
| status | string | One of scheduled, live, final. |
| startTime | string | ISO 8601 scheduled tip-off time (UTC). |
| broadcasters | string | null | JSON-encoded list of national broadcast partners for the game, or null if none are known. Sourced from the league's official schedule feed. |
Clip
| Field | Type | Description |
|---|---|---|
| id | number | Internal row ID. Stable per clip but not meaningful across environments; prefer tweetId for cross-system references. |
| tweetId | string | X (Twitter) status ID. Unique across the system. |
| teamAccount | string | X handle that posted the clip (without @). |
| teamId | string | null | Team tricode if posted by a team account; null for league/broadcast-partner clips. |
| gameId | string | The game this clip belongs to. |
| postedAt | string | ISO 8601 post timestamp (UTC). |
| caption | string | The tweet's text content. |
| embedUrl | string | Canonical X URL for the tweet. Use this with Twitter's oEmbed or widgets.js. |
| thumbnailUrl | string | null | Static image you can show as a poster frame before the embed hydrates. null if no thumbnail was available at ingest time. |
| gameClock | string | null | Game clock parsed from the caption. Often null; use matchedPlay.clock for the authoritative value. |
| playType | string[] | Play types extracted from the caption. See Play types. |
| playersMentioned | string[] | Player names extracted from the caption. |
| quarter | number | null | Quarter extracted from the caption. Often null; rely on matchedPlay.period when you need the authoritative value. |
| clipType | string | One of single_play, montage, interview, stats, pregame, other. |
| matchStatus | string | pending, processing, done, failed, or skipped (non-play content). |
| matchConfidence | string | null | high, medium, low, or null if unmatched. |
| matchedPlay | MatchedPlay | null | The play this clip was matched to. See below. |
MatchedPlay
A subset of the official play-by-play event, stripped to client-useful fields.
| Field | Type | Description |
|---|---|---|
| timeActual | string | ISO 8601 wall-clock timestamp of when the play occurred. |
| period | number | Quarter number (1-4, 5+ for overtime). |
| clock | string | ISO 8601 duration on the game clock (e.g. PT04M12.00S = 4:12). |
| actionType | string | The play-by-play action type, normalized across sports. NBA example values: 2pt, 3pt, freethrow, rebound, turnover, block, steal, foul. NFL adds touchdown, field_goal, interception; football adds goal, assist, save; and so on. |
| subType | string | null | Specific action variant (e.g. DUNK, Jump Shot, Layup, Defensive). |
| player | string | Play-maker's name (e.g. O. Anunoby). |
| teamTricode | string | Team of the play-maker. |
| description | string | The official play description straight from the league feed. |
| scoreHome | string | Home score after the play. Strings (not numbers) because that is what upstream play-by-play feeds return. |
| scoreAway | string | Away score after the play. |
| assistPlayerNameInitial | string | null | Assisting player, if any. |
NewsEvent
The payload returned by GET /v1/news. Structured extracted events have the same top-level envelope regardless of their type, plus an optional detail block (contract, injury, tenure) that depends on the event type. Clients can safely do switch (event.type) without traversing nested objects to find the classification.
| Field | Type | Description |
|---|---|---|
| id | string | Stable unique ID. Format: news_<tweetId>. |
| type | string | Event classification: trade, extension, signing, injury, firing, hiring, suspension, retirement, lineup, ruling, draft, award, milestone, or other. |
| sport | string | Primary league: nba, nfl, mlb, nhl, soccer. |
| impact | string | Impact tier: low, medium, high, record. |
| status | string | absent | Extracted report qualification: rumored, expected, reported, confirmed. Describes source wording, not independent verification or the cluster source-count rung. Can be absent on legacy rows. |
| postedAt | string | ISO 8601 timestamp of the originating tweet. |
| extractedAt | string | null | ISO 8601 extraction-finalization timestamp. Use as the sinceExtracted cursor, with overlap and tweet-ID deduplication. |
| latencyMs | number | null | Source-post to extraction duration: max(0, extractedAt - postedAt) in milliseconds, or null when timestamps are unavailable. Excludes dispatch, network transit, webhook retries, and customer receipt. Timestamp precision limits measurement accuracy. Example values are illustrative, not production percentiles. See measurement boundaries. |
| headline | string | Short, punchy one-line summary. Designed to drop directly into a push notification title or feed card header. Validated length is 10 to 120 characters; fit or truncate to your notification layout. |
| subheadline | string | Supporting one-liner with the key stat or context. Pairs with headline to form a push notification body or a two-line card preview. Example: "Axillary artery surgery, likely out for 2026 season." |
| source | object | The reporter: { reporter, handle, outlet }. handle is the X handle without @. |
| subjects | object[] | Array of people or teams the event is about. Same shape regardless of event type; see below. |
| contract | object | absent | Present for extension and signing events. See below. |
| injury | object | absent | Present for injury events. See below. |
| tenure | object | absent | Present for firing, hiring, and retirement events. See below. |
| classifierReason | string | One-line reasoning for why this event was classified the way it was. Useful for debugging and for showing your own users why an event surfaced. |
| cluster | object | null | Stub pointer to the StoryCluster this event belongs to. Shape: { id, confidence, reporterCount }. null for rows the extractor skipped (the row was never clustered) and legacy pre-clusters rows. Fetch the full envelope with GET /v1/news/clusters/:id. |
| tweet | object | { id, url } for rendering the source tweet as an official X embed. |
Subject
An entry in the subjects[] array. Fields not relevant to the kind are omitted.
| Field | Type | Description |
|---|---|---|
| kind | string | player, coach, executive, or team. |
| name | string | Full name. |
| position | string | absent | Position for player subjects (e.g. DE, RP, PG). |
| role | string | absent | Role for coach or executive (e.g. head coach, general manager). |
| teamTricode | string | absent | Current team for the subject in this event. For trades, use fromTeam / toTeam instead. |
| fromTeam | string | absent | Trade-only: team the subject is leaving. |
| toTeam | string | absent | Trade-only: team the subject is joining. |
Contract block (extension, signing)
| Field | Type | Description |
|---|---|---|
| years | number | Contract length in years. |
| totalValueUsd | number | Total reported value in USD. |
| guaranteedUsd | number | null | Guaranteed money. null when not reported. |
| avgPerYearUsd | number | AAV, computed when not explicitly reported. |
| noTradeClause | boolean | null | NFL- and NBA-specific. null when not mentioned. |
Injury block
| Field | Type | Description |
|---|---|---|
| status | string | One of surgery, il, out, questionable, day-to-day. |
| bodyPart | string | Injury description (e.g. torn ACL, right knee). |
| estimatedReturnMonths | number | null | Months until projected return. null when unreported. |
| seasonEnding | boolean | Whether the injury is likely to end the subject's current season. |
Tenure block (firing, hiring, retirement)
| Field | Type | Description |
|---|---|---|
| seasons | number | Seasons with the team. |
| record | string | Win-loss record as a string (e.g. 97-103). |
| playoffs | string | Short summary of playoff results during the tenure. |
StoryCluster
The payload returned by GET /v1/news/clusters and GET /v1/news/clusters/:id, and wrapped inside cluster.upgraded webhooks. One cluster represents one story; its members are the individual insider tweets about that story, each of which is itself a NewsEvent.
| Field | Type | Description |
|---|---|---|
| id | string | UUID v4. Stable for the life of the cluster. |
| canonicalKey | string | The deterministic key used for membership: ${type}:${sport}:${normalized_last_name}. Exposed for debugging; do not parse it, the algorithm can change (see keyVersion). |
| keyVersion | number | Version of the canonical-key algorithm that produced this cluster. Bumped when we change normalization rules. Do not assume an automatic migration or stable cross-version membership; any migration requires an explicit rollout. |
| sport | string | nba, nfl, mlb, nhl, soccer. |
| type | string | Event classification. Same enum as NewsEvent. |
| impact | string | Highest impact tier across all members. low, medium, high, record. |
| confidence | string | Current rung on the ladder: single, multi, team, official. Only ever moves forward. |
| headline, subheadline, subjects, contract, injury, tenure | Rolled-up NewsEvent shape merged across all members. Headline and subheadline stick to the first member. Impact and top-level report status take their highest configured rank; subjects merge by surname and detail blocks prefer more populated fields. These rules do not resolve conflicting claims. | |
| members | ClusterMember[] | Every insider tweet in this cluster, oldest first. See below. |
| reporters | ClusterReporter[] | Distinct reporters in this cluster with their tier and weight. See below. |
| firstMemberPostedAt | string | ISO 8601. postedAt of the first member tweet. Does not change once the cluster exists. |
| updatedAt | string | ISO 8601. Bumped on every new member and every ladder transition. This is the cursor used by the SSE replay (Last-Event-ID) and the since query param. |
| contradictions | object | null | Reserved. Always null today. Populated by a future branch that detects when a later tweet retracts or contradicts an earlier one in the cluster. |
| disputedBy | object | null | Reserved. Always null today. Paired with contradictions; will list the members whose payload disagrees with the rolled-up view. |
ClusterMember
One entry in members[]. Every member is one insider tweet that hashed to this cluster's canonical key.
| Field | Type | Description |
|---|---|---|
| tweetId | string | X tweet ID. Matches the tweet.id on the corresponding NewsEvent. |
| handle | string | X handle of the reporter (no @). |
| postedAt | string | ISO 8601. When the tweet was posted on X. |
| extractedAt | string | ISO 8601. When our extractor finalized this member's structured payload. |
| ingestSource | string | x-stream, apify, or apify-redundancy. Rarely needed in production; useful when reconciling which ingest path caught the tweet first. |
| embedUrl | string | Canonical https://x.com/<handle>/status/<tweetId> URL for the official X embed. |
| reporter | object | null | { name, outlet, tier, weight }. Tier "A" (weight 1.0) reporters advance the ladder; Tier "B" (weight 0.3) do not. |
| structuredPayload | object | The full NewsEvent shape extracted from this specific tweet. Use it if you want to implement your own dispute / contradiction logic client-side: compare members' payloads against each other directly. |
ClusterReporter
Distinct reporters on the cluster, in first-membership order. Field names containing "confirmed" do not establish independent verification.
| Field | Type | Description |
|---|---|---|
| handle | string | X handle (no @). |
| tier | string | A or B. |
| weight | number | 1.0 for Tier A, 0.3 for Tier B. Only weight >= 1.0 counts toward the multi rung. |
| firstConfirmedAt | string | ISO 8601 of this reporter's first member tweet in the cluster. |
ClusterTransition
Attached to every SSE frame and cluster.upgraded webhook. On SSE replay frames it is null.
| Field | Type | Description |
|---|---|---|
| previous | string | null | null on cluster creation. Otherwise the rung the cluster was at before this transition. |
| current | string | The rung the cluster is at after this transition. |
| triggeringTweetId | string | The tweet whose arrival caused the transition. |
| skippedRungs | string[] | Rungs skipped over (e.g. a jump from single straight to team would carry ["multi"]). toRung filters match on current, not on rungs the cluster passed through. |
Displaying clips
Every clip we return is an official X (Twitter) embed. We do not host or redistribute the video files ourselves. This is both a legal requirement and the mechanism that attributes the clip to its owner (team, league, or broadcast partner). Use the embedUrl or tweetId to render the embed in your app.
Web (recommended)
Use Twitter's official embedded tweets (widgets.js) or oEmbed API.
<!-- Include widgets.js once in your app -->
<script async src="https://platform.twitter.com/widgets.js"></script>
<!-- For each clip, inject a blockquote -->
<blockquote class="twitter-tweet" data-media-max-width="560">
<a href="https://x.com/nyknicks/status/2041319802384347608"></a>
</blockquote>
Mobile (iOS & Android)
On native, render the embed in a WKWebView / WebView pointing at https://publish.twitter.com/oembed?url={embedUrl}, or use Twitter's TwitterKit-compatible libraries. Deep-link to the X app on tap for the full experience.
Embedding at scale: one embed at a time
Twitter's embed infrastructure rate-limits hydration when many tweets render on the same page in the same render-burst. If you exceed this limit, users see a "The media could not be played" error inside the embed.
Recommended integration pattern:
- Render at most one active Twitter embed in a given view at a time. When the user taps a new clip, destroy the previous embed before hydrating the new one.
- For clip feeds, show play cards (metadata only: player, score, timestamp) and hydrate the embed only when a card is expanded or enters the main viewport.
- If you must show multiple embeds on one screen, stagger hydration with a 300-500ms delay between each.
- Lazy-load embeds with an
IntersectionObserverrather than rendering all of them on page load.
API rate limits
Rate limits are enforced per API key. Contact us if your integration needs higher limits.
| Tier | Requests / minute | Burst |
|---|---|---|
| Development | 60 | 120 |
| Production | 600 | 1,200 |
| Enterprise | Custom | Custom |
When you exceed the limit, the API returns 429 Too Many Requests with a Retry-After header indicating when to retry.
Error handling
Errors are returned as JSON with an error field describing what went wrong. HTTP status codes follow conventional REST semantics.
error field.X-API-Key header.Retry-After header.Error response shape
{
"error": "date query parameter is required (YYYY-MM-DD)"
}
Play types
When calling POST /v1/nba/clips/match, use one of these canonical play type strings for best match quality. Play types also appear in the playType array on each clip.
The list below covers the implemented NBA clip API. Other sport demonstrations do not imply corresponding live match endpoints.
Additional types: putback, tip_in, and_one, four_point_play, buzzer_beater, game_winner, free_throw, turnover, foul, poster, chase_down_block, crossover, ankle_breaker, no_look, behind_the_back, and more. Contact us for the full list.
Confidence levels
Every matched clip has a matchConfidence field set by our model after analyzing the video. The match endpoint also returns a numeric confidence from 0.00 to 1.00.
Confidence labels are model assessments, not measured probabilities or accuracy guarantees. Evaluate a labeled sample before selecting a display threshold for your product.
| Level | Numeric range | Meaning |
|---|---|---|
| high | 0.85 to 1.00 | The model reports strong visual or audio agreement. Review representative matches before relying on this label. |
| medium | 0.65 to 0.84 | Strong match with some ambiguity (for example, two similar plays in the same window). Recommended for display. |
| low | 0.40 to 0.64 | Best guess among the candidates. Consider hiding from production feeds or marking it as a "possible match". |
The list-clips endpoint returns matches at all three levels when status=matched. Use ?status=all to also see clips the model processed without a confident match, or clips that were skipped as non-play content (interviews, promos, stats cards).
The POST /v1/nba/clips/match endpoint applies stricter numeric cutoffs. Model-sourced matches return at confidence >= 0.20, and the heuristic fallback returns at confidence >= 0.30. Below those floors, match is null and you still get the top candidates for inspection.
Changelog
| Date | Change |
|---|---|
| 2026-04-23 | Added story clusters and the confidence ladder (single → multi → team → official). Every extracted insider tweet is now grouped with prior tweets about the same story and surfaced via GET /v1/news/clusters, /v1/news/clusters/stream (SSE), and the new cluster.upgraded webhook event. GET /v1/news rows now carry a cluster: { id, confidence, reporterCount } stub. Webhook filters gained transitions, toRung, type, impact, and teamTricode for subscribers who want to wake up only on multiple qualifying reporter coverage. |
| 2026-11-13 | Added news-only sports-app evaluation guidance, accurate source-ladder semantics, rights and correction boundaries. Removed unverified latency commitments. |
| 2026-11-03 | Historical change (superseded November 13): aligned the docs with then-published homepage latency claims. Separated video timing and legacy polling from that commitment, documented timestamp boundaries, and corrected news polling and NBA clip coverage guidance. |
| 2026-04-22 | Added outgoing webhooks (private beta) as a third delivery mode alongside REST polling and SSE. One subscription covers both news.finalized and clips.finalized; deliveries are HMAC-SHA256 signed and retry on a 7-attempt / ~31-hour jittered schedule. Added sinceExtracted to GET /v1/news and sinceProcessed to GET /v1/nba/games/:gameId/clips as the sanctioned catchup path for retry-exhausted webhooks. |
| 2026-04-20 | Added Server-Sent Events streaming for both feeds: GET /v1/news/stream and GET /v1/nba/games/:gameId/clips/stream. Each event is pushed the moment our pipeline finalizes the row, replacing the polling round-trip. Auth now also accepts ?apiKey= as a query param for browser EventSource clients that can't attach custom headers. |
| 2026-04-18 | Added GET /v1/news with per-reporter tiered polling (top breakers at 60s), a classified breaking filter, and structured NewsEvent payloads (contract, injury, tenure detail blocks keyed off top-level type). |
| 2026-04-14 | Earlier multi-sport clip availability claims are superseded by the coverage correction dated 2026-11-03. Implemented clip routes use /v1/nba/. |
| 2026-04-09 | Added /api/oembed proxy for server-side Twitter embed caching. Documented single-embed rendering guidance. |
| 2026-04-08 | Added status=all filter on the clips endpoint. |
| 2026-04-05 | Added GET /v1/nba/games/by-nba-id/:nbaGameId for provider-ID integrations. |
| 2026-04-01 | Expanded NBA broadcast partner scraping. |
| 2026-03-24 | Initial public beta: v1 endpoints live. |