Pit Stops

Pit stop data is available from the 2012 season onwards. Pit stop queries require a season and a round to be specified. To request all the pit stop data for a race use the following URL with the required year and round number:

http://ergast.com/api/f1/2011/5/pitstops

If the pit stop data for the specified race is not yet available the RaceTable element will be empty. To request the information for a specific stop add the stop number:

http://ergast.com/api/f1/2011/5/pitstops/1

Pit stop queries can also include any of the following criteria:

/drivers/<driverId>
/laps/<lap number>

For example, to list all the pit stop data for a specific driver:

http://ergast.com/api/f1/2011/5/drivers/alonso/pitstops

XML Example Response

<?xml version="1.0" encoding="utf-8"?>
<MRData xmlns="http://ergast.com/mrd-1.0" series="f1" limit="30" offset="0" total="66">
    <RaceTable season="2011" round="5">
        <Race season="2011" round="5" url="http://en.wikipedia.org/wiki/...">
            <RaceName>Australian Grand Prix</RaceName>
            <Circuit circuitId="albert_park" url="http://en.wikipedia.org/...">
                <CircuitName>Albert Park Grand Prix Circuit</CircuitName>
                <Location lat="-37.8497" long="144.968">
                    <Locality>Melbourne</Locality>
                    <Country>Australia</Country>
                </Location>
            </Circuit>
            <Date>2008-03-16</Date>
            <Time>04:30:00Z</Time>
            <PitStopsList>
                <PitStop driverId="hamilton" stop="1" lap="1" time="12:42:02" duration="21.234"/>
                <PitStop driverId="alonso" stop="1" lap="1" time="12:42:02" duration="21.234"/>
                .
                .
                .
            </PitStopsList>
        </Race>
    </RaceTable>
</MRData>

JSON Example Response

{
  "MRData": {
    "xmlns": "http://ergast.com/mrd/1.0",
    "series": "f1",
    "limit": "30",
    "offset": "0",
    "total": "22",
    "RaceTable": {
      "season": "2008",
      "round": "1",
      "Races": [
        {
          "season": "2008",
          "round": "1",
          "url": "http://en.wikipedia.org/wiki/2008_Australian_Grand_Prix",
          "raceName": "Australian Grand Prix",
          "Circuit": {
            "circuitId": "albert_park",
            "url": "http://en.wikipedia.org/wiki/Melbourne_Grand_Prix_Circuit",
            "circuitName": "Albert Park Grand Prix Circuit",
            "Location": {
              "lat": "-37.8497",
              "long": "144.968",
              "locality": "Melbourne",
              "country": "Australia"
            }
          },
          "date": "2008-03-16",
          "time": "04:30:00Z",
          "PitStops": [
            {
              "driverId": "hamilton",
              "stop": "1",
              "lap":"1",
              "time": "1:42.678",
              "duration": "1:42.678"
            },
            {
              "driverId": "alonso",
              "stop": "1",
              "lap":"1",
              "time": "1:42.678",
              "duration": "1:42.678"
            },
            .
            .
            .          
          ]
        }
      ]
    }
  }
}

Back to documentation index

Comments

8 responses to “Pit Stops”

  1. jose Avatar
    jose

    hello, great work done here.
    I am ussing this to test some python ADE machine learning.

    how is the pitstop time measured exactly? I don’t find it in the documentation.

    The shortest time I found is around 12000milliseconds, so I guess it takes not only the proper mechanic time (change of tyres, or pieces), but since the moment the car enters the boxes and it leaves?
    I guess there is no more accurate data.

    Also, when the times exceed the 20000 or 30000 ms, is it because of the red flags in that race?

    thanks a lot

  2. Admin Avatar
    Admin

    Hi Jose,
    The pit stop timings are as published by the FIA and is the time in the pit lane. The long stops may be under red flags.
    Cheers,
    Chris

  3. anuj chopra Avatar
    anuj chopra

    Hi,
    Is it possible to get the tyres data as well? Like which tyres was used in which lap? Or tyres_removed and tyres_fitted in the pitstop.
    Anuj

  4. Admin Avatar
    Admin

    Hi Anuj,
    Unfortunately, I don’t have access to that data.
    Cheers,
    Chris

  5. Daniele incitti Avatar

    Posso fare le qualifiche e gara

  6. Noah Avatar

    I use this API for à School Project ! Thank’s for sharing it

  7. Blanca Avatar
    Blanca

    Hi, I was wondering if there is any way we can get pit stop data from before 2012 and if so, how far back does it go.

  8. Admin Avatar
    Admin

    Hi Blanca,
    The pit stop data is published by the FIA so you may be able to find the relevamt PDF files somewhere. Unfortunately I don’t have the earlier data.
    Cheers,
    Chris

Leave a Reply

Your email address will not be published. Required fields are marked *