Temporary blocking for rate violations

November 22nd, 2021

FYI I’ve had to introduce an automatic process for blocking users who violate the rate limits specified in the Terms & Conditions. This is because of a rogue app in circulation which is spamming the API.

Unfortunately, this might catch developers working on app development – when the real concern is apps published and distributed to multiple users.

If you find yourself blocked it should clear within 24 hours of your request rate dropping within the allowed rate. Apologies for any inconvenience.

Python requests has now been unblocked

November 1st, 2021

Python requests has now been unblocked as the rogue Python app has been identified and an alternative approach has been found to protect the API server. Apologies for anyone adversely affected by the temporary block.

Python requests is currently blocked!

October 30th, 2021

Due to a Python app breaking the Terms and Conditions by sending a deluge of requests I have blocked requests with the user agent strings:

“python-requests/2.26.0”
“python-requests/2.25.1”

Apologies if you’re affected. You can circumvent the block by setting a custom user agent string but please check first that your app is not calling the API in a continuous loop.

Python App Issue

October 28th, 2021

If you’ve published a Python app or wrapper recently would you please check that you are conforming to the rules stated in the Terms and Conditions – specifically the rules concerning calling the API in a loop. The site is currently experiencing very heavy traffic from a Python app where each instance is repeatedly making three requests every 8 seconds. If this continues I will have to block all traffic using Python which would be unfair on other users. If anyone spots an app which might be the source of this traffic please let me know via: admin@ergast.com so I can contact the author.

Database User Guide

January 31st, 2021

As an increasing number of users are working with the database dumps rather than with the API I’ve added a Database User Guide to the information on the Database Images page. Feedback would be very welcome.

Entity Relationship Diagram

January 28th, 2021

Following a user request I’ve created a Entity Relationship Diagram describing the internal structure of the Ergast database. I’ve also added a file providing the MySQL table definitions in case people need them. These are both available from the Database Images page.

Provisional 2021 Drivers and Constructors

December 28th, 2020

Using a similar approach to last year, ‘zero point’ standings have been added which will yield provisional lists of drivers and constructors:

http://ergast.com/api/f1/2021/driverStandings
http://ergast.com/api/f1/2021/constructorStandings

Unfortunately, there isn’t an easy way to associate drivers with constructors until after the first race due to the structure of the database.

Lost emails

December 11th, 2020

Apologies to anyone who sent an email in late November / early December and didn’t get a reply. The site was moved to a new server and a chunk of email went missing. I’m a bit clueless about email servers :-/

Provisional 2020 Drivers and Constructors

January 6th, 2020

Using a similar approach to last year, ‘zero point’ standings have been added which will yield provisional lists of drivers and constructors:

http://ergast.com/api/f1/2020/driverStandings

http://ergast.com/api/f1/2020/constructorStandings

Unfortunately, there isn’t an easy way to associate drivers with constructors until after the first race due to the structure of the database.

Column Headers in CSV Files

December 13th, 2019

Following requests from several users, the CSV files published after each race now include the column headers on the first line of each file. These headers match the field names in the database tables.

Provisional 2019 Drivers and Constructors

December 30th, 2018

In previous years, driver and constructor listings have not been available until after the results for the first race become available. This year, ‘zero point’ standings have been added which will yield provisional lists of drivers and constructors:

http://ergast.com/api/f1/2019/driverStandings

http://ergast.com/api/f1/2019/constructorStandings

PostgreSQL and CSV Support

August 21st, 2018

Following a number of requests, the database image is now available in a PostgreSQL compatible data dump and as set of CSV files. These are updated after each race and following any corrections. See the Database Images page for details.

Ergast runtime using Docker

September 8th, 2017

By: tonyh

Building on the release of the open source runtime, which provides the code required to run a version of the API on your own server using an Ergast database image, the runtime code repository has been updated to include a configuration script that can be used to launch the runtime and a database server using Docker containers linked by docker-compose.

The configuration builds two containers locally:

  • a MySQL database container seeded with the most recent Ergast database image;
  • a web server container running Apache and PHP 5 that serves the Ergast API using the same API paths as ergast.com.

In its current configuration, the database server can also be used to serve database requests to other linked containers. For example, the docker-compose.yaml includes a commented out example of how to connect a containing running RStudio, and how to connect to the database from an R script. To make the database API available outside the docker container, an additional --ports setting is required to expose the server port (3306).

The original runtime code is still available for use, either inside or outside Docker as part of your own API server, in the ./webroot directory.

https://github.com/jcnewell/ergast-f1-api


About Docker: Docker is a virtualisation platform that allows applications to run in lightweight virtual containers on remote hosts or locally.

If you use Docker on your own desktop, you can serve the ergast API locally on your own computer, and access it via localhost using the normal API paths, such as http://localhost:8000/api/f1/2017.json.

HTTPS support

May 29th, 2017

After requests from several users I’ve added support for HTTPS across the API. Let me know if you encounter any problems using it.

Open source runtime

May 3rd, 2017

Following several requests, the API runtime has been released on GitHub, under the Apache 2.0 open-source license.

https://github.com/jcnewell/ergast-f1-api

This allows people to deploy their own servers using an Ergast database image.

Hopefully, contributors may also improve the code and develop additional features!

Lap time data for 1996 onwards

April 14th, 2016

A kind contributor has provided additional lap time data from 1996 up to the end of the 2010 season, where the data previously started. This provides a total of 20 years worth of lap time data for you to analyse! The missing lap times for the Brazilian Grand Prix in 2014 have also been added. Thanks MB.

