Skip to main content

Endpoint

GET /api/teams
Retrieves all Formula 1 teams with their associated drivers and calculated total points. The total points are computed by summing all race result points for each driver in the team.

Request

This endpoint requires no parameters or authentication.

Response

Returns an object containing an array of teams with their drivers and calculated points.
data
array
required
Array of team objects with calculated points

Points calculation logic

The totalPoints field is calculated using the following logic from /home/daytona/workspace/source/server/api/teams/index.ts:25-38:
const totalPoints = team.Drivers.reduce((sum, driver) => {
    return (
        sum +
        driver.Results.reduce((driverPoints, result) => {
            return driverPoints + result.points;
        }, 0)
    );
}, 0);
This sums all race result points for every driver in the team to get the team’s total championship points.

Example

curl https://your-domain.com/api/teams

Response

{
  "data": [
    {
      "teamId": "red_bull",
      "name": "Red Bull Racing",
      "nationality": "Austrian",
      "url": "https://www.redbullracing.com",
      "teamLogo": "https://example.com/logos/red_bull.png",
      "totalPoints": 860,
      "Drivers": [
        {
          "driverId": "max_verstappen",
          "givenName": "Max",
          "familyName": "Verstappen",
          "driverImage": "https://example.com/drivers/verstappen.jpg",
          "Results": [
            { "points": 25 },
            { "points": 18 },
            { "points": 25 }
          ]
        },
        {
          "driverId": "sergio_perez",
          "givenName": "Sergio",
          "familyName": "Pérez",
          "driverImage": "https://example.com/drivers/perez.jpg",
          "Results": [
            { "points": 15 },
            { "points": 12 },
            { "points": 18 }
          ]
        }
      ]
    }
  ]
}

Build docs developers (and LLMs) love