Developers / Stream replay
A recorded racing day over the same server-sent events as the live stream, at its own pace or faster. Build and test your stream client at any hour, including when no races are running.
GET https://api.puntersedge.online/v1/stream/replay with your key in X-API-Key. You get the same race.prices, race.move, race.odds_open, race.result and arb.opportunity events, with the same JSON bodies, that the live stream sent on that day, so code written for one runs on the other unchanged.
The demo days cost nothing on any plan, at up to 10x. Any other recorded day is Business and above, at 1 credit per connected minute and any speed.
Only the stream is replayed. Every other endpoint still answers with today's data.
curl -N -H "X-API-Key: $PE_KEY" \
"https://api.puntersedge.online/v1/stream/replay?speed=10&country=AU&events=race.prices,race.result"
With no day, you get the newest demo day. To see which days there are, and which your key can open:
curl -H "X-API-Key: $PE_KEY" https://api.puntersedge.online/v1/stream/replay/days
| Parameter | What it does |
|---|---|
day | The racing day, as an Australian date such as 2026-11-21. A day starts at 18:00 UTC the evening before, so a whole card is always one day. Leave it out for the newest demo day. |
from | Start part-way through the day: HH:MM in UTC (from=05:30), or a full ISO time. |
speed | 1, 2, 5, 10, 30, 60 or max. 1 is the day's own pace, max as fast as your client reads. |
skip_quiet | On by default: any gap longer than 2 minutes plays as 2 seconds, so you are not waiting through the hours between meetings. |
retime | retime=true (speed 1 only) moves every timestamp in every event by the same amount, so the day's races jump from now on and code that counts down to the jump behaves as it would live. It plays the day's real gaps; pair it with from to start near the races. |
events, category, country, venue | The same filters as the live stream. |
Every recorded event keeps its live name and body. Four more frame the replay:
replay.start: the day, speed and options, how many events the day holds, and what the connection costs.replay.clock: the replayed time, at least every 15 seconds. It doubles as the keep-alive.replay.gap: the recording is missing events at this point.replay.end: the day is over, and the stream closes.Message ids look like rp:2026-11-21:1042. Reconnect with the last one in Last-Event-ID (or ?last_event_id=) and the replay carries on after it. A server restart sends event: reset, as the live stream does: reconnect with your last id.
import json
import httpx
URL = "https://api.puntersedge.online/v1/stream/replay"
PARAMS = {"speed": "10", "country": "AU", "events": "race.prices,race.result"}
def handle(event, data):
print(event, data.get("venue"), data.get("race_number"))
with httpx.stream("GET", URL, headers={"X-API-Key": "YOUR_KEY"}, params=PARAMS, timeout=None) as r:
r.raise_for_status()
event, data = None, []
for line in r.iter_lines():
if line.startswith("event:"):
event = line[6:].strip()
elif line.startswith("data:"):
data.append(line[5:].strip())
elif line == "" and event:
body = json.loads("\n".join(data))
if event == "replay.end":
print("done:", body["events_sent"], "events")
break
if not event.startswith("replay."):
handle(event, body)
event, data = None, []
The handle function is the same one your live client calls. Point the same code at /v1/stream when the races are on.
const URL = "https://api.puntersedge.online/v1/stream/replay?speed=10&country=AU&events=race.prices,race.result";
function handle(event, data) { console.log(event, data.venue, data.race_number); }
const res = await fetch(URL, { headers: { "X-API-Key": process.env.PE_KEY } });
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("event:")) event = line.slice(6).trim();
else if (line.startsWith("data:")) data.push(line.slice(5).trim());
}
if (!event) continue;
const body = JSON.parse(data.join("\n"));
if (event === "replay.end") { console.log("done:", body.events_sent, "events"); process.exit(0); }
if (!event.startsWith("replay.")) handle(event, body);
}
}
Save it as replay.mjs so the top-level await works. As with the live stream, a browser's EventSource cannot send the X-API-Key header: run it on your server.
/v1/stream/replay/days marks them.403 for those days.X-Credits-Cost with the rate that applies.429.404 means no recorded day by that date, and the body lists the days there are. 422 means an unknown speed or event name, retime above speed 1, a bad from, or a Last-Event-ID from a different day.Live stream · API reference · Rate limits · Errors · Pricing