Skip to main content

Endpoint

GET /api/races
Retrieve a list of all races in the F1 PitLane Predict database. This endpoint returns all race records including season information, circuit details, and race dates.

Request

This endpoint does not require any parameters or authentication.

Example request

curl -X GET https://api.f1pitlanepredict.com/api/races

Response

data
array
Array of race objects

Example response

{
  "data": [
    {
      "raceId": 1,
      "season": "2024",
      "round": 1,
      "raceName": "Bahrain Grand Prix",
      "circuitId": "bahrain",
      "circuitName": "Bahrain International Circuit",
      "locality": "Sakhir",
      "country": "Bahrain",
      "date": "2024-03-02T00:00:00.000Z",
      "time": "15:00:00",
      "url": "https://en.wikipedia.org/wiki/2024_Bahrain_Grand_Prix"
    },
    {
      "raceId": 2,
      "season": "2024",
      "round": 2,
      "raceName": "Saudi Arabian Grand Prix",
      "circuitId": "jeddah",
      "circuitName": "Jeddah Corniche Circuit",
      "locality": "Jeddah",
      "country": "Saudi Arabia",
      "date": "2024-03-09T00:00:00.000Z",
      "time": "17:00:00",
      "url": "https://en.wikipedia.org/wiki/2024_Saudi_Arabian_Grand_Prix"
    }
  ]
}

Error responses

This endpoint returns standard HTTP error codes for server errors:
  • 500 - Internal server error

Build docs developers (and LLMs) love