Why the Stream API Has a New Address: stream.pulsescore.net
Delta streams now connect straight to our stream server at stream.pulsescore.net. The Cloudflare address stays as the fallback. Here is why we changed it.
As of 20 November 2026 the Stream API has its own address, wss://stream.pulsescore.net/api/stream/ws. It connects you straight to our stream server, with no CDN in between. The address you use today, wss://api.pulsescore.net/api/stream/ws, keeps working and becomes the fallback. Both addresses take the same key and plans, and send the same frames and seq, so switching means changing one line.
In short
- Use
wss://stream.pulsescore.net/api/stream/wsfor delta streams. - Keep
wss://api.pulsescore.net/api/stream/wsas the fallback, for when the direct address cannot be reached from your network. - Nothing else moves. REST, the live WebSocket (
/api/{bookmaker}/ws/live) and the Matching API stay onapi.pulsescore.net.
Why we changed it
Every PulseScore address sits behind Cloudflare. That suits REST well: each request is short, and the CDN keeps traffic that should never reach our servers away from them. A delta stream is different. It is one WebSocket that stays open for hours, and every time it drops, the client has to reconnect and resume.
In November two customers on the US East Coast told us their stream sockets kept dropping, every few minutes in the US afternoon and evening. Our logs showed something unusual. When a socket died on the customer's side, our end of it was still open and healthy, and our pings were still being answered. Often we only learned of a drop when the customer reconnected and named the lost socket, which we then closed. The break was between the customer and Cloudflare, not between Cloudflare and us.
The two customers had nothing in common but the region: one ran in a cloud data centre, the other on a home fibre line. Yet on 18 November they lost their sockets within 20 seconds of each other 85 times. A pattern like that points at the network both of them shared, and the only network they shared was Cloudflare's edge. Cloudflare moves traffic between its data centres to balance load. A short request never notices. A WebSocket that is open at that moment is cut on the visitor's side, while the connection from Cloudflare to us stays up. That matches everything we saw.
We changed our Cloudflare plan first. The drops halved but did not stop. So we gave the stream an address that does not go through Cloudflare at all.
What we measured
We compared the same two customers over the same hours, from 15:19 to 02:52 UTC. Customer A moved to the direct address at 20:11 UTC on 19 November. Customer B stayed on Cloudflare.
| Evening | Customer A | Customer B |
|---|---|---|
| 18 Nov, Cloudflare | 146 drops | 100 drops |
| 19 Nov until 20:11 UTC, Cloudflare | 35 drops | 29 drops |
| 19 Nov from 20:11 UTC | 0 drops (direct) | 17 drops (Cloudflare) |
After the switch, both of customer A's sockets stayed up without a single drop. They were still open when we stopped measuring, 6 hours 42 minutes later. Over the same hours, customer B was still being cut on Cloudflare.
What is the same on both addresses
- The same stream server sits behind both. The key, plan limits, frames,
seqand close codes are identical. - Your plan's connection cap counts both together. Two addresses never mean extra connections.
sinceandreplaceswork across them. A socket opened on one address can resume, or replace, a socket lost on the other.- Compression, heartbeats and our deploys behave as before. A deploy still sends one 1012 close, and you resume in under a second.
- The certificate is an ordinary public one, and the address answers on IPv4 and IPv6.
How to switch
Change the host in your socket URL. Nothing else changes:
wss://stream.pulsescore.net/api/stream/ws?key=YOUR_API_KEY&bookmakers=bet365,onexbet&sports=soccer,tennis&kinds=live,prematch/api/stream/capabilities and /api/stream/doc work on the new host as well. Every other path there answers 404.
Falling back to Cloudflare
Fall back only when the direct address cannot be reached at all. That can happen on a network that allows only well-known CDNs, during a DNS problem, or if we take the direct address out of service for maintenance. A simple rule:
- Start on
stream.pulsescore.net. - Count the closes since your last
connectedframe. From the third one on, alternate between the two addresses. - A
connectedframe resets the count, so after a drop you go back to the direct address first.
Switching addresses does not fix a handshake refusal. A 401 (key), 402 (plan) or 403 (blocked) is answered the same way on both. If your library shows you the HTTP status, stop on those instead of switching.
The reference clients read their url before every attempt, so the rule fits in a few lines. In JavaScript, with apply.js:
import { StreamConnection } from "./apply.js";
const DIRECT = "wss://stream.pulsescore.net/api/stream/ws";
const FALLBACK = "wss://api.pulsescore.net/api/stream/ws";
const conn = new StreamConnection({
url: DIRECT,
key: "YOUR_API_KEY",
streams: [{ bookmaker: "bet365", kind: "live", sport: "soccer" }],
onFrame: ({ stream, type }, client) => {
if (type === "delta") render(stream, client.board(stream).toArray());
},
onState: (state, info) => {
// attempt = closes since the last "connected" (0 on the very first connect)
if (state === "connecting") conn.url = info.attempt < 3 || info.attempt % 2 === 0 ? DIRECT : FALLBACK;
},
});
conn.connect();The same in Python, with apply.py:
import asyncio
from apply import StreamConnection # pip install websockets
DIRECT = "wss://stream.pulsescore.net/api/stream/ws"
FALLBACK = "wss://api.pulsescore.net/api/stream/ws"
def on_state(state, info):
if state == "connecting":
conn.url = DIRECT if info["attempt"] < 3 or info["attempt"] % 2 == 0 else FALLBACK
conn = StreamConnection(
DIRECT, key="YOUR_API_KEY",
streams=[{"bookmaker": "bet365", "kind": "live", "sport": "soccer"}],
on_state=on_state,
)
asyncio.run(conn.run())Writing your own client? Do the same around your reconnect loop, and keep a connect timeout of about 10 seconds so an unreachable address fails fast.
The JavaScript SDK
From version 0.3.0 the SDK (@pulsescore/sdk) does all of this for you. ps.stream() connects to stream.pulsescore.net, falls back to api.pulsescore.net by the rule above, and goes back to the direct address after the next socket that works. Update with npm install @pulsescore/sdk@latest; nothing else in your code changes. The options streamUrl and streamFallbackUrl change the two addresses, and streamFallbackUrl: null turns the fallback off. Older versions keep streaming through api.pulsescore.net, which still works.
Things to know
- The direct address is for delta streams only. Keep REST calls and the live WebSocket on
api.pulsescore.net. - The direct address has its own per-address limits against abuse. They are far above what any plan can open.
- Latency stays the same. A delta still arrives 1–2 seconds after the bookmaker's change. The change is about fewer drops, not a faster feed.
The full reference is in the Stream API docs.
Frequently asked questions
Do I have to switch to stream.pulsescore.net?
No. api.pulsescore.net keeps serving the Stream API. We recommend the direct address, especially if your sockets drop more often than our deploys explain (one 1012 close per deploy).
Do the two addresses count as separate connections?
No. The same stream server sits behind both, and your plan's connection cap counts your sockets on both addresses together.
Can I resume a stream on the other address?
Yes. seq is the same on both addresses, so since resumes a stream on either one, and replaces names a lost socket whichever address it was opened on.
Can I call REST on stream.pulsescore.net?
No. The direct address serves only /api/stream/ws, /api/stream/capabilities and /api/stream/doc. REST, the live WebSocket and the Matching API stay on api.pulsescore.net.
Will api.pulsescore.net stop serving streams?
No. It stays as the fallback, for networks that cannot reach the direct address and for any time we take the direct address out of service.
Keep reading
Live Odds: REST Polling vs WebSocket vs Delta Streams
REST polling, the live WebSocket or the delta Stream API? How PulseScore's three ways to get live odds compare on limits, bandwidth, code and plans.
How to Choose a Sports Odds API: 10 Things to Check
A practical checklist for evaluating a sports odds API: coverage, market depth, live latency, delivery, schema, racing, results, rate limits, pricing and docs.