Formula E series support

September 20th, 2014

Ergast is pleased to announce support for the new FIA Formula E Championship on an experimental basis throughout the first season of the new series.

URLs are identical to those required for Formula One except that the series identifier changes to "fe" e.g.

http://ergast.com/api/fe/current/last/results

Currently there is no data for fastest laps, lap times or pit stops.

Feedback and suggestions would be very welcome.

Regular database image updates

June 23rd, 2014

Following a number of requests, an updated Ergast MySQL database image is now available after each race, rather than at the end of the season. Check the date on the download page if you want the most recent version.

2014 Season

March 15th, 2014

This is a post to confirm that the API will continue throughout 2014 and will track the results as they become available. The only significant change this year is the addition of the permanent driver numbers. Note that the “current” shortcut refers to 2013 until after the first race of the new season. Standings and driver or constructor listings for 2014 are only available after the first race.

Revised database image

March 13th, 2014

The database image issued at the end of the 2013 season has been revised as the source of some character encoding problems has been identified. If you have used the earlier version you may need to re-import data using the new image. The character encoding should now always be set to “utf8”.

Permanent Driver Numbers

March 7th, 2014

Drivers participating in the 2014 season onwards now have a permanent driver number. For these drivers there is a new PermanentNumber field in the Driver element. However, the value may sometimes differ from the value of the existing position attribute in the Result and QualifyingResult elements. This will occur in earlier seasons or where the reigning champion has chosen to use “1” rather than his permanent driver number, as Sebastian Vettel has done this year.

To accommodate this change the schema has been updated to: mrd-1.4.xsd

Updated Database Images

January 20th, 2014

The 2013 end of season MySQL database dump has been updated to take account of some recent corrections. There is also now an ANSI compatible version, which may be helpful for converting to other SQL formats such as SQLite. Both of these are available here: http://ergast.com/mrd/db

We’ve Moved

December 7th, 2013

Now the season has ended, we’ve taken the opportunity to move the site onto a VPS which we’ve been preparing throughout the autumn. As far as we can tell, the transition has happened smoothly but if you spot any problems please let us know. The move has been motivated by a growth in traffic which occasionally caused problems in the previous shared hosting service. The new VPS should provide more headroom and maintain responsiveness, which is important for your sites and apps. However, to achieve the best results, it’s important to cache queries at your server and in your clients.

2013 Database Image

November 25th, 2013

A new database image is available covering all seasons up to and including 2013: http://ergast.com/mrd/db

Mid-season Changes

September 22nd, 2013

I’m usually very reluctant to make any mid-season changes to the API but recent events have required a change to keep the API running. There was an increasing number of very large queries (some attempting to download all results since 1950!) which have put a heavy load on the server, in terms of memory and processor time. Since the API currently uses shared hosting this has caused problems for other websites and I was asked to take action to avoid the API being suspended.

The on-going change is a new maximum value of 1000 for the ‘limit’ query parameter. This will let you download a full season of results or a full list of all drivers, constructors, circuits etc. However, please use the smallest value that your applications requires, preferably only requesting the information you need to present in the current view. Please also implement caching as much as possible, either (or both) on your server and in your applications. This will improve the performance of your applications and for other API users. If you require large amounts of historical data please consider downloading the database image rather than polling the API.

Meanwhile, the Ergast site will be moving to a Virtual Private Server to improve performance and reduce the impact of heavy traffic on other websites.

2013 Season Changes

February 26th, 2013

Pressure of work and the disappointing absence of any reliable source of tyre data means that there are few changes to the API for the 2013 season.

The only new feature is the introduction of the official three letter codes for each driver. Wherever the Driver element appears (i.e. in the Driver, Race and Standings tables) there is a new “code” attribute for all drivers from the 2005 season onwards.

The only significant change to the API is that the Result element now has both a “position” attribute (which is always an integer) and a “positionText” attribute (which is an integer when the driver is classified or a letter to signal their finishing status).

Looking forward to the first race of the season, and checking-in the first set of results to the API database!

2013 Season

December 7th, 2012

This post is to confirm that the Ergast API will continue to provide F1 results throughout the 2013 season and beyond. There have been a number of requests for enhancements:

– three letter codes for drivers
– driver photos
– drivers and teams listed before the first race
– explicit position / unclassified status
– tyre data (dependent on finding a data source)

If you have any other suggestions please let me know although I can’t promise to implement all of them.

Looking forward to seeing your new apps for the 2013 season!

Updated Database Image

November 28th, 2012

A new database image is available covering all seasons up to and including 2012: http://ergast.com/mrd/db

Database Image

April 24th, 2012

Ergast is pleased to announce the publication of a complete image of the Ergast database. This is made available under the Attribution-NonCommercial-ShareAlike 3.0 Unported Licence and will be updated at the end of each season. The image allows you to create an exact copy of the MySQL database for your own purposes. Let us know what you do with it.

Lap Time and Pit Stop data

March 3rd, 2012

Ergast is pleased to announce that Lap Time and Pit Stop data will be available throughout the 2012 season on an experimental basis – this means the data may not be available as quickly as race results and will not be subject to the same degree of manual checking due to the volume of information. See the new Lap Times and Pit Stops documentation pages for more details. The API also provides a complete set of this data for the 2011 season. Feedback on the new API methods and data validity would be very much appreciated.