Ergast F1

Sports API · Works globally · Formula 1 data · No API key

TL;DR

The Ergast F1 API is the definitive source for historical Formula 1 data from 1950 to the present. Access race results, qualifying sessions, driver standings, constructor standings, circuit information, lap times, pit stops, and driver details. Query by season, round, driver, constructor, or circuit. Returns data in JSON or XML format. No API key, no rate limits. A motorsport historian's dream for stats analysis, fantasy F1 apps, and race databases.

Quick start: https://ergast.com/api/f1/2023/last/results.json

No API key needed — just make a request!

How to Use This API

1. Last Race Results

https://ergast.com/api/f1/2023/last/results.json

2. Driver Standings for a Season

https://ergast.com/api/f1/2023/driverStandings.json

3. JavaScript — 2023 Season Results

fetch('https://ergast.com/api/f1/2023/results.json?limit=100')
  .then(r => r.json())
  .then(data => {
    const races = data.MRData.RaceTable.Races;
    races.forEach(r => {
      console.log(`Round ${r.round}: ${r.raceName} (${r.Circuit.circuitName})`);
      console.log(`  Winner: ${r.Results[0].Driver.givenName} ${r.Results[0].Driver.familyName}`);
    });
  });

4. Python — Driver Championship Points

import requests

data = requests.get(
    'https://ergast.com/api/f1/2023/driverStandings.json'
).json()

standings = data['MRData']['StandingsTable']['StandingsLists'][0]['DriverStandings']
for d in standings[:10]:
    print(f"{d['position']}. {d['Driver']['givenName']} {d['Driver']['familyName']}: "
          f"{d['points']} pts ({d['wins']} wins)")
2023 last race results: https://ergast.com/api/f1/2023/last/results.json

Frequently Asked Questions

What data is available?
Race results, qualifying results, driver standings, constructor standings, circuit info, lap times, pit stops, driver info, constructor info, season schedules, and finishing status.
How do I filter by season?
Use /api/f1/{season}/ where season is a year (2023) or "current". Use /api/f1/{season}/{round}/ for a specific race. Use "last" for the most recent race.
Can I search by driver?
Yes: /api/f1/drivers/{driverId}/results.json or combine with season: /api/f1/2023/drivers/hamilton/results.json. Driver IDs include "hamilton", "max_verstappen", "leclerc", etc.
What about constructor data?
Constructors include "red_bull", "mercedes", "ferrari", "mclaren", etc. Query: /api/f1/2023/constructors/red_bull/results.json.
Does the API cover all F1 seasons?
Yes, from the first World Championship season in 1950 through the most recent race. Historical data includes drivers, constructors, circuits, and all race weekends.
What are the limits?
Results default to 30 per page. Use limit and offset parameters for pagination. There is no hard rate limit but caching is encouraged.

API Details

API URL
https://ergast.com/api/f1
Documentation
ergast.com/mrd
Category
Sports
Authentication
Not Required
Geographic Coverage
Global — All Formula 1 World Championship seasons

What You Can Build