On the wire · 04:52:27 UTC Live 548 · Prematch 14,380 · Markets 56,938 Vol. I · No. 5 · Friday 13 November 2026 wss://pinnfeed.io/v1/stream
PinnFeed
Answer · Node.js · WebSocket

Apply Pinnacle WebSocket snapshot and deltas in a Node Map

Updated · PinnFeed · 1 min read

Answer: After subscribe, apply snapshot part frames into a Map keyed by market id (eventId:key), then apply each delta changes[] (upsert / remove). Full client: Python/Node guide. Needs Builder (€99/mo).

Core merge logic#

import WebSocket from "ws";

const markets = new Map(); // id -> market object
const KEY = process.env.PINNFEED_KEY;

function applyChange(ch) {
  if (ch.op === "upsert" || ch.type === "upsert") {
    const m = ch.market || ch.value;
    markets.set(m.id, m);
  } else if (ch.op === "remove" || ch.type === "remove") {
    markets.delete(ch.id || ch.marketId);
  }
}

const ws = new WebSocket("wss://pinnfeed.io/v1/stream", {
  headers: { "x-api-key": KEY },
  perMessageDeflate: true,
});

ws.on("open", () => {
  ws.send(JSON.stringify({
    type: "subscribe",
    sports: ["soccer"],
    markets: ["moneyline"],
    main: true,
  }));
});

ws.on("message", (buf) => {
  const msg = JSON.parse(buf.toString());
  if (msg.type === "ping") return ws.send(JSON.stringify({ type: "pong" }));
  if (msg.type === "snapshot" || msg.part != null) {
    for (const m of msg.markets || []) markets.set(m.id, m);
  }
  if (msg.type === "delta" && Array.isArray(msg.changes)) {
    for (const ch of msg.changes) applyChange(ch);
  }
});

Field names follow the WebSocket docs. Paid plans: 3-day trial; a card is required and it is charged after day 3 unless you cancel. Educational content for adults (18+).

Questions people ask#

Do I merge events the same way?#

Yes — keep a second Map for events if you need home/away metadata; snapshot and delta frames can carry both.

Why Builder?#

Free/Hobby keys get 403 plan_lacks_ws on the WebSocket. REST pollers work on Free; push needs Builder or Pro.

The WebSocket plan: Builder, €99/mo.

Real-time Pinnacle odds pushed over one WebSocket, all 13 sports, every market, no-vig fair odds and closing lines. 3 days free, cancel in one click.

Form K-1 · Free API key

Get your free API key.

One field. No password, no card: enter your email, click the link we send, and your key is on screen.

By continuing you agree to the Terms and Privacy Policy.

One free key per email. Link valid for 20 minutes.