# API-Formula-1

> Follow Formula 1 with API-Formula-1: every Grand Prix and its sessions since 2012, with results, fastest laps, starting grids and pit stops, circuits, teams and drivers with their careers, and the drivers' and constructors' championships. Needs an API-SPORTS key; the free plan allows 100 requests a day.

App · Sports · 14 actions. Web page: https://docs.lodol.com/docs/integrations/api-formula-1

## Actions

### Find circuits

Find circuits by name, by Grand Prix or by ID, each with its map, lap length, race distance, lap record, capacity and first Grand Prix.

**Inputs**

- Circuit ID (`circuit_id`, text): Optional. Only this circuit, by ID, such as 23.
- Grand Prix (`competition_id`, text): Optional. Only this Grand Prix. Pick one from the list.
- Search (`search`, text): Optional. Only names containing this, at least 3 characters.

**Outputs**

- `circuits` (list): The circuits.
- `count` (number): How many came back.

**Example output**

```json
{
  "circuits": [
    {
      "capacity": 60000,
      "competition": {
        "id": 23,
        "location": {
          "city": "Yas Marina, Abou Dabi",
          "country": "United Arab Emirates"
        },
        "name": "Abu Dhabi Grand Prix"
      },
      "first_grand_prix": 2009,
      "id": 23,
      "image": "https://media.api-sports.io/formula-1/circuits/23.png",
      "lap_record": {
        "driver": "Kevin Magnussen",
        "time": "1:25.637",
        "year": 2024
      },
      "laps": 58,
      "length": "5.281 km",
      "name": "Yas Marina Circuit",
      "opened": 2009,
      "owner": "Government of Abu Dhabi",
      "race_distance": "306.183 kms"
    }
  ],
  "count": 1
}
```

### Find drivers

Find drivers by name or ID, each with their nationality, birthday, car number, championships, podiums, career points and the team they drove for each season.

**Inputs**

- Driver ID (`driver_id`, text): Optional. Only this driver, by ID, such as 25 for Max Verstappen.
- Search (`search`, text): Optional. Only names containing this, at least 3 characters.

**Outputs**

- `count` (number): How many came back.
- `drivers` (list): The drivers.

**Example output**

```json
{
  "count": 1,
  "drivers": [
    {
      "abbr": "VER",
      "birthdate": "1997-09-30",
      "birthplace": "Hasselt, Belgium",
      "career_points": 3553.5,
      "country": {
        "code": "NL",
        "name": "Netherlands"
      },
      "grands_prix_entered": 244,
      "highest_grid_position": 1,
      "highest_race_finish": {
        "number": 71,
        "position": 1
      },
      "id": 25,
      "image": "https://media.api-sports.io/formula-1/drivers/25.png",
      "name": "Max Verstappen",
      "nationality": "Dutch",
      "number": 3,
      "podiums": 131,
      "teams": [
        {
          "season": 2026,
          "team": {
            "id": 1,
            "logo": "https://media.api-sports.io/formula-1/teams/1.png",
            "name": "Red Bull Racing"
          }
        },
        {
          "season": 2025,
          "team": {
            "id": 1,
            "logo": "https://media.api-sports.io/formula-1/teams/1.png",
            "name": "Red Bull Racing"
          }
        }
      ],
      "world_championships": 4
    }
  ]
}
```

### Find Grands Prix

Find Grands Prix by name, country or city, each with its ID and where it is held. With no filter it lists all of them.

**Inputs**

- Grand Prix ID (`competition_id`, text): Optional. Only this Grand Prix, by ID, such as 23.
- Search (`search`, text): Optional. Only names containing this, at least 3 characters.
- Country (`country`, text): Optional. Only Grands Prix in this country, such as Italy.
- City (`city`, text): Optional. Only Grands Prix in this city, such as Monza.

**Outputs**

- `competitions` (list): The Grands Prix.
- `count` (number): How many came back.

**Example output**

```json
{
  "competitions": [
    {
      "id": 23,
      "location": {
        "city": "Yas Marina, Abou Dabi",
        "country": "United Arab Emirates"
      },
      "name": "Abu Dhabi Grand Prix"
    }
  ],
  "count": 1
}
```

