f1verse
f1verse · Python

How do I get F1 qualifying results with the right gaps?

Call f1verse.load_session(year, round, "Qualifying"). Gaps are measured to the fastest lap of that segment, and each driver carries the segment they were eliminated in.

>>> q = f1verse.load_session(2026, 12, "Qualifying")
>>> q.results()[0]
{'abbr': 'NOR', 'q1': 72.695, 'q1_gap': 0.085, 'q3': 71.163,
 'q3_gap': 0.0, 'best': 71.163, 'eliminated_in': None, ...}
>>> q.segments()["q1"]["cut_margin"]
0.022

A single “gap to leader” column misreports qualifying: the pole-sitter above was 0.085 s off the fastest time in Q1. Each kind of session gets the classification it actually has.

f1verse.sessions(year, round) lists what a weekend contained, in order — the valid inputs to load_session. A sprint loads as a race; sprint qualifying loads as qualifying.

Related