Tools · for developers

WebSocket subscription builder

Pick leagues or sports, books and markets, and copy the subscribe message for the PricedOdds WebSocket and a Node client that sends it. It runs in your browser and connects to nothing. The key stays in your own environment variable, PRICEDODDS_API_KEY.

Filter by
Send leagues or sports. None picked means every league in your plan.
40 leagues with data now, carried by the most books. Every league id is in coverage.json.
The socket accepts "live" or no status (scheduled and live).
Ctrl or Cmd click to pick more than one. None picked means every market. Keys seen in the leagues or sports above; "real-time" marks the 64 keys pushed over the socket as they change.
books (optional)
Only books in your plan. None ticked means every book in your plan, and books you add to the plan later arrive with a fresh snapshot.
include (optional)
best: best price per selection. fair: no-vig fair price.
Resume

Your message Example

Message (send it after the ready frame)

{"type":"subscribe","leagues":["nba"],"markets":["moneyline"],"include":["best","fair"]}

Node client (stream.mjs)

// stream.mjs · Node 22 or later (built-in WebSocket)
// Run: PRICEDODDS_API_KEY=your_key node stream.mjs
const ws = new WebSocket('wss://api.pricedodds.com/v1/stream');
const subscribe = {"type":"subscribe","leagues":["nba"],"markets":["moneyline"],"include":["best","fair"]};
ws.onopen = () => ws.send(JSON.stringify({ type: 'auth', key: process.env.PRICEDODDS_API_KEY }));
ws.onmessage = (m) => {
  console.log(m.data);
  if (JSON.parse(m.data).type === 'ready') ws.send(JSON.stringify(subscribe));
};
ws.onclose = (e) => console.error('closed', e.code);
setTimeout(() => ws.close(), 20000);

On 25 November 2026 we sent subscribe messages with leagues, sports, books, markets, include and status, and resume messages, to the API with a test key: each got its snapshot or resume_ok. The Node client is the one run on the WebSocket page, with only the message changed. Leagues, sports, books and market keys: coverage response of 2026-11-28 17:22 UTC.

How a subscription works

Connect to wss://api.pricedodds.com/v1/stream, authenticate, wait for ready and send one subscribe message. You get snapshot frames with the current prices, in parts, then price frames when a price changes. Every field is optional; lists are JSON arrays of ids. The full protocol, with resume and entitlement changes, is on the WebSocket page of the docs.

FieldValuesDefault
leaguesLeague ids, such as nbaEvery league in your plan
sportsSport ids, such as basketballEvery sport
booksBook ids in your planEvery book in your plan
marketsMarket keys without a period, such as spreadEvery market
includebest, fair-
statusliveScheduled and live
since_seqHighest seq received (resume only)-

A mistyped league, sport, market or book returns an error frame with a fix and did_you_mean, the same as the REST API. WebSocket comes with All-Access or the WebSocket add-on; see pricing. For one-off REST calls, the request builder writes the URL, curl and Node.

Questions

Does this page connect to the WebSocket?

No. It only writes text: the JSON message and the Node client. Nothing is sent anywhere. You run the client yourself with your own key.

Where does the key go?

The client reads it from the PRICEDODDS_API_KEY environment variable and sends it as the first message, {"type":"auth","key":...}. A server can send it in the Authorization header instead. Keep the key on your server, not in browser code.

What if I leave every list empty?

All fields of a subscription are optional. With no leagues, sports, books or markets you get every event and market of every book in your plan, which is a large snapshot. Narrow it with leagues or sports and markets.

Can I subscribe to one period, such as spread@1h?

Not over the socket today: a market key with a period suffix returns an unknown_market error frame. Subscribe to the market key (spread) and keep the periods you want from the period field of each market and change.

When do I send resume instead of subscribe?

After a reconnect. Store the highest seq you received and send it as since_seq with the same filters. You get resume_ok and the missed frames, or resync and a fresh snapshot if it is too old.

Is this betting advice?

No. It is a tool for writing WebSocket messages. PricedOdds is a data API, not a sportsbook, and takes no bets.

Other tools: Odds API request builder · Live +EV sample · Market key finder · Odds converter. All tools.

Informational only; not betting advice. PricedOdds is a data API, not a sportsbook, and takes no bets. Prices move fast and can be wrong; nothing here is a promise of profit. 21+ in most US states. Responsible gaming.