def get_qualifying_results(self, season, round_num): """Get qualifying results for a specific season and round""" url = f"{self.base_url}/{season}/{round_num}/qualifying.json" return self.make_request(url)
def fetch_round(self, season, round_num): """Fetch qualifying results for a specific season and round""" logger.info( f"Fetching qualifying results for season {season}, round {round_num}" ) # Create season directory season_dir = self.base_dir / str(season) os.makedirs(season_dir, exist_ok=True) # Get race information race_info = self.get_race_info(season, round_num) if not race_info: logger.warning(f"No race found for season {season}, round {round_num}") return race_name = self.get_race_folder_name(race_info) # Create race directory race_dir = season_dir / race_name os.makedirs(race_dir, exist_ok=True) # Get qualifying results qualifying_results = self.get_qualifying_results(season, round_num) if qualifying_results: qualifying_results_path = race_dir / "quali_results.json" self.save_json(qualifying_results, qualifying_results_path) logger.info( f"Successfully fetched qualifying results for {season} {race_name}" ) else: logger.warning(f"No qualifying results found for {season} {race_name}")
Only the top 15 drivers participate in Q2, and only the top 10 participate in Q3. Drivers eliminated in earlier sessions won’t have times for subsequent sessions.
The qualifying format has changed throughout F1 history:
Period
Format
Pre-2003
Single lap qualifying
2003-2005
Two sessions (Friday & Saturday)
2006-present
Knockout format (Q1, Q2, Q3)
The data structure varies based on the qualifying format used. Modern races use Q1/Q2/Q3 fields, while older races may have different structures or no data at all.