### Find teams

Find teams by name or ID, each with its base, championships, pole positions, fastest laps, principal, chassis, engine and tyres. With no filter it lists all of them.

**Inputs**

- Team (`team_id`, text): Optional. Only this team. Pick one from the list.
- Search (`search`, text): Optional. Only names containing this, at least 3 characters.

**Outputs**

- `count` (number): How many came back.
- `teams` (list): The teams.

**Example output**

```json
{
  "count": 1,
  "teams": [
    {
      "base": "Milton Keynes, United Kingdom",
      "chassis": "RB22",
      "director": "Laurent Mekies",
      "engine": "Red Bull Ford",
      "fastest_laps": 100,
      "first_team_entry": 1997,
      "highest_race_finish": {
        "number": 130,
        "position": 1
      },
      "id": 1,
      "logo": "https://media.api-sports.io/formula-1/teams/1.png",
      "name": "Red Bull Racing",
      "pole_positions": 111,
      "president": "Laurent Mekies",
      "technical_manager": "Pierre Wach\u00e9",
      "tyres": "Pirelli",
      "world_championships": 6
    }
  ]
}
```

### Get a race

Get one session by ID: its Grand Prix, circuit, type, status, laps, distance and fastest lap.

**Inputs**

- Session ID (`race_id`, text, required): The session's ID, such as 1972 for the 2024 Abu Dhabi Grand Prix's race. List races gives each session's ID.
- Time zone (`timezone`, text): Optional. Give dates and times in this time zone, such as Europe/London or America/New_York. UTC when left empty.

**Outputs**

- `circuit` (object): The circuit.
- `competition` (object): A Grand Prix.
- `date` (text): When it starts, with the time zone's offset (ISO 8601).
- `distance` (text): The distance, such as 306.3 Kms.
- `fastest_lap` (object): The session's fastest lap.
- `id` (number): The session's ID, which results and laps take.
- `laps` (object): Laps.
- `season` (number): The season.
- `status` (text): Scheduled, Live, Completed, Cancelled or Postponed.
- `timezone` (text): The time zone the date is given in.
- `type` (text): The session, such as Race, Sprint, 1st Qualifying or 2nd Practice.
- `weather` (text): The weather, when the API has it.

**Example output**

```json
{
  "circuit": {
    "id": 23,
    "image": "https://media.api-sports.io/formula-1/circuits/23.png",
    "name": "Yas Marina Circuit"
  },
  "competition": {
    "id": 23,
    "location": {
      "city": "Yas Marina, Abou Dabi",
      "country": "United Arab Emirates"
    },
    "name": "Abu Dhabi Grand Prix"
  },
  "date": "2024-12-08T13:00:00+00:00",
  "distance": "306.3 Kms",
  "fastest_lap": {
    "driver": {
      "id": 2
    },
    "time": "1:25.637"
  },
  "id": 1972,
  "laps": {
    "current": null,
    "total": 58
  },
  "season": 2024,
  "status": "Completed",
  "timezone": "utc",
  "type": "Race",
  "weather": null
}
```

### Get account status

See the connected key's API-Formula-1 plan, when it renews, and how many of today's requests are used and left. It is free: it never counts against the day.

**Inputs**: None.

**Outputs**

- `active` (true/false): True while the subscription is active.
- `daily_limit` (number): Requests allowed a day.
- `plan` (text): The plan, such as Free.
- `requests_remaining` (number): Requests left today; the day starts at midnight UTC.
- `requests_today` (number): Requests used today.
- `subscription_end` (text): When the plan renews or ends.

**Example output**

```json
{
  "active": true,
  "daily_limit": 100,
  "plan": "Free",
  "requests_remaining": 88,
  "requests_today": 12,
  "subscription_end": "2027-10-01T00:00:00+00:00"
}
```

### Get fastest laps

Get each driver's fastest lap of a session, fastest first: the lap it was on, its time and the average speed.

**Inputs**

