Feedback

If you have any comments, suggestions or feature requests please add them here. Problems and errata can be reported on Bug Reports page.

Comments

485 responses to “Feedback”

  1. Admin Avatar
    Admin

    Hi Christian,
    You’re right, podiums are a bit of a weak spot in the API – and it may take some thought to find a good solution. I try to avoid any modifications to the API whilst a season is running, so this will have to go on the ToDo list until next winter.
    Cheers,
    Chris

  2. Christian Avatar
    Christian

    Hi Chris, thanks for your reply!

    One more question. I’m looking at options for what I want to develop. The original approach I was thinking about was implementing server-side caching and some extra logic I need over your API results.

    However, I saw you have the API runtime available at https://github.com/jcnewell/ergast-f1-api. That would give me an interesting option to fork your code, add the logic I need (would contribute it back, of course), host it myself and not worry about rate limits.

    I haven’t found the latest additions in that repo, such as the sprint result endpoints. Is there a newer version available? Thanks!

  3. Admin Avatar
    Admin

    Hi Christian,
    Good point – I’ll commit the recent changes.
    Chris

  4. Ryan Northcott Avatar
    Ryan Northcott

    Hello,

    Not sure where this goes but on the formula1 api, the quali table for May 29 2022 Monaco appears to have Alonso’s driver set for P7 and P16. P16 should be Alex Albon

  5. Admin Avatar
    Admin

    Hi Ryan,
    Oops, that’s embarrassing. Now corrected.
    Problems like this usually go on the Bug Reports page.
    Cheers,
    Chris

  6. Wesley Avatar

    Hi Chris!

    First up thanks a lot for the API! The amount of information available is amazing.

    I would like to add pitstop and tyre information to my website. I am currently thinking of a grid with all the drivers (I think Formula 1 does something similar). I did see the pitstop information being available, but I couldn’t find tyre information. Is that information available and if not is it possible?

  7. Admin Avatar
    Admin

    Hi Wesley,
    Unfortunately, I haven’t been able to find a reliable source of tyre data over the years.
    Chris

  8. Douglas Avatar
    Douglas

    Hello!

    I’m having a play with building a small project using this (brilliant) api and F1 resource – so much detail!

    Something I’ve came across and wanted to check in case I was just missing something. For Pit Stops, is there any information on the Constructor within the response?

    Playing with it I can get the driver but as the end goal is to display the fastest race pit stop. Would be nice to have the constructor too. I could manually work my way round this, but again, just wanted to check I wasn’t maybe missing something.

    Thanks,
    Douglas

  9. Admin Avatar
    Admin

    Hi Douglas,
    Unfortunately, you’ll have to cross-reference the driverIds with entries in the equivalent race results query.
    Cheers,
    Chris

  10. Wesley Avatar

    Hi Chris!
    Is there an option to view which of the drivers got the fastest lap or do I need to loop through the laptimes?
    Thanks in advance!
    Wesley

  11. Admin Avatar
    Admin

    Hi Wesley,
    You can get the fastest lap of the race using for example:
    https://ergast.com/api/f1/2010/1/fastest/1/results
    However, you can’t get the fastest lap for a specific lap without looping through the data from a laps query e.g. for lap 7:
    https://ergast.com/api/f1/2010/1/laps/7
    Cheers,
    Chris

  12. Atthar Mirza Avatar
    Atthar Mirza

    I just want to say that I’m new to Formula 1 but love playing with data visualization and this API is incredible. Kudos to you. ?

  13. Admin Avatar
    Admin

    Thanks Atthar – let me know if you build something interesting!
    Chris

  14. Wesley Avatar

    Thanks for the reaction Chris and I totally agree with Atthar Mirza! Love the API!

  15. Peter Avatar
    Peter

    Hi, Chris!
    Thank you for this API! It is amazing!

  16. Daria Avatar
    Daria

    Hello Christian,
    thank you for the API. I am looking for a job in data analisys and decided to build a project for my portfolio. And your development gave me the opportunity to make telegram bot for people like me – for F1 fans!
    My bot can show schedule, weather and prediction. If you intrested, you can check here: https://t.me/f1_who_will_win_bot or here https://github.com/Komsomolochka/formula1-prediction. Thank you!

  17. Filip Avatar
    Filip

    Hello, Chris!
    I was comparing statistics between your API and formula1 official standings reports and I noticed that their fastest laps data stretches further than this API currently does. Is there any plan to fill up the data older than 2004?

    Take care!

    Filip

  18. Admin Avatar
    Admin

    Hi Daria,
    That’s neat. Would you like me to add it to the Application Gallery?
    Good luck with the job hunt!
    Cheers,
    Chris

  19. Daria Avatar
    Daria

    Yes, that would be great! Thank you, Chris!

  20. Lucas Avatar
    Lucas

    Do you have an OpenApi2/3 document around this api? If so, have you thought of generating clients from that?

  21. Admin Avatar
    Admin

    Hi Lucas,
    There’s a partial OpenAPI schema for the Ergast API developed by Adam Paxton:
    https://github.com/adampax/ergast-f1-openapi-doc
    You can find other projects on the Ergast topic page on GitHub:
    https://github.com/topics/ergast-api
    Cheers,
    Chris

  22. Anon Avatar
    Anon

    Hi, first of all thank you for the great job you’ve done with this api.
    I would like to say that I’m still learning so if my questions are a bit dumb, please be gentle 🙂

    I’m having some problems with the response speeds of the api, sometimes it takes up to 5-8s to receive simple latest results. Is it a problem on my end?

    Also I often get this error on Android and I don’t know what might be causing the issue
    HTTP FAILED: java.io.IOException: unexpected end of stream on https://ergast.com/

  23. Admin Avatar
    Admin

    Hi Anon,
    Unfortunately. there was a rogue app and a hostile endpoint spamming the API this weekend. They’ve been dealt with so the server is back to normal now.
    Cheers,
    Chris

  24. Anon Avatar
    Anon

    Works like a charm, thank you so much!

  25. Filip Avatar
    Filip

    Hello!
    It would be really cool if there was an endpoint about safety car and red flags and such! Such as which lap it was dispatched and when it came in! If it was VSC or normal! Then you could also have some sort of flag maybe for driver pit stops if they pitted under SC or not? Also that brings up the question, how are pit stops made under red flags currently being counted as it currently stands?

    Thank you mate!

  26. Admin Avatar
    Admin

    Hi Filip,
    This would be great if there was a reliable and consistent source of the data. Have you seen one?
    Pitstops under red flags are currently recorded the same way as normal ones, as shown in the FIA docs.
    Cheers,
    Chris

  27. Anon Avatar
    Anon

    Hello, is this endpoint intentionally not showing current season statistics? http://ergast.com/api/f1/drivers/alonso/driverStandings
    Would be cool if it did include information even if the season is not finished yet.
    Regards

  28. Admin Avatar
    Admin

    Hi Anon,
    That endpoint shows final standings – so it would inconsistent to include mid-season standings. You wouldn’t display them in the same list would you?
    Chris

  29. Enrique Avatar
    Enrique

    Hi!

    First of all, thank you very much for this magnificent work and for the large amount of data that is concentrated here.

    I have a question (I don’t know if it has already been answered before, I haven’t found anything). The pit stop data is in the API only from 2012, however, on the official page of Formula 1, for example, they go much further (example in https://www.formula1.com/en/results.html/2005/races/772/malaysia/pit-stop-summary.html). Is there any reason for this?

  30. Admin Avatar
    Admin

    Hi Enrique,
    I added the Pit Stop endpoint at the beginning of the 2012 season and load the data after each race. I wasn’t aware of a source of earlier data at that point and I haven’t used data from formula1.com.
    Chris

  31. Enrique Avatar
    Enrique

    Hi! Thanks for your reply. It would be nice to have this pit stop data from older years. By the moment I will try to scrape the page and add the results to the ones that you have already provided (I can share the results if necessary)

  32. eXtr3m0 Avatar
    eXtr3m0

    Hi Chris!

    Like Enrique, I’d be happy to help. I’m currently working on a new project based on your DB. (f1dashboard.com)

    I’m especially interested in enhancing history information. (after all we just have to find out the facts once, then its done)

    Are you on irc? #f1 on libera chat. What do you think about working together (maybe via github) on the contents of the data base?

    eXtr3m0

  33. Admin Avatar
    Admin

    Hi eXtr3m0,
    Thanks for the offer. I’d be very happy to accept missing historical data and have done so in the past. Any machine-readable format will do (but ideally a sequence of SQL INSERT statements)
    Cheers,
    Chris

  34. Enrique Avatar
    Enrique

    As a suggestion that I think can be useful both for users of this API and for developers and admins, I would move both the feedback forum and the bug forum to Github. This way it would be easier for us to find incidents and not publish repeated doubts/suggestions/bugs, and for the admins, who would not have to read so many (since there would be no repetitions). Also, each bug goes with its separate thread, not like here, where it becomes difficult to follow who responds to what.

    I would definitely give git one more push (advertising it more on this page or whatever) and shut down these forums.

  35. Lozano Avatar
    Lozano

    Hi! I wonder to ask what are the sources of your data. I am especially interested in lap times. I haven’t been able to find any sources with which to compare their data (only the FIA documents, which don’t go as far back in time as you).

    Thanks a lot.

  36. Admin Avatar
    Admin

    Hi Enrique,
    Interesting idea – I’ll consider it.
    Cheers,
    Chris

  37. Admin Avatar
    Admin

    Hi Lozano.
    The FIA data is the primary source.
    Cheers,
    Chris

  38. StakHPR Avatar
    StakHPR

    Hi Admin!

    Is there any chance that you can publish what are the SQL queries (at least the most important ones) that you run against the DB in order to get the data for the API?

    I’m trying to build an app that only uses the DB dump to load the database into my server to get the data without using the API and although I have already figured out some queries, I’m not really that expert in SQL and I think some may contain errors or inaccurate data.

    It would be really time-saving if I could actually use the real queries that the API uses in the backend. Also Publishing those SQL queries may motivate more people to use the DB dump instead of the API for certain use cases so I think it’s a good idea in general.

  39. Admin Avatar
    Admin

    Hi StakHPR,
    All the SQL queries are available from the Ergast runtime in GitHub: https://github.com/jcnewell/ergast-f1-api/tree/master/webroot/php/api
    Good luck with your project.
    Cheers,
    Chris

  40. Zainab Mahyar Avatar
    Zainab Mahyar

    Hello, my name is Zainab Mahyar. I am a senior in Cordova high school and this year in my IB math class we are required to do an IA which is an internal assessment/big project/exploration about a math concept relative or applied to something we’re passionate about.
    I am a huge F1 fan and right away I knew I wanted to do something related to it. So my idea is to do something with tyre degradation throughout laps. I wanted to gather data but I realized it would be really hard to do from a video, so I decided to look online and check if there was any data regarding tyre degradation relative to different laps. When I found none, I tried looking for websites or people I could content that might be able to help and provide me with some. That’s when I came upon your website, it was listed in may different places by many different people as a reliable and useful resource for data collection.
    I checked out your website and looked through the data you have on there and it is great, you have data on many different things that made me question whether I should change my topic as a whole. But I’m really interested in tyre degradation of F1 cars in general, so when I saw no data for it, I was a little upset. I’m reaching out to you to ask if you have any data on average tyre degradation during different laps, because if you do, it would be beyond amazing. If you don’t, I would like to know if there is any other method or source you can recommend to me for my data collection. I’m really looking forward to working on this project if I have reliable and accurate data I can work with. I do have other ideas in case I can’t collect the data necessary but I’m not as passionate about those, so it would be very helpful and appreciated if you can provide me with some data or another source/method for getting the data necessary for my project.

    Thank you for your time and sorry for the inconvenience. If you have any questions please email me, I really care about and want to put time and effort into this project, so that it is the best it could possibly be.

    Sincerely
    Zainab Mahyar

  41. Admin Avatar
    Admin

    Hi Zainab,
    Unfortunately I have not been able to find a good source of tyre data, so it is not supported by the API.
    Good luck with your project.
    Cheers,
    Chris

  42. therxmv Avatar

    Hello,
    I would like to know in what period do you add data about the new season? And if it is possible, could you please add information about drivers in Constructor object?
    Thanks

  43. Admin Avatar
    Admin

    Hi thersmx,
    I’ve now add the schedule for 2023. I’ll add provisional drivers and teams in the next few days.
    Cheers,
    Chris

  44. Jouvy Avatar

    Hi,

    Appreciate all the work you’ve done for this API, but I often get an “Error establishing a database connection” when accessing your API, is there any reason why?

    Cheers,
    Jouvy

  45. Admin Avatar
    Admin

    Hi Jouvy,
    Unfortunately, a technical has appeared in last few weeks causing the server to run out of memory every few hours. I’ll try to fix it over the xmas break but the source of the problem is not obvious :-/
    Cheers,
    Chris

  46. Jouvy Avatar

    Hi Chris,

    Great, thanks for the info, hope you can find the root cause and fix it.
    Merry Christmas!

    Cheers,
    Jouvy

  47. Davide Avatar
    Davide

    Hi, after reading the terms and conditions I didn’t understand if this API can be used for a small example within the thesis work for the university? it would be very useful to me

  48. Admin Avatar
    Admin

    Hi Davide,
    That would be fine.
    Good luck with your thesis.
    Cheers,
    Chris

  49. Sanket Avatar
    Sanket

    I have been working on my research project and parsing the data required from your API ( Ergast) for my algorithms. However lately I have been experiencing a timeout error constantly when I try to fetch data from the server which is odd because I never encountered this issue before.

    I am attaching the code I have been working on.

    Hope you can provide me with an appropriate solution.

    Thank you

    Error: ConnectionError: (‘Connection aborted.’, ConnectionResetError(54, ‘Connection reset by peer’))

    Code:
    driver_standings = {‘season’: [],
    ’round’:[],
    ‘driver’: [],
    ‘driver_points’: [],
    ‘driver_wins’: [],
    ‘driver_standings_pos’: []}

    # query API

    for n in list(range(len(rounds))):
    for i in rounds[n][1]: # iterate through rounds of each year

    url = ‘https://ergast.com/api/f1/{}/{}/driverStandings.json’
    r = requests.get(url.format(rounds[n][0], i))
    json = r.json()

    for item in json[‘MRData’][‘StandingsTable’][‘StandingsLists’][0][‘DriverStandings’]:
    try:
    driver_standings[‘season’].append(int(json[‘MRData’][‘StandingsTable’][‘StandingsLists’][0][‘season’]))
    except:
    driver_standings[‘season’].append(None)

    try:
    driver_standings[’round’].append(int(json[‘MRData’][‘StandingsTable’][‘StandingsLists’][0][’round’]))
    except:
    driver_standings[’round’].append(None)

    try:
    driver_standings[‘driver’].append(item[‘Driver’][‘driverId’])
    except:
    driver_standings[‘driver’].append(None)

    try:
    driver_standings[‘driver_points’].append(int(item[‘points’]))
    except:
    driver_standings[‘driver_points’].append(None)

    try:
    driver_standings[‘driver_wins’].append(int(item[‘wins’]))
    except:
    driver_standings[‘driver_wins’].append(None)

    try:
    driver_standings[‘driver_standings_pos’].append(int(item[‘position’]))
    except:
    driver_standings[‘driver_standings_pos’].append(None)

    driver_standings = pd.DataFrame(driver_standings)

    # define lookup function to shift points and number of wins from previous rounds

    def lookup (df, team, points):
    df[‘lookup1′] = df.season.astype(str) + df[team] + df[’round’].astype(str)
    df[‘lookup2′] = df.season.astype(str) + df[team] + (df[’round’]-1).astype(str)
    new_df = df.merge(df[[‘lookup1’, points]], how = ‘left’, left_on=’lookup2′,right_on=’lookup1′)
    new_df.drop([‘lookup1_x’, ‘lookup2’, ‘lookup1_y’], axis = 1, inplace = True)
    new_df.rename(columns = {points+’_x’: points+’_after_race’, points+’_y’: points}, inplace = True)
    new_df[points].fillna(0, inplace = True)
    return new_df

    driver_standings = lookup(driver_standings, ‘driver’, ‘driver_points’)
    driver_standings = lookup(driver_standings, ‘driver’, ‘driver_wins’)
    driver_standings = lookup(driver_standings, ‘driver’, ‘driver_standings_pos’)

    driver_standings.drop([‘driver_points_after_race’, ‘driver_wins_after_race’, ‘driver_standings_pos_after_race’],
    axis = 1, inplace = True)

    driver_standings.tail(20)

  50. Admin Avatar
    Admin

    Hi Sanket,
    Have you read the Terms and Conditions? It looks like you’re trying to load the Standings data for every race in the database, which will probably get you blocked as you’ll exceed the rate limits. The block will clear automatically after 24 hours. If you want bulk data please download a database dump here: https://ergast.com/mrd/db/ e.g. the CSV files.
    The API is intended for Web Apps where you only request the data you need to present to a user.
    Cheers,
    Chris

Leave a Reply

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