Test the Pinnacle odds WebSocket with wscat
Answer: run npx wscat -c "wss://pinnfeed.io/v1/stream?key=ps_live_your_key&sports=soccer&main=true". Because the URL carries sports, the server subscribes you straight away and sends welcome, subscribed, the snapshot parts and then delta frames. Without query filters, paste a JSON subscribe within 30 seconds or the server closes with 4002 no_subscription. Needs a Builder or Pro key.
Option A: filters in the URL#
npx wscat -c "wss://pinnfeed.io/v1/stream?key=ps_live_your_key&sports=tennis&markets=moneyline&main=true"
URL filters accept the same names as the JSON message (sports, events, leagues, markets, live, main), comma-separated. Auto-subscribe triggers when sports or events is present.
Option B: header + JSON#
npx wscat -c wss://pinnfeed.io/v1/stream -H "x-api-key: ps_live_your_key"
> {"type":"subscribe","sports":["basketball"],"markets":["spread","total"],"main":true}
websocat works the same way: websocat -H "x-api-key: ps_live_your_key" wss://pinnfeed.io/v1/stream.
Keep it alive#
The server sends {"type":"ping"} every 20 s and closes the socket after 60 s without a pong. wscat does not answer JSON pings by itself, so for longer sessions type {"type":"pong"} or switch to a script: ping/pong, Python client.
Common answers on connect#
| You see | Meaning |
|---|---|
401 missing_key / invalid_key | No key, or an unknown or revoked key |
403 plan_lacks_ws | Free/Hobby key: WebSocket starts at Builder |
429 connection_limit | Already 3 (Builder) or 10 (Pro) open connections |
close 4002 no_subscription | No subscribe within 30 s |
Plans#
Builder (€99/mo, 3 connections) or Pro (10). 3-day trial; a card is required and it is charged after day 3 unless you cancel. Docs.
Educational content for adults (18+).
Related: curl OpenAPI recipes.
Questions people ask#
Is the key in the URL safe?#
It works, but URLs end up in shell history and logs. Prefer the header outside quick tests, and rotate the key if it leaked.
Why is the first message so big?#
The snapshot holds every event and market matching your filters, split into parts; narrow the filters for a lighter test.
Can I enable compression?#
wscat does not negotiate permessage-deflate by default; libraries can: compression.