FAQ

Ask additional questions using the comments box.

How do the current, last and next shortcuts behave?

For the purposes of the API, a season is assumed to begin when results become available for the first race of the season. This transition will be seen if the <season> field in URLs is set to “current”.

In a similar way, the changeover point for the “last” and “next” round shortcuts occurs when a new set of race results become available. After the last race of a season the URL:

http://ergast.com/current/next/...

will refer to the first race of the following season.

Is there any restriction on how qualifiers can be combined?

A query can include any combination of the following qualifiers unless otherwise stated:

/circuits/<circuitId>
/constructors/<constructorId>
/drivers/<driverId>
/grid/<position>
/results/<position>
/fastest/<rank>
/status/<statusId>

For example:

/drivers/alonso/constructors/renault/results/1

The order of the qualifiers has no effect except that the last one determines the result type.

Season, Driver, Constructor and Standings queries can include the following qualifiers, subject to certain restrictions:

/constructorStandings/<position>
/driverStandings/<position>

The last qualifier in a query determines the type of data returned.

What happens if a round is not specified?

For Standings queries and queries which include a standings qualifier the round value defaults to the last round of each season (i.e. the final standings). Otherwise a query covers all rounds of a season.

What is the purpose of the attributes in the table elements?

All responses contain a table of some kind. The attributes of the table element define the scope of the table and reproduce the criteria specified in the original query. If a specific attribute is omitted the scope concerns all entities of that type e.g. if there is no driverId attribute the scope of the table is all drivers who match the specified criteria.

How soon after a race will data become available?

Data is usually available 2 – 6 hours after the race, sprint or qualifying session.

Comments

