Skip to content
← All posts
Product8 min read

Test your F1 app any day: the RaceHooks race simulator

Replay real recorded F1 sessions into your webhooks or an SSE stream, with the same payloads as live, to build, test, demo and QA any day of the week.

There are about two dozen F1 race weekends a year, and you probably ship code more often than that. RaceHooks Simulate replays a real recorded F1 session into your integration: to your registered webhooks, as a server-sent event stream, or both. You get the payloads, headers and signatures a live session would send, so you can run your scoring, alerts and dashboards through a full Grand Prix on a Tuesday afternoon, as many times as you like.

What you'd use it for

A live race happens once. If your overtake alert fires twice on lap 38, you'd normally wait a week to see whether your fix worked. With a replay you can run lap 38 again this afternoon.

Same payloads as live, plus a replay marker

We build each recording by running the session through the same engine that serves live subscribers, so it holds exactly the payloads a live subscriber got. Webhook replays then go out through the same delivery code as live traffic, with the same headers and the same HMAC X-RaceHooks-Signature. Your verification code runs unchanged.

Every replay delivery also identifies itself, so a receiver can always tell a replay from a live race:

HeaderValue on a replay
X-RaceHooks-Modereplay (live traffic is live; a manual test ping is test)
X-RaceHooks-Replay-SessionThe recorded session being replayed
X-RaceHooks-Replay-Run-IdOne id shared by every frame of this run. It is the same runId the replay request returned, which DELETE /v1/simulate/stream?runId= cancels by
X-RaceHooks-Replay-SpeedThe playback multiplier
X-RaceHooks-FeedThe feed of this frame, same as live

Route on X-RaceHooks-Mode and a single endpoint can serve production and test traffic without the two mixing.

What counts toward your delivery bucket

Live deliveries (X-RaceHooks-Mode: live) and manual test pings (test) count toward the monthly delivery bucket and any overage. Replay deliveries (replay) do not: replays are limited by the number of distinct sessions your plan can replay, not by the delivery meter, so a replay never moves your deliveryCount. The usage endpoints keep the two apart: /v1/usage/by-feed returns deliveryCount (billed) and replayCount (not billed) per feed, and /v1/usage/hourly returns hours (billed) and replayHours (not billed).

How it works: prepare, check, stream

There are three steps. The first two run on the main API with your Bearer token. The third runs on the dedicated playback host, simulate.racehooks.io, and takes the same token as a token query parameter. (Get a token from your API keys first; the quickstart covers that in one call.)

1. Find a session. List the replayable sessions, filtered by year and type (race, qualifying, sprint, practice):

curl "https://api.racehooks.io/v1/simulate/sessions?year=2026&type=race" \
  -H "Authorization: Bearer ${TOKEN}"

2. Prepare it, then check it's ready. The first time anyone prepares a session, RaceHooks builds its recording and caches it. After that it's ready immediately. The curated demo race, 2026-canada_r, is always kept ready.

curl -X POST https://api.racehooks.io/v1/simulate/prepare \
  -H "Authorization: Bearer ${TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{ "sessionId": "2026-canada_r" }'

curl "https://api.racehooks.io/v1/simulate/status?session=2026-canada_r" \
  -H "Authorization: Bearer ${TOKEN}"

Poll the status endpoint until data.status reads "ready".

3. Stream it. Choose where the replay goes with the sinks parameter:

sinksWhat happens
visual (default)An SSE stream back to you: one event per frame, named by feed
webhookDelivery to your active webhooks. Runs detached to the end of the session and returns 202 with a runId
bothThe SSE stream and webhook delivery, driven by the same playback cursor in lockstep
# Deliver the race to your registered webhooks at 10x
curl "https://simulate.racehooks.io/v1/simulate/stream?session=2026-canada_r&speed=10&sinks=webhook&token=${TOKEN}"

# Or watch it arrive over SSE in your terminal
curl -N "https://simulate.racehooks.io/v1/simulate/stream?session=2026-canada_r&speed=10&token=${TOKEN}"

Webhook deliveries go to each endpoint only for the feeds it subscribes to. To stop a detached run early, send DELETE https://simulate.racehooks.io/v1/simulate/stream?runId=<runId>&token=<TOKEN>.

