{"openapi":"3.1.0","info":{"title":"NextRaceF1 API","version":"1.0.0","summary":"Unofficial Formula 1 schedule: next race, race weekends and session times.","description":"Read-only and without authentication; CORS is open to every origin. Times are ISO 8601 UTC and venue_timezone is an IANA zone. While schedule_confirmed is false, formula1.com has not confirmed session times: only dates are reliable, and the stored times are placeholders. Responses carry an ETag; send If-None-Match to get 304. Cite page_url; formula1.com is the primary source.","contact":{"name":"NextRaceF1","url":"https://www.nextracef1.com/about"}},"servers":[{"url":"https://www.nextracef1.com"}],"externalDocs":{"description":"Field reference","url":"https://www.nextracef1.com/docs/race-data.md"},"tags":[{"name":"races","description":"Race schedules"},{"name":"calendars","description":"iCalendar feeds"}],"paths":{"/api/next-race.json":{"get":{"operationId":"getNextRace","tags":["races"],"summary":"Next race, or the race weekend under way","responses":{"200":{"description":"The featured race (live weekend or next race) and the next race.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NextRaceResponse"}}}},"304":{"description":"Not modified: the ETag in If-None-Match still matches."}}}},"/api/races.json":{"get":{"operationId":"listRaces","tags":["races"],"summary":"Every race of one season","parameters":[{"name":"season","in":"query","required":false,"description":"Season year. Without it, the current or next edition (races) or the current season (season list).","schema":{"type":"integer","enum":[2026,2027]}}],"responses":{"200":{"description":"The season's data file, plus links to the other seasons.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeasonList"}}}},"304":{"description":"Not modified: the ETag in If-None-Match still matches."},"404":{"description":"Unknown race or season.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A query parameter is not a valid integer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/races/{slug}.json":{"get":{"operationId":"getRace","tags":["races"],"summary":"One race with every session","parameters":[{"name":"slug","in":"path","required":true,"description":"Race slug; it stays the same across seasons.","schema":{"type":"string","enum":["australia","austria","azerbaijan","bahrain","barcelona-catalunya","belgium","brazil","canada","china","great-britain","hungary","italy","japan","las-vegas","mexico","miami","monaco","netherlands","portugal","qatar","saudi-arabia","singapore","spain","turkey","united-arab-emirates","united-states"]}},{"name":"season","in":"query","required":false,"description":"Season year. Without it, the current or next edition (races) or the current season (season list).","schema":{"type":"integer","enum":[2026,2027]}}],"responses":{"200":{"description":"The race, its start times by zone and its neighbours.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RaceResponse"}}}},"304":{"description":"Not modified: the ETag in If-None-Match still matches."},"404":{"description":"Unknown race or season.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A query parameter is not a valid integer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/races/{slug}/weekend.ics":{"get":{"operationId":"getRaceWeekendCalendar","tags":["calendars"],"summary":"iCalendar file with every session of one race weekend","parameters":[{"name":"slug","in":"path","required":true,"description":"Race slug; it stays the same across seasons.","schema":{"type":"string","enum":["australia","austria","azerbaijan","bahrain","barcelona-catalunya","belgium","brazil","canada","china","great-britain","hungary","italy","japan","las-vegas","mexico","miami","monaco","netherlands","portugal","qatar","saudi-arabia","singapore","spain","turkey","united-arab-emirates","united-states"]}},{"name":"season","in":"query","required":false,"description":"Season year. Without it, the current or next edition (races) or the current season (season list).","schema":{"type":"integer","enum":[2026,2027]}}],"responses":{"200":{"description":"An RFC 5545 calendar with one event per session. While Formula 1 has not confirmed the times, it holds a single all-day TENTATIVE event spanning the weekend instead.","content":{"text/calendar":{"schema":{"type":"string"}}}},"304":{"description":"Not modified: the ETag in If-None-Match still matches."},"404":{"description":"Unknown race or season.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A query parameter is not a valid integer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"schemas":{"Location":{"type":"object","properties":{"city":{"type":"string"},"country":{"type":"string"},"address":{"type":"string"},"venue_timezone":{"type":"string","description":"IANA time zone of the circuit."},"circuit_name":{"type":"string"}},"required":["venue_timezone"]},"ScheduleSession":{"type":"object","properties":{"slug":{"type":"string","description":"practice-1, practice-2, practice-3, sprint-qualifying, sprint, qualifying or race."},"name":{"type":"string"},"start_utc":{"type":"string","format":"date-time","description":"UTC start. A formula1.com placeholder while schedule_confirmed is false."},"end_utc":{"type":"string","format":"date-time","description":"UTC end. A formula1.com placeholder while schedule_confirmed is false."}},"required":["slug","name","start_utc","end_utc"]},"ScheduleRace":{"type":"object","description":"One race as stored in the season data file.","properties":{"slug":{"type":"string","pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$","description":"formula1.com race slug, e.g. mexico or united-arab-emirates. It stays the same across seasons."},"round":{"type":["integer","null"],"minimum":1,"description":"Round number; null for a cancelled race."},"status":{"type":"string","enum":["scheduled","rescheduled","cancelled"],"description":"Calendar status from formula1.com. Cancelled races never count as the next race."},"status_note":{"type":"string"},"name":{"type":"string"},"official_name":{"type":"string"},"official_url":{"type":"string","format":"uri"},"meeting_name":{"type":"string"},"location":{"$ref":"#/components/schemas/Location"},"weekend_start_utc":{"type":"string","format":"date-time"},"weekend_end_utc":{"type":"string","format":"date-time"},"race_start_utc":{"type":"string","format":"date-time","description":"A formula1.com placeholder while schedule_confirmed is false."},"race_end_utc":{"type":"string","format":"date-time"},"laps":{"type":["integer","number","string","null"],"description":"Scheduled race laps, when published."},"distance_km":{"type":["number","string","null"],"description":"Scheduled race distance in km, when published."},"is_sprint_weekend":{"type":"boolean"},"schedule_confirmed":{"type":"boolean","description":"False while formula1.com has not confirmed session times: only dates are reliable then."},"sessions":{"type":"array","items":{"$ref":"#/components/schemas/ScheduleSession"}},"updated_at_utc":{"type":"string","format":"date-time","description":"When this race's data last changed."}},"required":["slug","round","name","official_name","official_url","location","weekend_start_utc","weekend_end_utc","race_start_utc","race_end_utc","is_sprint_weekend","sessions"]},"CalendarLinks":{"type":"object","properties":{"season_races":{"type":"string","format":"uri","description":"Every race start, all loaded seasons."},"season_weekends":{"type":"string","format":"uri","description":"Every session, all loaded seasons."},"season_races_webcal":{"type":"string"},"season_weekends_webcal":{"type":"string"}},"required":["season_races","season_weekends"]},"SeasonList":{"type":"object","description":"One season's data file, plus links to the other seasons.","properties":{"site":{"type":"string"},"season":{"type":"integer"},"source_url":{"type":"string","format":"uri"},"generated_at_utc":{"type":"string","format":"date-time"},"race_count":{"type":"integer","description":"Races that are not cancelled."},"schedule_confirmed":{"type":"boolean","description":"False while formula1.com has not confirmed session times: only dates are reliable then."},"races":{"type":"array","items":{"$ref":"#/components/schemas/ScheduleRace"}},"canonical_url":{"type":"string","format":"uri"},"calendar":{"$ref":"#/components/schemas/CalendarLinks"},"seasons":{"type":"array","items":{"type":"object","properties":{"season":{"type":"integer"},"url":{"type":"string","format":"uri"}},"required":["season","url"]}}},"required":["season","generated_at_utc","races","calendar","seasons"]},"RaceSession":{"allOf":[{"$ref":"#/components/schemas/ScheduleSession"},{"type":"object","properties":{"utc_label":{"type":"string","description":"Readable UTC start, or 'Time TBC'."},"utc_short_label":{"type":"string"},"day_label":{"type":"string"},"anchor":{"type":"string","description":"Fragment id of the session on the race page."},"start_venue":{"type":"string","format":"date-time","description":"Start in the circuit's time zone, with its UTC offset."},"venue_label":{"type":["string","null"],"description":"Readable circuit-local start; null while times are TBC."},"is_next":{"type":"boolean"},"has_started":{"type":"boolean"},"is_live":{"type":"boolean"}},"required":["utc_label","start_venue","has_started","is_live"]}]},"RaceRef":{"type":"object","description":"A short reference to another race or edition.","properties":{"slug":{"type":"string","pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$","description":"formula1.com race slug, e.g. mexico or united-arab-emirates. It stays the same across seasons."},"season":{"type":"integer"},"name":{"type":"string"},"round":{"type":["integer","null"],"minimum":1,"description":"Round number; null for a cancelled race."},"state":{"type":"string","enum":["upcoming","weekend","live","finished","cancelled"],"description":"Where the race stands now: weekend means sessions start within 12 hours or are under way; live means the race itself is running."},"status":{"type":"string","enum":["scheduled","rescheduled","cancelled"],"description":"Calendar status from formula1.com. Cancelled races never count as the next race."},"page_url":{"type":"string","format":"uri"},"edition_url":{"type":"string","format":"uri"},"official_url":{"type":"string","format":"uri"},"ics_url":{"type":"string","format":"uri"},"weekend_ics_url":{"type":"string","format":"uri"},"race_start_utc":{"type":"string","format":"date-time","description":"A placeholder while schedule_confirmed is false."},"race_start_label_utc":{"type":"string"},"race_date_iso":{"type":"string","format":"date","description":"Race day at the circuit."},"schedule_confirmed":{"type":"boolean","description":"False while formula1.com has not confirmed session times: only dates are reliable then."},"weekend_dates_label":{"type":"string"}},"required":["slug","season","name","page_url","race_start_utc","schedule_confirmed"]},"Race":{"description":"A race as served by the site: the data-file fields plus computed ones.","allOf":[{"$ref":"#/components/schemas/ScheduleRace"},{"type":"object","properties":{"season":{"type":"integer"},"state":{"type":"string","enum":["upcoming","weekend","live","finished","cancelled"],"description":"Where the race stands now: weekend means sessions start within 12 hours or are under way; live means the race itself is running."},"is_cancelled":{"type":"boolean"},"is_rescheduled":{"type":"boolean"},"page_url":{"type":"string","format":"uri","description":"Canonical page: /races/{slug} for the current or next edition."},"edition_url":{"type":"string","format":"uri","description":"Permanent page for this edition: /races/{slug}/{season}."},"is_evergreen":{"type":"boolean","description":"True when page_url is the evergreen /races/{slug} URL."},"api_url":{"type":"string","format":"uri"},"ics_url":{"type":"string","format":"uri"},"weekend_ics_url":{"type":"string","format":"uri"},"location_label":{"type":"string"},"race_start_label_utc":{"type":"string","description":"Readable UTC start, or the date with 'time TBC'."},"race_date_iso":{"type":"string","format":"date","description":"Race day at the circuit."},"weekend_dates_label":{"type":"string"},"data_updated_utc":{"type":"string","format":"date-time","description":"When this race's data last changed."},"sessions":{"type":"array","items":{"$ref":"#/components/schemas/RaceSession"}},"previous_race_ref":{"anyOf":[{"$ref":"#/components/schemas/RaceRef"},{"type":"null"}]},"next_race_ref":{"anyOf":[{"$ref":"#/components/schemas/RaceRef"},{"type":"null"}]},"previous_edition_ref":{"anyOf":[{"$ref":"#/components/schemas/RaceRef"},{"type":"null"}]},"next_edition_ref":{"anyOf":[{"$ref":"#/components/schemas/RaceRef"},{"type":"null"}]}},"required":["season","state","page_url","edition_url","ics_url","weekend_ics_url","data_updated_utc","sessions"]}]},"NextRaceResponse":{"type":"object","properties":{"site":{"type":"string"},"generated_at_utc":{"type":"string","format":"date-time"},"canonical_url":{"type":"string","format":"uri"},"season":{"type":"integer"},"calendar":{"allOf":[{"$ref":"#/components/schemas/CalendarLinks"},{"type":"object","properties":{"next_race":{"type":"string","format":"uri"},"next_race_weekend":{"type":"string","format":"uri"}},"required":["next_race","next_race_weekend"]}]},"featured_race":{"anyOf":[{"$ref":"#/components/schemas/Race"},{"type":"null"}],"description":"The live race weekend if there is one, otherwise the next race."},"homepage_spotlight":{"type":["object","null"],"description":"Countdown target and labels used by the homepage."},"next_race":{"anyOf":[{"$ref":"#/components/schemas/Race"},{"type":"null"}],"description":"The next race that has not started."}},"required":["generated_at_utc","season","calendar","featured_race","next_race"]},"RaceResponse":{"type":"object","properties":{"site":{"type":"string"},"generated_at_utc":{"type":"string","format":"date-time"},"canonical_url":{"type":"string","format":"uri"},"calendar":{"type":"object","properties":{"race":{"type":"string","format":"uri"},"weekend":{"type":"string","format":"uri"},"season_races":{"type":"string","format":"uri"},"season_weekends":{"type":"string","format":"uri"}},"required":["race","weekend"]},"race":{"$ref":"#/components/schemas/Race"},"start_times":{"type":["object","null"],"additionalProperties":{"type":"object","properties":{"utc":{"type":"string","format":"date-time"},"venue":{"type":"string","format":"date-time","description":"Start in the circuit's time zone."},"by_zone":{"type":"object","additionalProperties":{"type":"string","format":"date-time"},"description":"Start in each world time zone the site lists, keyed by IANA zone."}},"required":["utc","venue","by_zone"]},"description":"Session starts keyed by session slug; null while times are TBC or the race is cancelled."},"previous_race":{"anyOf":[{"$ref":"#/components/schemas/RaceRef"},{"type":"null"}]},"next_race":{"anyOf":[{"$ref":"#/components/schemas/RaceRef"},{"type":"null"}]},"next_edition":{"anyOf":[{"$ref":"#/components/schemas/RaceRef"},{"type":"null"}]}},"required":["generated_at_utc","canonical_url","calendar","race","start_times"]},"Error":{"type":"object","properties":{"detail":{"type":["string","array"],"description":"What went wrong."}},"required":["detail"]}}}}