344 responses to “FAQ”

  1. Pierre MASSIOT Avatar
    Pierre MASSIOT

    Hello, I can’t get the “raceid” column when I call the api. Would you have a solution?

    Good day to you

  2. Parul Pandey Avatar
    Parul Pandey

    Can an article using data from Ergast API be published on medium publications like Towards Data Science(https://towardsdatascience.com/)

  3. Admin Avatar
    Admin

    Hi Pierre,
    You shouldn’t use the raceId outside the database – it’s an internal key and may change. Races are identified using the year and round fields.
    Cheers,
    Chris

  4. Admin Avatar
    Admin

    Hi Parul,
    That’s fine. The data has been used in books, journals and magazines in the past. Let me know when you publish something so I can put a link in the Application Gallery.
    Cheers,
    Chris

  5. Juan Avatar
    Juan

    Hello!
    Is it possible to check the results of the free practices before 2018?

  6. Admin Avatar
    Admin

    Hi Juan,
    Unfortunately not. I’m usually working on practice days and don’t have time to ingest the data.
    Chris

  7. Sylvain Avatar

    Hello Admin!

    First of all I just wanted to thank you a lot, I’ve been using this API since the beginning of this season for a small website I created for me and my friends and I absolutely love the way it works, but now I’m working on a better version with a lot more data shown and cool data charts so I had a question about the sprint races, for now I see that you just add the points of the sprint races to the race results, that’s nice, but as far as I know, next year will have 6 sprint races, so I was wondering if you will keep the way of adding the points to the race results, or maybe you will add a new endpoint for this?

    In any case, thank you again for your work with this API, when I have finished the improved version of the website I will send it to you for the Application Gallery thing, and also I will donate to this project a fair amount because I feel dirty as I have used this API a lot basically for free when it has been very useful for me haha

    Cheers

  8. Admin Avatar
    Admin

    Hi Sylvain,
    As it looks like Sprint Races are here to stay, I should provide a new table next year for the sprint race results (and points). Not sure when I’ll get the work done but I’ll announce it on the news feed. BTW there’s no reason to feel uncomfortable about using the API – it’s intended to be a free resource.
    Cheers,
    Chris

  9. Tommy Avatar
    Tommy

    Does the API makes use of images that can be used when making a JavaScript application using the JSON data.

  10. Admin Avatar
    Admin

    Hi Tommy,
    Unfortunately not. You may be able to use the Wikipedia IDs to find images in Wikimedia.
    Cheers,
    Chris

  11. walteij Avatar

    Just a simple question: If I run a container image of the DB (since I do not want to overload your server and we will be experimenting) how can I update the database the easiest?

    Thanks,
    Walteij

  12. Admin Avatar
    Admin

    Hi Walteij,
    The easiest way is to load a new dump after each race.
    It’s very hard to keep in sync incrementally.
    Cheers,
    Chris

  13. Kris Avatar
    Kris

    Is it possible to include FP1 to FP3 and Qualifying time into schedule method?
    Also, it would be great if schedule include displayed timezone.

    Thanks,
    Kris

  14. Admin Avatar
    Admin

    Hi Kris,
    I’ll put it on the wishlist but I have very little time to spend on development at the moment.
    Cheers,
    Chris

  15. Laping Data Avatar
    Laping Data

    Hi! I saw a photo on Fast-F1 github page. There was this image by some “Siddharth”.
    Can you tell if we can get data in this format.
    https://user-images.githubusercontent.com/76590952/149898817-7f0107f8-6112-4349-9231-9cfe44d15094.jpg

  16. Admin Avatar
    Admin

    Hi Yebal,
    You can get the position of all drivers, for each lap, using the Lap Times API method. For example the positions in the first lap of the last Grand Prix are: https://ergast.com/api/f1/2021/22/laps/1.json
    Cheers,
    Chris

  17. Juan Avatar
    Juan

    Hi! Is it possible to know the exact time that a laptime was set?
    Thanks

  18. Admin Avatar
    Admin

    Hi Juan,
    Unfortunately not. The volume of the lap time data is large so I’ve only included the most significant fields.
    Cheers,
    Chris

  19. Chris Avatar
    Chris

    Hi Chris,

    Thanks for building and managing this API!

    I have been looking into a small app for me and my friends recently and am trying to figure out how I might utilize certain calls.

    I was wondering about timings for when some API’s get updated, specifically the drivers API.
    At what time would the drivers API show the drivers for a race (or qualy)? Beforehand or after the race? For example if I’m looking at the first race in March: https://ergast.com/api/f1/2022/1/drivers – we know who will probably be driving there, but this could change.

    I’m thinking like a Russell in Sakhir situation or Kubica in Zandvoort. I appreciate it must be difficult if drivers are swapping around last minute due to illness etc, so I’m guessing this is updated after a race or qualy?

    Thanks you.

  20. Admin Avatar
    Admin

    Hi Chris,
    You can get a provisional list of drivers for 2022 using this URL: http://ergast.com/api/f1/2022/driverStandings
    The drivers appear in the drivers table (i.e. http://ergast.com/api/f1/2022/1/drivers) a couple of hours after the first race on Sunday when the results are published. I guess it could happen after the qualifying session but that’s not how the call currently works.
    Good luck with your app!
    Cheers,
    Chris

  21. Brandon Avatar
    Brandon

    API is great – thank you! Is there a way to get both driver and constructors standings combined in one request instead of having to make 2 API calls?

  22. Admin Avatar
    Admin

    Hi Brandon,
    No – you have to make two calls.
    Cheers,
    Chris

  23. Timi Avatar
    Timi

    Hello, is there any way to know just the drivers that ended the race
    Thank you for your time

  24. Admin Avatar
    Admin

    Hi Timi,
    There’s no filter on the results which will do that – but you can iterate thru the results response adn ignore entries where the position field is not the same as the positionText field (or where the positionText field is not an integer)
    Cheers,
    Chris

  25. Sven Avatar
    Sven

    Is there a way to get the lap times per year all in once instead of per round. same for driver standings?

  26. Admin Avatar
    Admin

    Hi Sven,
    The only way is to download the CSV files.
    Large queries are a killer for the API because they take so much memory.
    Chris

  27. Noise Avatar
    Noise

    Hi Admin,

    I was wondering, what happens if a race get cancelled for any reason? Does the schedule endpoint get updated as well?

    Thanks in advance for the answer.

  28. Admin Avatar
    Admin

    Hi Noise,
    This has never been a problem until Covid appeared. In the last two years I have removed races that were cancelled – but often I’m not the first to hear about it, so let me know if I’ve missed it.
    Chris

  29. Timi Avatar
    Timi

    Is there any way to get flags of constructors or photos of drivers, thank you

  30. Timi Avatar
    Timi

    And also if there is any way to use comercial use of the api from wherever

  31. Ellosso Avatar
    Ellosso

    Hello,

    Why this endpoint : https://ergast.com/api/f1/current/last/qualifying.json
    is not updated but this : https://ergast.com/api/f1/2022/1/qualifying
    is ok ?

    Thanks.

  32. Admin Avatar
    Admin

    Hi Timi,
    You could use the identifiers in the URLs (e.g. “Fernando_Alonso”) to find these items in Wikimedia e.g. https://commons.wikimedia.org/w/index.php?search=Fernando_Alonso
    Cheers,
    Chris

  33. Admin Avatar
    Admin

    Hi Timi,
    No, the API is not available for commercial purposes.
    Chris

  34. Admin Avatar
    Admin

    Hi Ellosso,
    See here for details of how the shortcuts work: http://ergast.com/mrd/faq/#shortcuts
    Currently the “current” season doesn’t change until the first race results are entered into the database.
    I may change this to switch at New Year next season.
    Chris

  35. Fabian Avatar
    Fabian

    Dear Admin, 
    i am an software engineering student from germany and have to do a project in data analysis. I found your API when searching for data about F1 and wondered if its okay to use the data provided by your API for that project.
    Best regards 

  36. Admin Avatar
    Admin

    Hi Fabian,
    That’s fine – many students have used the data for undergraduate and graduate projects. Good luck with your project – I’d be interested to see your analysis if you can share it.
    Cheers,
    Chris

  37. Juan Avatar
    Juan

    Hi!
    I have noticed that in qualifyings that a driver has not set a laptime in, sometimes that driver appears in the result whereas other times it doesn’t.

    For example. Alonso did not take part in Monaco 2010 qualifying, (all it’s laptimes are null) but stands in the last position.
    However, at Belgium 2016 he didn’t take part either, but this time, there is no result for Alonso.

    I don’t know if it’s a mistake or there is any reason behind it.
    Thanks in advance

  38. Paul Avatar
    Paul

    Hi, there’s some kind of inconsistency in `races` table. In file “f1db_tables.sql” `date` column is defined as NOT NULL, in other dumps it is NOT NULL DEFAULT ‘0000-00-00’.

    Best regards

  39. Admin Avatar
    Admin

    Hi Paul,
    Thanks – I’m not sure what happened to the default but I’ve put it back.
    Cheers,
    Chris

  40. Juan Avatar
    Juan

    Hello again!
    I have noticed that in qualifyings that a driver has not taken part in, sometimes that driver appears in the qualifying result (in last position) whereas other times it doesn’t.

    For example. Alonso did not take part in Monaco 2010 qualifying, but stands in 24th position
    However, at Belgium 2016 he didn’t take part either, but this time, there is no row for Alonso in the qualifying

    I don’t undestand the reason behind it, so maybe you can help me with that
    Thanks in advance

  41. Admin Avatar
    Admin

    Hi Juan,
    The current policy is to include all drivers scheduled to take part in qualifying, even if they don’t post a time. Unfortunately, some of the earlier data may not comply – and it’s not easy to correct this years later.
    Cheers,
    Chris

  42. Mike Avatar
    Mike

    Hello Chris!

    I’ve noticed that /api/f1/current/results.json does not return results for all races so far this season. Omitting ‘.json’ does return the expected results.

    Thanks for the excellent resource!

  43. Admin Avatar
    Admin

    Hi Mike,
    Try: https://ergast.com/api/f1/current/results.json?limit=200
    The default value of the limit parameter is 30, to keep the memory usage on the server down. See the “Response Paging” section in the API Documentation for details.
    Cheers,
    Chris

  44. Luk Avatar
    Luk

    Hi Admin, which is the correct email in order to contact you ?
    Thanks.

  45. Admin Avatar
    Admin

    Hi Luk,
    admin@ergast.com
    Chris

  46. Fabian Avatar
    Fabian

    Hi Chris,

    i am not sure if I did something wrong when I merged the tables in RStudio or if the FIA is just very very lax when a crash with injury to the driver is considered an accident and when it is considered an injury, but I think in the data the accidents of Grosjean in Bahrain in 2021 and Bianchi in Suzuka are not listed as injury or Injured. Can you explain why they are not shown please? Would be important for the analysis thanks

  47. Luk Avatar
    Luk

    Hi Admin,

    I sent you an email regarding an app that i’ve developed

    Thanks.

  48. Tony Avatar
    Tony

    Bonjour!

    J’aimerais savoir si il est possible d’avoir un script pour importer toutes les données compatible avec postgresql ? ou les données en format CSV pour pouvoir les importer dans n’importe quel format

    Merci beaucoup.

  49. Admin Avatar
    Admin

    Hi Fabian,
    Are you sure you’ve got the right year?
    Chris

  50. Admin Avatar
    Admin

    Hi Tony,
    CSV est disponible ici: https://ergast.com/mrd/db/
    Chris