The same flow as a Node script (Node 18+, no dependencies) that you can drop into CI:

// simulate.mjs. Usage: RACEHOOKS_TOKEN=... node simulate.mjs [sessionId] [speed]
const API = "https://api.racehooks.io/v1";
const SIM = "https://simulate.racehooks.io/v1/simulate";
const TOKEN = process.env.RACEHOOKS_TOKEN;
const session = process.argv[2] ?? "2026-canada_r";
const speed = process.argv[3] ?? "10";
const headers = { Authorization: `Bearer ${TOKEN}`, "Content-Type": "application/json" };

const prep = await fetch(`${API}/simulate/prepare`, {
  method: "POST",
  headers,
  body: JSON.stringify({ sessionId: session }),
});
if (!prep.ok) throw new Error(`prepare failed: ${prep.status} ${await prep.text()}`);

for (;;) {
  const res = await fetch(`${API}/simulate/status?session=${encodeURIComponent(session)}`, { headers });
  const { data } = await res.json();
  if (data.status === "ready") break;
  if (data.status === "unknown") throw new Error(`no replayable session: ${session}`);
  await new Promise((r) => setTimeout(r, 10_000));
}

const qs = new URLSearchParams({ session, speed, sinks: "webhook", token: TOKEN });
const run = await fetch(`${SIM}/stream?${qs}`);
console.log(run.status, await run.json()); // 202 { status: "delivering", runId, hooks, ... }

For a first receiver to point this at, the first live F1 webhook in Node.js walkthrough builds one. The open-source fantasy scorer is a good thing to run a full race through.

Replaying during a live race weekend

A replay sent while a live session is running would land on the same endpoints as live data, so RaceHooks asks you to confirm first: a webhook replay returns 409 (live-session-active) until you add ackLive=1. Watching over SSE is never blocked. Only one webhook replay per account runs at a time; a second returns 409 (delivery-active) until you stop the first.

No code: the Simulate page

You can skip the code entirely. The Simulate page in the console lists this season's sessions grouped by race weekend. Pick one, choose a speed and either:

A meter on the page shows how many session slots you've used. You can watch what your endpoints receive, frame by frame, next to what's happening on track.

What each plan includes

Watching a replay is unlimited on every plan. The limit applies to delivering a replay to your webhooks: each new session you deliver takes one slot, for good, and re-running that session never costs another.

FreeDeveloperCustom
Sessions you can deliver510Full archive
SeasonsCurrent seasonCurrent seasonFull archive
Re-runs of a session you've deliveredFreeFreeFree
Feeds deliveredYour plan's feedsEvery live feedPer your plan, with ML analytics available

Replay deliveries don't count against your monthly delivery allowance. The session slots meter them instead. The curated demo race doesn't use a slot, and it delivers the full Analytics feed set to every active endpoint on any plan, so you can see what the model feeds send before you pay for them. See pricing for the full plan comparison.

For developers: speed it up

The console has speed presets:

PresetConsole's estimate for a race
1×Real time
5×~18 minutes
10×~9 minutes
30×~3 minutes
InstantAs fast as possible

On the API, speed is a multiplier and defaults to 10 if you leave it out. It also takes fractions, such as speed=0.5, to slow a messy pit sequence down while you step through it. A race replay starts at lights-out: the pre-race state arrives in one burst, then timed playback begins.

80K+
events in one full-analytics race replay

Faster playback means more requests per second. A full race is tens of thousands of events, each POSTed to every subscribed endpoint, so at 10× the race lands within minutes. Free request-inspection tools rate-limit well below that. Use speed=1 and one endpoint for clean samples. For load tests, turn it up against a receiver that can take bursts. Failed replay deliveries aren't retried. If an endpoint fails many deliveries in a row, RaceHooks pauses it for the rest of that run, probes it periodically and resumes delivery once it recovers. A replay never disables your standing webhook.

The takeaway

RaceHooks Simulate replays a real recorded F1 session into your webhooks or an SSE stream with the same payloads, headers and signatures as live, so you can build, test and demo a race-day product on any day of the week.

RaceHooks is a motorsport analytics API with fourteen production ML models enriching live race data, delivered to you in real time.