The Problem

Formula 1 data is a mess to get your hands on. Sure, there are official apps and some paid APIs, but they’re often locked behind paywalls or APIs that feel like they were designed by someone who hates developers. You just want lap times, telemetry, or historical race data—preferably without selling your soul or dealing with a convoluted setup. Enter OpenF1, an open-source API that gives you real-time and historical F1 data, no strings attached.

What This Does

OpenF1 is a Python-based project that acts as a one-stop-shop for F1 data nerds. In the src/openf1/services/f1scraping/ directory, you’ve got tools to scrape race schedules, session results, and starting grids. For live race updates, dive into src/openf1/services/ingestorlivetiming/realtime/app.py, which pulls live timing data from F1 events. Need to dig into historical data? Check out src/openf1/services/ingestorlivetiming/historical/main.py.

The project is built with Flask for the API (src/openf1/services/queryapi/app.py), and it uses a Dockerfile and docker-compose.yml to containerize the setup. Configuration happens via a pyproject.toml and requirements.txt, so Python devs will feel right at home. There's also some MQTT love in src/openf1/util/mqtt.py if you’re into real-time messaging.

Real-World Use

Let’s say you want to analyze George Russell’s lap times from a specific session. You’d call the API like this:

Alternatively, if you want to self-host, clone the repo, set up MongoDB, and fire up the services. Start by scraping data with f1scraping, then run the ingestorlivetiming service to grab live race data, and finally, query it with the queryapi service. Boom—your own F1 data pipeline.

The Bottom Line

OpenF1 is a solid tool for anyone who wants F1 data without begging FIA for an API key. The project is well-structured, though the lack of tests (2 files?) and no stars on the forked repo is a bit of a red flag. Still, if you’re a developer or data nerd, this is a playground worth exploring. Just don’t expect polished perfection—it’s open-source, not magic.