NFL WebSocket API

Subscribe once and NFL score changes, kickoffs, plays and finals are pushed to your app as they happen, instead of polling a REST endpoint during every game window.

Data is aggregated from public sources and is typically 20-30 seconds behind live play (about 1 second after our source). There is no SLA.

AvailableEvery monitored league streams over the same connection; filter to NFL in the subscribe message.

Endpoint

  • GET/api/v1/websocket/auth
  • Each delivered message counts toward your monthly quota.
  • The server pings every 2 minutes to keep connections open behind proxies.

Connect and subscribe to NFL

JavaScript (Node 22+ or a browser)

const auth = await fetch("https://www.realtimesportsapi.com/api/websocket/auth", {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.RSA_API_KEY}` }
});
const { data } = await auth.json(); // { url, token, expiresIn: 3600 }

const ws = new WebSocket(`${data.url}?token=${data.token}`);
ws.onopen = () => {
  for (const event of ["event_score_change", "event_play", "event_final"]) {
    ws.send(JSON.stringify({ type: "subscribe", event, filters: { sport: "football", league: "nfl" } }));
  }
};
ws.onmessage = (msg) => console.log(JSON.parse(msg.data));

Python

import os, json, requests, websocket  # pip install websocket-client

auth = requests.post(
    "https://www.realtimesportsapi.com/api/websocket/auth",
    headers={"Authorization": f"Bearer {os.environ['RSA_API_KEY']}"},
    timeout=10,
).json()["data"]

ws = websocket.create_connection(f"{auth['url']}?token={auth['token']}")
for event in ["event_score_change", "event_play", "event_final"]:
    ws.send(json.dumps({"type": "subscribe", "event": event,
                        "filters": {"sport": "football", "league": "nfl"}}))
while True:
    print(json.loads(ws.recv()))

Message types: event_score_change, event_live, event_status_change, event_play, event_final and event_odds_change. Tokens last an hour; reconnect with a fresh token. Each delivered message counts toward your plan's WebSocket allowance.

Rate limits and pricing

PlanPriceCallsRateWebSocketWebhooks
Free$0125/mo (1,000 first 30 days)1/s500 msgs/moNo
Starter$29/mo ($290/yr)10,000/mo5/sShares monthly poolShares monthly pool
Growth$49/mo ($490/yr)25,000/mo10/sShares monthly poolShares monthly pool
Pro$99/mo ($990/yr)50,000/mo20/s100,000 msgs/mo25,000/mo
Business$179/mo ($1,790/yr)150,000/mo40/s300,000 msgs/mo75,000/mo
Scale$299/mo ($2,990/yr)500,000/mo100/s500,000 msgs/mo100,000/mo

Every successful REST call counts as one call. Over the limit you get HTTP 429 with a Retry-After header. No SLA. Full pricing.

FAQ

Is there a free NFL WebSocket API?
WebSocket is on every paid plan from $29/month (on Starter, REST calls, WebSocket messages and webhook deliveries share 10,000 a month). The free key has a 500-message monthly preview on 1 connection, enough to see it working.
How fast are NFL updates over WebSocket?
Each event goes out about a second after our source sees it, which is typically 20-30 seconds behind live play. Fine for apps, alerts and scoreboards; not for in-play betting.
WebSocket or webhooks?
WebSocket suits an app or server that stays connected. Webhooks suit serverless code: we POST each event to your URL. Both are on every paid plan.

Related