- Session ID (`race_id`, text, required): The session's ID, such as 1972 for the 2024 Abu Dhabi Grand Prix's race. List races gives each session's ID.
- Driver ID (`driver_id`, text): Optional. Only this driver, by ID, such as 25 for Max Verstappen.
- Team (`team_id`, text): Optional. Only this team. Pick one from the list.

**Outputs**

- `count` (number): How many came back.
- `laps` (list): The fastest laps, fastest first.
- `race_id` (number): The session asked about.

**Example output**

```json
{
  "count": 2,
  "laps": [
    {
      "avg_speed": 222.002,
      "driver": {
        "abbr": "MAG",
        "id": 2,
        "image": "https://media.api-sports.io/formula-1/drivers/2.png",
        "name": "Kevin Magnussen",
        "number": 20
      },
      "lap": 57,
      "position": 1,
      "race_id": 1972,
      "team": {
        "id": 14,
        "logo": "https://media.api-sports.io/formula-1/teams/14.png",
        "name": "Haas F1 Team"
      },
      "time": "1:25.637"
    },
    {
      "avg_speed": 217.828,
      "driver": {
        "abbr": "HAM",
        "id": 20,
        "image": "https://media.api-sports.io/formula-1/drivers/20.png",
        "name": "Lewis Hamilton",
        "number": 44
      },
      "lap": 44,
      "position": 2,
      "race_id": 1972,
      "team": {
        "id": 5,
        "logo": "https://media.api-sports.io/formula-1/teams/5.png",
        "name": "Mercedes-AMG Petronas"
      },
      "time": "1:27.278"
    }
  ],
  "race_id": 1972
}
```

### Get pit stops

Get every pit stop of a race: the driver, their team, which stop it was, the lap and how long it took.

**Inputs**

- Session ID (`race_id`, text, required): The session's ID, such as 1972 for the 2024 Abu Dhabi Grand Prix's race. List races gives each session's ID.
- Driver ID (`driver_id`, text): Optional. Only this driver, by ID, such as 25 for Max Verstappen.
- Team (`team_id`, text): Optional. Only this team. Pick one from the list.

**Outputs**

- `count` (number): How many came back.
- `pit_stops` (list): The pit stops.
- `race_id` (number): The session asked about.

**Example output**

```json
{
  "count": 2,
  "pit_stops": [
    {
      "driver": {
        "abbr": null,
        "id": 105,
        "image": "https://media.api-sports.io/formula-1/drivers/105.png",
        "name": "Franco Colapinto",
        "number": 43
      },
      "lap": 3,
      "race_id": 1972,
      "stops": 1,
      "team": {
        "id": 12,
        "logo": "https://media.api-sports.io/formula-1/teams/12.png",
        "name": "Williams F1 Team"
      },
      "time": "24.941",
      "total_time": "24.941"
    },
    {
      "driver": {
        "abbr": "PIA",
        "id": 97,
        "image": "https://media.api-sports.io/formula-1/drivers/97.png",
        "name": "Oscar Piastri",
        "number": 81
      },
      "lap": 4,
      "race_id": 1972,
      "stops": 1,
      "team": {
        "id": 2,
        "logo": "https://media.api-sports.io/formula-1/teams/2.png",
        "name": "McLaren Racing"
      },
      "time": "23.582",
      "total_time": "23.582"
    }
  ],
  "race_id": 1972
}
```

### Get race results

Get a session's results in finishing order: each driver's place, time and laps, with their grid slot and pit stops in a race or sprint. There the time is the winner's race time and the others' gap to it, or why they did not finish; in practice and qualifying it is each driver's best lap.

**Inputs**

- Session ID (`race_id`, text, required): The session's ID, such as 1972 for the 2024 Abu Dhabi Grand Prix's race. List races gives each session's ID.
- Driver ID (`driver_id`, text): Optional. Only this driver, by ID, such as 25 for Max Verstappen.
- Team (`team_id`, text): Optional. Only this team. Pick one from the list.

**Outputs**

- `count` (number): How many came back.
- `race_id` (number): The session asked about.
- `results` (list): The results, in finishing order.

**Example output**

