Getting Started

Quickstart

Get your first F1 live timing webhook delivery in under 5 minutes. No credit card required. The same webhook mechanism works for any sport RaceHooks supports as the platform expands — IndyCar and NASCAR feeds will use the identical integration pattern.

Prerequisites
  • A free RaceHooks account — sign up at racehooks.io/signup
  • A publicly reachable HTTPS endpoint, or use the Simulate feature to test locally
  • curl, Node.js, or Python for the API calls below
1

Get your token

Authenticate with your email and password to receive a Bearer token. All API calls require this token in the Authorization header.

bash
curl -X POST https://api.racehooks.io/v1/auth/login \
  -H "Content-Type: application/json" \
  -d '{
    "email": "you@example.com",
    "password": "your-password"
  }'

# Response
{
  "data": {
    "token": "eyJhbGc...",
    "expiresAt": "2026-06-03T14:00:00Z"
  }
}
You can also copy your token directly from the API Keys page in the console — no curl needed.
2

Register your webhook

Register an endpoint URL and subscribe it to a feed. This example uses timingdata — the most commonly used feed, delivering lap times, sector times, gaps, and positions on every lap completion.

curl -X POST https://api.racehooks.io/v1/webhooks \
  -H "Authorization: Bearer ${TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{
    "webhookUrl": "https://your-app.com/f1",
    "feedId": "timingdata"
  }'

# Response
{
  "data": {
    "webhookId": "wh_7a3b9c2d",
    "webhookUrl": "https://your-app.com/f1",
    "feedId": "timingdata",
    "active": true,
    "webhookSecret": "whsec_..."   ← save this, shown once
  }
}
The webhookSecret is shown exactly once at creation time. Store it securely — you will need it to verify incoming signatures. If you lose it, rotate it from the webhook detail page.
3

Handle incoming deliveries

RaceHooks POSTs a JSON payload to your endpoint for every matching event. On the Live tier and above, every delivery includes an X-RaceHooks-Signature header — an HMAC-SHA256 signature you can use to verify the payload originated from RaceHooks.

A typical timingdata payload looks like:

json
{
  "feed": "timingdata",
  "sessionId": "9560",
  "utc": "2026-06-08T14:32:18.441Z",
  "drivers": [
    {
      "driverId": "norris-lando",
      "constructorId": "mclaren",
      "number": "4",
      "tla": "NOR",
      "name": "Lando Norris",
      "team": "McLaren F1 Team",
      "position": 1,
      "gapToLeader": "",
      "lastLapTime": "1:27.412",
      "pitStops": 1
    },
    {
      "driverId": "verstappen-max",
      "constructorId": "red-bull-racing",
      "number": "1",
      "tla": "VER",
      "name": "Max Verstappen",
      "team": "Red Bull Racing",
      "position": 2,
      "gapToLeader": "+4.218",
      "lastLapTime": "1:28.103",
      "pitStops": 1
    },
    {
      "driverId": "leclerc-charles",
      "constructorId": "ferrari",
      "number": "16",
      "tla": "LEC",
      "name": "Charles Leclerc",
      "team": "Scuderia Ferrari",
      "position": 3,
      "gapToLeader": "+8.211",
      "lastLapTime": "1:28.209",
      "pitStops": 2
    }
  ]
}

To verify the signature:

webhook-handler.ts
// Node.js — verify an incoming RaceHooks delivery
import crypto from 'crypto';

function verifySignature(
  payload: string,        // req.body as raw string
  signature: string,      // X-RaceHooks-Signature header value
  secret: string          // your webhook secret
): boolean {
  const expected = 'sha256=' + crypto
    .createHmac('sha256', secret)
    .update(payload, 'utf8')
    .digest('hex');
  return crypto.timingSafeEqual(
    Buffer.from(expected),
    Buffer.from(signature)
  );
}
4

Test with Simulate

You don't need to wait for a live race to test. Use Simulate to replay any historical F1 session against your registered webhooks at up to 10× speed.

bash
curl -X POST https://api.racehooks.io/v1/simulate \
  -H "Authorization: Bearer ${TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{
    "sessionId": "2024-british-r1",
    "speed": "10x"
  }'

# Response — poll GET /v1/simulate/:id until status = "completed"
{
  "data": {
    "simulationId": "sim_9f2c...",
    "status": "running",
    "sessionName": "2024 British Grand Prix — Race"
  }
}

You can also start a simulation from the Simulate page in the console — pick any race back to 2018, set the speed, and watch deliveries arrive in your logs in real time.

What's next
Browse all 50+ feeds
See cadences, payload schemas, and tier availability
Enable analytics enrichment
Add tire state, win probability, and pit prediction to every payload
API reference
Full endpoint documentation with request/response schemas
Feed catalog →