Developers / Live stream
One connection, and price changes, market moves, first prices, results and arbitrage opportunities arrive as they happen. Server-sent events: the HTTP alternative to a WebSocket.
GET https://api.puntersedge.online/v1/stream with your key in X-API-Key. The response is a text/event-stream that stays open: each message carries an id, an event name and a JSON data line.
On Business and above, at 3 credits per connected minute (180 an hour), however many events arrive.
Reconnect with the last id you saw and the events you missed are replayed first. Webhooks are the other push channel, for events your server should receive without holding a connection open: see the API reference.
curl -N -H "X-API-Key: $PE_KEY" \
"https://api.puntersedge.online/v1/stream?country=AU&events=race.prices,race.result"
-N turns off curl's buffering so each event prints as it arrives. A : ping comment line arrives every 15 seconds, so a quiet stream reads differently from a dead one.
Pass events= as a comma list, or leave it out for all of them.
| Event | When it is sent |
|---|---|
race.prices | The runners on a race whose win or lay price changed, with the latest price per bookmaker and runner and the previous win price. Changes on a race are collected and sent together every 3 seconds. |
race.move | A runner's consensus price has moved 10%, 20%, 30% and 50% from its opening price, across 3 or more bookmakers. Sent once per runner, direction and band, with each bookmaker's open and current price. |
race.odds_open | A race's first prices. The same body as the webhook of that name. |
race.result | A result when it first appears, and again when it is final. The same body as the webhook. |
arb.opportunity | An arbitrage opportunity. The same body as the webhook. |
Filters, each a comma list: category (horse, greyhound, harness), country (for example AU,NZ) and venue (the venue name, ignoring case). A filter that is set drops events that do not carry that field, so a sports arbitrage opportunity, which has no venue, never reaches a venue-filtered stream.
A race.prices message looks like this:
id: 1795223057257-0
event: race.prices
data: {"race_id": "067b4029-db5f-42f5-ae13-0682aa642172", "venue": "Cranbourne", "race_number": 6,
"category": "horse", "country": "AU", "start_time": "2026-11-21T04:10:00Z",
"runners": [{"name": "Example Runner", "number": 14, "bookmaker_key": "ladbrokes_au",
"win_price": 9.5, "place_price": 2.0, "prev_win_price": 8.0,
"updated_at": "2026-11-21T01:12:58.718018Z"}], "changes": 1}
The data line is one line on the wire; it is wrapped here to fit.
import json, time
import httpx
URL = "https://api.puntersedge.online/v1/stream"
PARAMS = {"country": "AU", "events": "race.prices,race.result"}
last_id = None
def handle(event, data):
print(event, data.get("venue"), data.get("race_number"))
while True:
headers = {"X-API-Key": "YOUR_KEY"}
if last_id:
headers["Last-Event-ID"] = last_id
try:
with httpx.stream("GET", URL, headers=headers, params=PARAMS, timeout=None) as r:
r.raise_for_status()
event, data = None, []
for line in r.iter_lines():
if line.startswith("id:"):
last_id = line[3:].strip()
elif line.startswith("event:"):
event = line[6:].strip()
elif line.startswith("data:"):
data.append(line[5:].strip())
elif line == "" and event:
if event == "reset":
last_id = None # re-fetch the board, then reconnect from now
else:
handle(event, json.loads("\n".join(data)))
event, data = None, []
except httpx.HTTPError as e:
print("stream dropped:", e)
time.sleep(3)
const URL = "https://api.puntersedge.online/v1/stream?country=AU&events=race.prices,race.result";
let lastId = null;
function handle(event, data) { console.log(event, data.venue, data.race_number); }
async function run() {
const headers = { "X-API-Key": process.env.PE_KEY };
if (lastId) headers["Last-Event-ID"] = lastId;
const res = await fetch(URL, { headers });
if (!res.ok) throw new Error("HTTP " + res.status);
const decoder = new TextDecoder();
let buf = "";
for await (const chunk of res.body) {
buf += decoder.decode(chunk, { stream: true });
let i;
while ((i = buf.indexOf("\n\n")) >= 0) {
const block = buf.slice(0, i);
buf = buf.slice(i + 2);
let event = null;
const data = [];
for (const line of block.split("\n")) {
if (line.startsWith("id:")) lastId = line.slice(3).trim();
else if (line.startsWith("event:")) event = line.slice(6).trim();
else if (line.startsWith("data:")) data.push(line.slice(5).trim());
}
if (event === "reset") lastId = null; // re-fetch the board, then reconnect from now
else if (event) handle(event, JSON.parse(data.join("\n")));
}
}
}
(async () => {
for (;;) {
try { await run(); } catch (e) { console.error("stream dropped:", e.message); }
await new Promise((r) => setTimeout(r, 3000));
}
})();
A browser's built-in EventSource cannot send the X-API-Key header, and a key in a web page is a key anyone can copy. Hold the stream on your server and pass what your page needs on from there.
Every message has an id. Reconnect with it in the Last-Event-ID header, or as ?last_event_id= if your client cannot set headers, and everything after it that is still in the replay buffer is sent before live events resume. The buffer holds at least the last hour on a busy racing day.
Three things end a stream with event: reset and a reason: an id older than the buffer (last_event_id_expired), a client that falls 500 events behind (client_too_slow), and a server restart (server_restart). After a reset, fetch the board again with /v1/racing/next-to-go, or catch up with /v1/racing/changes, then reconnect without an id.
403, and so do requests through a shared proxy.X-Credits-Cost: 3.402 on connect. A key that runs out while connected gets event: error (credits_exhausted), and the stream ends.429.422 means an unknown event name, or a Last-Event-ID that is not a stream id.One stream with filters usually replaces several polling loops. A stream bills the same whether one event arrives in a minute or a hundred, so compare it with what your polling spends: your own spend is on /v1/usage, and costs per call are on pricing.
Odds and results flow one way, from us to you, and server-sent events are made for exactly that: plain HTTPS, so they pass proxies and load balancers that block WebSocket upgrades, with resume built into the protocol. Every language has a client, and a few lines of HTTP code are enough, as above. A WebSocket adds a channel back to the server that a feed like this has no use for.
/v1/stream reference · Freshness · Rate limits · Errors · Pricing · Live status