```json
{
  "count": 2,
  "race_id": 1972,
  "results": [
    {
      "driver": {
        "abbr": "NOR",
        "id": 49,
        "image": "https://media.api-sports.io/formula-1/drivers/49.png",
        "name": "Lando Norris",
        "number": 1
      },
      "gap": null,
      "grid": 1,
      "laps": 58,
      "pits": 1,
      "position": 1,
      "race_id": 1972,
      "team": {
        "id": 2,
        "logo": "https://media.api-sports.io/formula-1/teams/2.png",
        "name": "McLaren Racing"
      },
      "time": "1:26:33.291"
    },
    {
      "driver": {
        "abbr": "SAI",
        "id": 24,
        "image": "https://media.api-sports.io/formula-1/drivers/24.png",
        "name": "Carlos Sainz Jr",
        "number": 55
      },
      "gap": null,
      "grid": 3,
      "laps": 58,
      "pits": 1,
      "position": 2,
      "race_id": 1972,
      "team": {
        "id": 3,
        "logo": "https://media.api-sports.io/formula-1/teams/3.png",
        "name": "Scuderia Ferrari"
      },
      "time": "+5.832"
    }
  ]
}
```

### Get the constructors' championship

Get a season's constructors' championship: each team's place and points. Narrow to one team.

**Inputs**

- Season (`season`, number, required): The season, such as 2024. The free plan reads the 2022 to 2024 seasons. From 1900 to 2100.
- Team (`team_id`, text): Optional. Only this team. Pick one from the list.

**Outputs**

- `count` (number): How many came back.
- `standings` (list): The teams, from first place down.

**Example output**

```json
{
  "count": 2,
  "standings": [
    {
      "points": 666,
      "position": 1,
      "season": 2024,
      "team": {
        "id": 2,
        "logo": "https://media.api-sports.io/formula-1/teams/2.png",
        "name": "McLaren Racing"
      }
    },
    {
      "points": 652,
      "position": 2,
      "season": 2024,
      "team": {
        "id": 3,
        "logo": "https://media.api-sports.io/formula-1/teams/3.png",
        "name": "Scuderia Ferrari"
      }
    }
  ]
}
```

### Get the drivers' championship

Get a season's drivers' championship: each driver's place, team, points, wins and gap to the leader. Narrow to one driver or team.

**Inputs**

- Season (`season`, number, required): The season, such as 2024. The free plan reads the 2022 to 2024 seasons. From 1900 to 2100.
- Driver ID (`driver_id`, text): Optional. Only this driver, by ID, such as 25 for Max Verstappen.
- Team (`team_id`, text): Optional. Only this team. Pick one from the list.

**Outputs**

- `count` (number): How many came back.
- `standings` (list): The drivers, from first place down.

**Example output**

```json
{
  "count": 2,
  "standings": [
    {
      "behind": null,
      "driver": {
        "abbr": "VER",
        "id": 25,
        "image": "https://media.api-sports.io/formula-1/drivers/25.png",
        "name": "Max Verstappen",
        "number": 3
      },
      "points": 437,
      "position": 1,
      "season": 2024,
      "team": {
        "id": 1,
        "logo": "https://media.api-sports.io/formula-1/teams/1.png",
        "name": "Red Bull Racing"
      },
      "wins": 9
    },
    {
      "behind": 63,
      "driver": {
        "abbr": "NOR",
        "id": 49,
        "image": "https://media.api-sports.io/formula-1/drivers/49.png",
        "name": "Lando Norris",
        "number": 1
      },
      "points": 374,
      "position": 2,
      "season": 2024,
      "team": {
        "id": 2,
        "logo": "https://media.api-sports.io/formula-1/teams/2.png",
        "name": "McLaren Racing"
      },
      "wins": 4
    }
  ]
}
```

### Get the starting grid

Get a race's starting grid, pole first, with each driver's team and the qualifying time behind the place.

**Inputs**

- Session ID (`race_id`, text, required): The session's ID, such as 1972 for the 2024 Abu Dhabi Grand Prix's race. List races gives each session's ID.
- Driver ID (`driver_id`, text): Optional. Only this driver, by ID, such as 25 for Max Verstappen.
- Team (`team_id`, text): Optional. Only this team. Pick one from the list.

**Outputs**

- `count` (number): How many came back.
- `grid` (list): The grid, pole first.
- `race_id` (number): The session asked about.

**Example output**

```json
{
  "count": 2,
  "grid": [
    {
      "driver": {
        "abbr": "NOR",
        "id": 49,
        "image": "https://media.api-sports.io/formula-1/drivers/49.png",
        "name": "Lando Norris",
        "number": 1
      },
      "position": 1,
      "race_id": 1972,
      "team": {
        "id": 2,
        "logo": "https://media.api-sports.io/formula-1/teams/2.png",
        "name": "McLaren Racing"
      },
      "time": "1:22.595"
    },
    {
      "driver": {
        "abbr": "PIA",
        "id": 97,
        "image": "https://media.api-sports.io/formula-1/drivers/97.png",
        "name": "Oscar Piastri",
        "number": 81
      },
      "position": 2,
      "race_id": 1972,
      "team": {
        "id": 2,
        "logo": "https://media.api-sports.io/formula-1/teams/2.png",
        "name": "McLaren Racing"
      },
      "time": "1:22.804"
    }
  ],
  "race_id": 1972
}
```

### List races

List a season's sessions (races, sprints, qualifying and practice), or a day's, or one Grand Prix's or circuit's, in the order they run, each with its ID, status, laps, distance and fastest lap. Narrow to one kind of session, such as Race.

**Inputs**

- Season (`season`, number): Optional. Only this season, such as 2024. The free plan reads the 2022 to 2024 seasons. From 1900 to 2100.
- Date (`on_date`, date): Optional. Only sessions on this day. The free plan takes only yesterday, today or tomorrow.
- Grand Prix (`competition_id`, text): Optional. Only this Grand Prix. Pick one from the list.
- Circuit ID (`circuit_id`, text): Optional. Only sessions at this circuit, by ID.
- Session (`type`, text): Optional. Only this kind of session, such as Race. One of: `Race`, `Sprint`, `1st Qualifying`, `2nd Qualifying`, `3rd Qualifying`, `1st Sprint Shootout`, `2nd Sprint Shootout`, `3rd Sprint Shootout`, `1st Practice`, `2nd Practice`, `3rd Practice`.
- Next N sessions (`next`, number): Optional. Only the coming this many sessions, up to 99. Paid plans only: the free plan refuses it. From 1 to 99.
- Last N sessions (`last`, number): Optional. Only the most recent this many sessions, up to 99. Paid plans only: the free plan refuses it. From 1 to 99.
- Time zone (`timezone`, text): Optional. Give dates and times in this time zone, such as Europe/London or America/New_York. UTC when left empty.

**Outputs**

- `count` (number): How many came back.
- `races` (list): The sessions, in the order they start.

**Example output**

```json
{
  "count": 1,
  "races": [
    {
      "circuit": {
        "id": 23,
        "image": "https://media.api-sports.io/formula-1/circuits/23.png",
        "name": "Yas Marina Circuit"
      },
      "competition": {
        "id": 23,
        "location": {
          "city": "Yas Marina, Abou Dabi",
          "country": "United Arab Emirates"
        },
        "name": "Abu Dhabi Grand Prix"
      },
      "date": "2024-12-08T13:00:00+00:00",
      "distance": "306.3 Kms",
      "fastest_lap": {
        "driver": {
          "id": 2
        },
        "time": "1:25.637"
      },
      "id": 1972,
      "laps": {
        "current": null,
        "total": 58
      },
      "season": 2024,
      "status": "Completed",
      "timezone": "utc",
      "type": "Race",
      "weather": null
    }
  ]
}
```

### List seasons

List the seasons API-Formula-1 has data for, oldest first, as the years the Season fields take.

**Inputs**: None.

**Outputs**

- `count` (number): How many came back.
- `seasons` (list): The seasons, oldest first.

**Example output**

```json
{
  "count": 5,
  "seasons": [
    2022,
    2023,
    2024,
    2025,
    2026
  ]
}
```
