{ "openapi": "3.0.2", "info": { "title": "F1 API", "description": "An easier way to use the [ergast.com](https://ergast.com/mrd/) F1 API, with correct types!", "license": { "name": "MIT", "url": "https://github.com/f1betting/F1API/blob/main/LICENSE.md" }, "version": "1.10.3", "x-logo": { "url": "https://upload.wikimedia.org/wikipedia/commons/f/f2/New_era_F1_logo.png" } }, "paths": { "/calendar/{season}": { "get": { "tags": [ "Season" ], "summary": "Get Calendar By Season", "operationId": "get_calendar_by_season", "parameters": [ { "required": true, "schema": { "title": "Season", "type": "integer" }, "name": "season", "in": "path" } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Calendar" }, "example": { "timestamp": 1669984351.4048898, "events": [ { "season": 2022, "round": 1, "url": "https://en.wikipedia.org/wiki/2022_Bahrain_Grand_Prix", "raceName": "Bahrain Grand Prix", "Circuit": { "circuitId": "bahrain", "url": "https://en.wikipedia.org/wiki/Bahrain_International_Circuit", "circuitName": "Bahrain International Circuit", "Location": { "lat": 26.0325, "long": 50.5106, "locality": "Sakhir", "country": "Bahrain" } }, "date": "2022-03-20", "time": "15:00:00Z", "FirstPractice": { "date": "2022-03-18", "time": "12:00:00Z" }, "SecondPractice": { "date": "2022-03-18", "time": "15:00:00Z" }, "ThirdPractice": { "date": "2022-03-19", "time": "12:00:00Z" }, "Qualifying": { "date": "2022-03-19", "time": "15:00:00Z" } }, { "season": 2022, "round": 2, "url": "https://en.wikipedia.org/wiki/2022_Saudi_Arabian_Grand_Prix", "raceName": "Saudi Arabian Grand Prix", "Circuit": { "circuitId": "jeddah", "url": "https://en.wikipedia.org/wiki/Jeddah_Street_Circuit", "circuitName": "Jeddah Corniche Circuit", "Location": { "lat": 21.6319, "long": 39.1044, "locality": "Jeddah", "country": "Saudi Arabia" } }, "date": "2022-03-27", "time": "17:00:00Z", "FirstPractice": { "date": "2022-03-25", "time": "14:00:00Z" }, "SecondPractice": { "date": "2022-03-25", "time": "17:00:00Z" }, "ThirdPractice": { "date": "2022-03-26", "time": "14:00:00Z" }, "Qualifying": { "date": "2022-03-26", "time": "17:00:00Z" } }, { "season": 2022, "round": 3, "url": "https://en.wikipedia.org/wiki/2022_Australian_Grand_Prix", "raceName": "Australian Grand Prix", "Circuit": { "circuitId": "albert_park", "url": "https://en.wikipedia.org/wiki/Melbourne_Grand_Prix_Circuit", "circuitName": "Albert Park Grand Prix Circuit", "Location": { "lat": -37.8497, "long": 144.968, "locality": "Melbourne", "country": "Australia" } }, "date": "2022-04-10", "time": "05:00:00Z", "FirstPractice": { "date": "2022-04-08", "time": "03:00:00Z" }, "SecondPractice": { "date": "2022-04-08", "time": "06:00:00Z" }, "ThirdPractice": { "date": "2022-04-09", "time": "03:00:00Z" }, "Qualifying": { "date": "2022-04-09", "time": "06:00:00Z" } }, { "season": 2022, "round": 4, "url": "https://en.wikipedia.org/wiki/2022_Emilia_Romagna_Grand_Prix", "raceName": "Emilia Romagna Grand Prix", "Circuit": { "circuitId": "imola", "url": "https://en.wikipedia.org/wiki/Autodromo_Enzo_e_Dino_Ferrari", "circuitName": "Autodromo Enzo e Dino Ferrari", "Location": { "lat": 44.3439, "long": 11.7167, "locality": "Imola", "country": "Italy" } }, "date": "2022-04-24", "time": "13:00:00Z", "FirstPractice": { "date": "2022-04-22", "time": "11:30:00Z" }, "SecondPractice": { "date": "2022-04-23", "time": "10:30:00Z" }, "Qualifying": { "date": "2022-04-22", "time": "15:00:00Z" } }, { "season": 2022, "round": 5, "url": "https://en.wikipedia.org/wiki/2022_Miami_Grand_Prix", "raceName": "Miami Grand Prix", "Circuit": { "circuitId": "miami", "url": "https://en.wikipedia.org/wiki/Miami_International_Autodrome", "circuitName": "Miami International Autodrome", "Location": { "lat": 25.9581, "long": -80.2389, "locality": "Miami", "country": "USA" } }, "date": "2022-05-08", "time": "19:30:00Z", "FirstPractice": { "date": "2022-05-06", "time": "18:30:00Z" }, "SecondPractice": { "date": "2022-05-06", "time": "21:30:00Z" }, "ThirdPractice": { "date": "2022-05-07", "time": "17:00:00Z" }, "Qualifying": { "date": "2022-05-07", "time": "20:00:00Z" } } ] } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Message" }, "example": { "message": "Calendar not found" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/event/next": { "get": { "tags": [ "Events" ], "summary": "Get Next Race", "operationId": "get_next_race", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NextEvent" }, "example": { "timestamp": 1669979205.6921754, "season": 2022, "round": 22 } } } }, "503": { "description": "Service Unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Message" }, "example": { "message": "Service unavailable" } } } } } } }, "/event/previous": { "get": { "tags": [ "Events" ], "summary": "Get Previous Race", "operationId": "get_previous_race", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NextEvent" }, "example": { "timestamp": 1669979205.6921754, "season": 2022, "round": 21 } } } }, "503": { "description": "Service Unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Message" }, "example": { "message": "Service unavailable" } } } } } } }, "/event/{season}/{race}": { "get": { "tags": [ "Events" ], "summary": "Get Event Details", "operationId": "get_event_details", "parameters": [ { "required": true, "schema": { "title": "Season", "type": "integer" }, "name": "season", "in": "path" }, { "required": true, "schema": { "title": "Race", "type": "integer" }, "name": "race", "in": "path" } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Event" }, "example": { "timestamp": 1669979237.0388148, "season": 2022, "round": 22, "url": "https://en.wikipedia.org/wiki/2022_Abu_Dhabi_Grand_Prix", "raceName": "Abu Dhabi Grand Prix", "Circuit": { "circuitId": "yas_marina", "url": "https://en.wikipedia.org/wiki/Yas_Marina_Circuit", "circuitName": "Yas Marina Circuit", "Location": { "lat": 24.4672, "long": 54.6031, "locality": "Abu Dhabi", "country": "UAE" } }, "date": "2022-11-20", "time": "13:00:00Z", "FirstPractice": { "date": "2022-11-18", "time": "10:00:00Z" }, "SecondPractice": { "date": "2022-11-18", "time": "13:00:00Z" }, "ThirdPractice": { "date": "2022-11-19", "time": "11:00:00Z" }, "Qualifying": { "date": "2022-11-19", "time": "14:00:00Z" } } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Message" }, "example": { "message": "Event not found" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Service Unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Message" }, "example": { "message": "Service unavailable" } } } } } } }, "/circuits": { "get": { "tags": [ "Circuits" ], "summary": "Get Circuits", "operationId": "get_circuits", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Circuits" }, "example": { "timestamp": 1669984523.7729688, "circuits": [ { "circuitId": "albert_park", "url": "https://en.wikipedia.org/wiki/Melbourne_Grand_Prix_Circuit", "circuitName": "Albert Park Grand Prix Circuit", "Location": { "lat": -37.8497, "long": 144.968, "locality": "Melbourne", "country": "Australia" } }, { "circuitId": "americas", "url": "https://en.wikipedia.org/wiki/Circuit_of_the_Americas", "circuitName": "Circuit of the Americas", "Location": { "lat": 30.1328, "long": -97.6411, "locality": "Austin", "country": "USA" } }, { "circuitId": "bahrain", "url": "https://en.wikipedia.org/wiki/Bahrain_International_Circuit", "circuitName": "Bahrain International Circuit", "Location": { "lat": 26.0325, "long": 50.5106, "locality": "Sakhir", "country": "Bahrain" } }, { "circuitId": "baku", "url": "https://en.wikipedia.org/wiki/Baku_City_Circuit", "circuitName": "Baku City Circuit", "Location": { "lat": 40.3725, "long": 49.8533, "locality": "Baku", "country": "Azerbaijan" } }, { "circuitId": "catalunya", "url": "https://en.wikipedia.org/wiki/Circuit_de_Barcelona-Catalunya", "circuitName": "Circuit de Barcelona-Catalunya", "Location": { "lat": 41.57, "long": 2.26111, "locality": "Montmeló", "country": "Spain" } } ] } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Message" }, "example": { "message": "Circuits not found" } } } }, "503": { "description": "Service Unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Message" }, "example": { "message": "Service unavailable" } } } } } } }, "/circuits/{season}": { "get": { "tags": [ "Circuits", "Season" ], "summary": "Get Circuits By Season", "operationId": "get_circuits_by_season", "parameters": [ { "required": true, "schema": { "title": "Season", "type": "string" }, "name": "season", "in": "path" } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Circuits" }, "example": { "timestamp": 1669984523.7729688, "circuits": [ { "circuitId": "albert_park", "url": "https://en.wikipedia.org/wiki/Melbourne_Grand_Prix_Circuit", "circuitName": "Albert Park Grand Prix Circuit", "Location": { "lat": -37.8497, "long": 144.968, "locality": "Melbourne", "country": "Australia" } }, { "circuitId": "americas", "url": "https://en.wikipedia.org/wiki/Circuit_of_the_Americas", "circuitName": "Circuit of the Americas", "Location": { "lat": 30.1328, "long": -97.6411, "locality": "Austin", "country": "USA" } }, { "circuitId": "bahrain", "url": "https://en.wikipedia.org/wiki/Bahrain_International_Circuit", "circuitName": "Bahrain International Circuit", "Location": { "lat": 26.0325, "long": 50.5106, "locality": "Sakhir", "country": "Bahrain" } }, { "circuitId": "baku", "url": "https://en.wikipedia.org/wiki/Baku_City_Circuit", "circuitName": "Baku City Circuit", "Location": { "lat": 40.3725, "long": 49.8533, "locality": "Baku", "country": "Azerbaijan" } }, { "circuitId": "catalunya", "url": "https://en.wikipedia.org/wiki/Circuit_de_Barcelona-Catalunya", "circuitName": "Circuit de Barcelona-Catalunya", "Location": { "lat": 41.57, "long": 2.26111, "locality": "Montmeló", "country": "Spain" } } ] } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Message" }, "example": { "message": "Circuits not found" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Service Unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Message" }, "example": { "message": "Service unavailable" } } } } } } }, "/circuit/{circuit_id}": { "get": { "tags": [ "Circuits" ], "summary": "Get Circuit By Id", "operationId": "get_circuit_by_id", "parameters": [ { "required": true, "schema": { "title": "Circuit Id", "type": "string" }, "name": "circuit_id", "in": "path" } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Circuit" }, "example": { "timestamp": 1669978998.3723269, "circuitId": "zandvoort", "url": "https://en.wikipedia.org/wiki/Circuit_Zandvoort", "circuitName": "Circuit Park Zandvoort", "Location": { "lat": 52.3888, "long": 4.54092, "locality": "Zandvoort", "country": "Netherlands" } } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Message" }, "example": { "message": "Circuit not found" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Service Unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Message" }, "example": { "message": "Service unavailable" } } } } } } }, "/constructors": { "get": { "tags": [ "Constructors" ], "summary": "Get Constructors", "operationId": "get_constructors", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Constructors" }, "example": { "timestamp": 1669984214.2694075, "constructors": [ { "constructorId": "alfa", "url": "https://en.wikipedia.org/wiki/Alfa_Romeo_in_Formula_One", "name": "Alfa Romeo", "nationality": "Swiss" }, { "constructorId": "alphatauri", "url": "https://en.wikipedia.org/wiki/Scuderia_AlphaTauri", "name": "AlphaTauri", "nationality": "Italian" }, { "constructorId": "alpine", "url": "https://en.wikipedia.org/wiki/Alpine_F1_Team", "name": "Alpine F1 Team", "nationality": "French" }, { "constructorId": "aston_martin", "url": "https://en.wikipedia.org/wiki/Aston_Martin_in_Formula_One", "name": "Aston Martin", "nationality": "British" }, { "constructorId": "ferrari", "url": "https://en.wikipedia.org/wiki/Scuderia_Ferrari", "name": "Ferrari", "nationality": "Italian" } ] } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Message" }, "example": { "message": "Constructors not found" } } } }, "503": { "description": "Service Unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Message" }, "example": { "message": "Service unavailable" } } } } } } }, "/constructors/{season}": { "get": { "tags": [ "Constructors", "Season" ], "summary": "Get Constructors By Season", "operationId": "get_constructors_by_season", "parameters": [ { "required": true, "schema": { "title": "Season", "type": "string" }, "name": "season", "in": "path" } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Constructors" }, "example": { "timestamp": 1669984214.2694075, "constructors": [ { "constructorId": "alfa", "url": "https://en.wikipedia.org/wiki/Alfa_Romeo_in_Formula_One", "name": "Alfa Romeo", "nationality": "Swiss" }, { "constructorId": "alphatauri", "url": "https://en.wikipedia.org/wiki/Scuderia_AlphaTauri", "name": "AlphaTauri", "nationality": "Italian" }, { "constructorId": "alpine", "url": "https://en.wikipedia.org/wiki/Alpine_F1_Team", "name": "Alpine F1 Team", "nationality": "French" }, { "constructorId": "aston_martin", "url": "https://en.wikipedia.org/wiki/Aston_Martin_in_Formula_One", "name": "Aston Martin", "nationality": "British" }, { "constructorId": "ferrari", "url": "https://en.wikipedia.org/wiki/Scuderia_Ferrari", "name": "Ferrari", "nationality": "Italian" } ] } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Message" }, "example": { "message": "Constructors not found" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Service Unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Message" }, "example": { "message": "Service unavailable" } } } } } } }, "/constructor/{constructor_id}": { "get": { "tags": [ "Constructors" ], "summary": "Get Constructor By Id", "operationId": "get_constructor_by_id", "parameters": [ { "required": true, "schema": { "title": "Constructor Id", "type": "string" }, "name": "constructor_id", "in": "path" } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Constructor" }, "example": { "timestamp": 1669978904.85484, "constructorId": "red_bull", "url": "https://en.wikipedia.org/wiki/Red_Bull_Racing", "name": "Red Bull", "nationality": "Austrian" } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Message" }, "example": { "message": "Constructor not found" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Service Unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Message" }, "example": { "message": "Service unavailable" } } } } } } }, "/drivers": { "get": { "tags": [ "Drivers" ], "summary": "Get Drivers", "operationId": "get_drivers", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Drivers" }, "example": { "timestamp": 1669984067.7710564, "drivers": [ { "driverId": "albon", "url": "https://en.wikipedia.org/wiki/Alexander_Albon", "givenName": "Alexander", "familyName": "Albon", "dateOfBirth": "1996-03-23", "nationality": "Thai", "permanentNumber": 23, "code": "ALB" }, { "driverId": "alonso", "url": "https://en.wikipedia.org/wiki/Fernando_Alonso", "givenName": "Fernando", "familyName": "Alonso", "dateOfBirth": "1981-07-29", "nationality": "Spanish", "permanentNumber": 14, "code": "ALO" }, { "driverId": "bottas", "url": "https://en.wikipedia.org/wiki/Valtteri_Bottas", "givenName": "Valtteri", "familyName": "Bottas", "dateOfBirth": "1989-08-28", "nationality": "Finnish", "permanentNumber": 77, "code": "BOT" }, { "driverId": "de_vries", "url": "https://en.wikipedia.org/wiki/Nyck_de_Vries", "givenName": "Nyck", "familyName": "de Vries", "dateOfBirth": "1995-02-06", "nationality": "Dutch", "permanentNumber": 45, "code": "DEV" }, { "driverId": "gasly", "url": "https://en.wikipedia.org/wiki/Pierre_Gasly", "givenName": "Pierre", "familyName": "Gasly", "dateOfBirth": "1996-02-07", "nationality": "French", "permanentNumber": 10, "code": "GAS" } ] } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Message" }, "example": { "message": "Drivers not found" } } } }, "503": { "description": "Service Unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Message" }, "example": { "message": "Service unavailable" } } } } } } }, "/drivers/{season}": { "get": { "tags": [ "Drivers", "Season" ], "summary": "Get Drivers By Season", "operationId": "get_drivers_by_season", "parameters": [ { "required": true, "schema": { "title": "Season", "type": "integer" }, "name": "season", "in": "path" } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Drivers" }, "example": { "timestamp": 1669984067.7710564, "drivers": [ { "driverId": "albon", "url": "https://en.wikipedia.org/wiki/Alexander_Albon", "givenName": "Alexander", "familyName": "Albon", "dateOfBirth": "1996-03-23", "nationality": "Thai", "permanentNumber": 23, "code": "ALB" }, { "driverId": "alonso", "url": "https://en.wikipedia.org/wiki/Fernando_Alonso", "givenName": "Fernando", "familyName": "Alonso", "dateOfBirth": "1981-07-29", "nationality": "Spanish", "permanentNumber": 14, "code": "ALO" }, { "driverId": "bottas", "url": "https://en.wikipedia.org/wiki/Valtteri_Bottas", "givenName": "Valtteri", "familyName": "Bottas", "dateOfBirth": "1989-08-28", "nationality": "Finnish", "permanentNumber": 77, "code": "BOT" }, { "driverId": "de_vries", "url": "https://en.wikipedia.org/wiki/Nyck_de_Vries", "givenName": "Nyck", "familyName": "de Vries", "dateOfBirth": "1995-02-06", "nationality": "Dutch", "permanentNumber": 45, "code": "DEV" }, { "driverId": "gasly", "url": "https://en.wikipedia.org/wiki/Pierre_Gasly", "givenName": "Pierre", "familyName": "Gasly", "dateOfBirth": "1996-02-07", "nationality": "French", "permanentNumber": 10, "code": "GAS" } ] } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Message" }, "example": { "message": "Drivers not found" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Service Unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Message" }, "example": { "message": "Service unavailable" } } } } } } }, "/driver/{driver_id}": { "get": { "tags": [ "Drivers" ], "summary": "Get Driver By Id", "operationId": "get_driver_by_id", "parameters": [ { "required": true, "schema": { "title": "Driver Id", "type": "string" }, "name": "driver_id", "in": "path" } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Driver" }, "example": { "timestamp": 1669978482.9627361, "driverId": "max_verstappen", "url": "https://en.wikipedia.org/wiki/Max_Verstappen", "givenName": "Max", "familyName": "Verstappen", "dateOfBirth": "1997-09-30", "nationality": "Dutch", "permanentNumber": 33, "code": "VER" } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Message" }, "example": { "message": "Driver not found" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Service Unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Message" }, "example": { "message": "Service unavailable" } } } } } } }, "/results/race/{season}/{race}": { "get": { "tags": [ "Results" ], "summary": "Get Race Results", "operationId": "get_race_results", "parameters": [ { "required": true, "schema": { "title": "Season", "type": "integer" }, "name": "season", "in": "path" }, { "required": true, "schema": { "title": "Race", "type": "integer" }, "name": "race", "in": "path" } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RaceResults" }, "example": { "timestamp": 1669983525.3542814, "results": [ { "number": 1, "position": 1, "positionText": "1", "points": 25, "Driver": { "driverId": "max_verstappen", "url": "https://en.wikipedia.org/wiki/Max_Verstappen", "givenName": "Max", "familyName": "Verstappen", "dateOfBirth": "1997-09-30", "nationality": "Dutch", "permanentNumber": 33, "code": "VER" }, "Constructor": { "constructorId": "red_bull", "url": "https://en.wikipedia.org/wiki/Red_Bull_Racing", "name": "Red Bull", "nationality": "Austrian" }, "grid": 1, "laps": 58, "status": "Finished", "Time": { "time": "1:27:45.914", "millis": "5265914" }, "FastestLap": { "rank": 6, "lap": 54, "Time": { "time": "1:29.392" }, "AverageSpeed": { "units": "kph", "speed": 212.676 } } }, { "number": 16, "position": 2, "positionText": "2", "points": 18, "Driver": { "driverId": "leclerc", "url": "https://en.wikipedia.org/wiki/Charles_Leclerc", "givenName": "Charles", "familyName": "Leclerc", "dateOfBirth": "1997-10-16", "nationality": "Monegasque", "permanentNumber": 16, "code": "LEC" }, "Constructor": { "constructorId": "ferrari", "url": "https://en.wikipedia.org/wiki/Scuderia_Ferrari", "name": "Ferrari", "nationality": "Italian" }, "grid": 3, "laps": 58, "status": "Finished", "Time": { "time": "+8.771", "millis": "5274685" }, "FastestLap": { "rank": 10, "lap": 48, "Time": { "time": "1:29.719" }, "AverageSpeed": { "units": "kph", "speed": 211.901 } } }, { "number": 11, "position": 3, "positionText": "3", "points": 15, "Driver": { "driverId": "perez", "url": "https://en.wikipedia.org/wiki/Sergio_P%C3%A9rez", "givenName": "Sergio", "familyName": "Pérez", "dateOfBirth": "1990-01-26", "nationality": "Mexican", "permanentNumber": 11, "code": "PER" }, "Constructor": { "constructorId": "red_bull", "url": "https://en.wikipedia.org/wiki/Red_Bull_Racing", "name": "Red Bull", "nationality": "Austrian" }, "grid": 2, "laps": 58, "status": "Finished", "Time": { "time": "+10.093", "millis": "5276007" }, "FastestLap": { "rank": 4, "lap": 52, "Time": { "time": "1:28.972" }, "AverageSpeed": { "units": "kph", "speed": 213.68 } } }, { "number": 55, "position": 4, "positionText": "4", "points": 12, "Driver": { "driverId": "sainz", "url": "https://en.wikipedia.org/wiki/Carlos_Sainz_Jr.", "givenName": "Carlos", "familyName": "Sainz", "dateOfBirth": "1994-09-01", "nationality": "Spanish", "permanentNumber": 55, "code": "SAI" }, "Constructor": { "constructorId": "ferrari", "url": "https://en.wikipedia.org/wiki/Scuderia_Ferrari", "name": "Ferrari", "nationality": "Italian" }, "grid": 4, "laps": 58, "status": "Finished", "Time": { "time": "+24.892", "millis": "5290806" }, "FastestLap": { "rank": 3, "lap": 50, "Time": { "time": "1:28.879" }, "AverageSpeed": { "units": "kph", "speed": 213.904 } } }, { "number": 63, "position": 5, "positionText": "5", "points": 10, "Driver": { "driverId": "russell", "url": "https://en.wikipedia.org/wiki/George_Russell_%28racing_driver%29", "givenName": "George", "familyName": "Russell", "dateOfBirth": "1998-02-15", "nationality": "British", "permanentNumber": 63, "code": "RUS" }, "Constructor": { "constructorId": "mercedes", "url": "https://en.wikipedia.org/wiki/Mercedes-Benz_in_Formula_One", "name": "Mercedes", "nationality": "German" }, "grid": 6, "laps": 58, "status": "Finished", "Time": { "time": "+35.888", "millis": "5301802" }, "FastestLap": { "rank": 2, "lap": 48, "Time": { "time": "1:28.836" }, "AverageSpeed": { "units": "kph", "speed": 214.007 } } }, { "number": 4, "position": 6, "positionText": "6", "points": 9, "Driver": { "driverId": "norris", "url": "https://en.wikipedia.org/wiki/Lando_Norris", "givenName": "Lando", "familyName": "Norris", "dateOfBirth": "1999-11-13", "nationality": "British", "permanentNumber": 4, "code": "NOR" }, "Constructor": { "constructorId": "mclaren", "url": "https://en.wikipedia.org/wiki/McLaren", "name": "McLaren", "nationality": "British" }, "grid": 7, "laps": 58, "status": "Finished", "Time": { "time": "+56.234", "millis": "5322148" }, "FastestLap": { "rank": 1, "lap": 44, "Time": { "time": "1:28.391" }, "AverageSpeed": { "units": "kph", "speed": 215.085 } } } ] } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Message" }, "example": { "message": "Race results not found" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Service Unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Message" }, "example": { "message": "Service unavailable" } } } } } } }, "/results/qualifying/{season}/{race}": { "get": { "tags": [ "Results" ], "summary": "Get Qualifying Results", "operationId": "get_qualifying_results", "parameters": [ { "required": true, "schema": { "title": "Season", "type": "integer" }, "name": "season", "in": "path" }, { "required": true, "schema": { "title": "Race", "type": "integer" }, "name": "race", "in": "path" } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/QualifyingResults" }, "example": { "timestamp": 1669984487.606552, "results": [ { "number": 1, "position": 1, "Driver": { "driverId": "max_verstappen", "url": "https://en.wikipedia.org/wiki/Max_Verstappen", "givenName": "Max", "familyName": "Verstappen", "dateOfBirth": "1997-09-30", "nationality": "Dutch", "permanentNumber": 33, "code": "VER" }, "Constructor": { "constructorId": "red_bull", "url": "https://en.wikipedia.org/wiki/Red_Bull_Racing", "name": "Red Bull", "nationality": "Austrian" }, "Q1": "1:24.754", "Q2": "1:24.622", "Q3": "1:23.824" }, { "number": 11, "position": 2, "Driver": { "driverId": "perez", "url": "https://en.wikipedia.org/wiki/Sergio_P%C3%A9rez", "givenName": "Sergio", "familyName": "Pérez", "dateOfBirth": "1990-01-26", "nationality": "Mexican", "permanentNumber": 11, "code": "PER" }, "Constructor": { "constructorId": "red_bull", "url": "https://en.wikipedia.org/wiki/Red_Bull_Racing", "name": "Red Bull", "nationality": "Austrian" }, "Q1": "1:24.820", "Q2": "1:24.419", "Q3": "1:24.052" }, { "number": 16, "position": 3, "Driver": { "driverId": "leclerc", "url": "https://en.wikipedia.org/wiki/Charles_Leclerc", "givenName": "Charles", "familyName": "Leclerc", "dateOfBirth": "1997-10-16", "nationality": "Monegasque", "permanentNumber": 16, "code": "LEC" }, "Constructor": { "constructorId": "ferrari", "url": "https://en.wikipedia.org/wiki/Scuderia_Ferrari", "name": "Ferrari", "nationality": "Italian" }, "Q1": "1:25.211", "Q2": "1:24.517", "Q3": "1:24.092" }, { "number": 55, "position": 4, "Driver": { "driverId": "sainz", "url": "https://en.wikipedia.org/wiki/Carlos_Sainz_Jr.", "givenName": "Carlos", "familyName": "Sainz", "dateOfBirth": "1994-09-01", "nationality": "Spanish", "permanentNumber": 55, "code": "SAI" }, "Constructor": { "constructorId": "ferrari", "url": "https://en.wikipedia.org/wiki/Scuderia_Ferrari", "name": "Ferrari", "nationality": "Italian" }, "Q1": "1:25.090", "Q2": "1:24.521", "Q3": "1:24.242" }, { "number": 44, "position": 5, "Driver": { "driverId": "hamilton", "url": "https://en.wikipedia.org/wiki/Lewis_Hamilton", "givenName": "Lewis", "familyName": "Hamilton", "dateOfBirth": "1985-01-07", "nationality": "British", "permanentNumber": 44, "code": "HAM" }, "Constructor": { "constructorId": "mercedes", "url": "https://en.wikipedia.org/wiki/Mercedes-Benz_in_Formula_One", "name": "Mercedes", "nationality": "German" }, "Q1": "1:25.594", "Q2": "1:24.774", "Q3": "1:24.508" } ] } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Message" }, "example": { "message": "Qualifying results not found" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Service Unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Message" }, "example": { "message": "Service unavailable" } } } } } } }, "/results/standings/drivers/{season}": { "get": { "tags": [ "Results", "Season" ], "summary": "Get Driver Standings By Season", "operationId": "get_driver_standings_by_season", "parameters": [ { "required": true, "schema": { "title": "Season", "type": "integer" }, "name": "season", "in": "path" } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DriverStandings" }, "example": { "timestamp": 1669984278.61889, "standings": [ { "position": 1, "positionText": "1", "points": 454, "wins": 15, "Driver": { "driverId": "max_verstappen", "url": "https://en.wikipedia.org/wiki/Max_Verstappen", "givenName": "Max", "familyName": "Verstappen", "dateOfBirth": "1997-09-30", "nationality": "Dutch", "permanentNumber": 33, "code": "VER" }, "Constructors": [ { "constructorId": "red_bull", "url": "https://en.wikipedia.org/wiki/Red_Bull_Racing", "name": "Red Bull", "nationality": "Austrian" } ] }, { "position": 2, "positionText": "2", "points": 308, "wins": 3, "Driver": { "driverId": "leclerc", "url": "https://en.wikipedia.org/wiki/Charles_Leclerc", "givenName": "Charles", "familyName": "Leclerc", "dateOfBirth": "1997-10-16", "nationality": "Monegasque", "permanentNumber": 16, "code": "LEC" }, "Constructors": [ { "constructorId": "ferrari", "url": "https://en.wikipedia.org/wiki/Scuderia_Ferrari", "name": "Ferrari", "nationality": "Italian" } ] }, { "position": 3, "positionText": "3", "points": 305, "wins": 2, "Driver": { "driverId": "perez", "url": "https://en.wikipedia.org/wiki/Sergio_P%C3%A9rez", "givenName": "Sergio", "familyName": "Pérez", "dateOfBirth": "1990-01-26", "nationality": "Mexican", "permanentNumber": 11, "code": "PER" }, "Constructors": [ { "constructorId": "red_bull", "url": "https://en.wikipedia.org/wiki/Red_Bull_Racing", "name": "Red Bull", "nationality": "Austrian" } ] }, { "position": 4, "positionText": "4", "points": 275, "wins": 1, "Driver": { "driverId": "russell", "url": "https://en.wikipedia.org/wiki/George_Russell_%28racing_driver%29", "givenName": "George", "familyName": "Russell", "dateOfBirth": "1998-02-15", "nationality": "British", "permanentNumber": 63, "code": "RUS" }, "Constructors": [ { "constructorId": "mercedes", "url": "https://en.wikipedia.org/wiki/Mercedes-Benz_in_Formula_One", "name": "Mercedes", "nationality": "German" } ] }, { "position": 5, "positionText": "5", "points": 246, "wins": 1, "Driver": { "driverId": "sainz", "url": "https://en.wikipedia.org/wiki/Carlos_Sainz_Jr.", "givenName": "Carlos", "familyName": "Sainz", "dateOfBirth": "1994-09-01", "nationality": "Spanish", "permanentNumber": 55, "code": "SAI" }, "Constructors": [ { "constructorId": "ferrari", "url": "https://en.wikipedia.org/wiki/Scuderia_Ferrari", "name": "Ferrari", "nationality": "Italian" } ] } ] } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Message" }, "example": { "message": "Standings not found" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Service Unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Message" }, "example": { "message": "Service unavailable" } } } } } } }, "/results/standings/constructors/{season}": { "get": { "tags": [ "Results", "Season" ], "summary": "Get Constructor Standings By Season", "operationId": "get_constructor_standings_by_season", "parameters": [ { "required": true, "schema": { "title": "Season", "type": "integer" }, "name": "season", "in": "path" } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ConstructorStandings" }, "example": { "timestamp": 1669984250.8745742, "standings": [ { "position": 1, "positionText": "1", "points": 759, "wins": 17, "Constructor": { "constructorId": "red_bull", "url": "https://en.wikipedia.org/wiki/Red_Bull_Racing", "name": "Red Bull", "nationality": "Austrian" } }, { "position": 2, "positionText": "2", "points": 554, "wins": 4, "Constructor": { "constructorId": "ferrari", "url": "https://en.wikipedia.org/wiki/Scuderia_Ferrari", "name": "Ferrari", "nationality": "Italian" } }, { "position": 3, "positionText": "3", "points": 515, "wins": 1, "Constructor": { "constructorId": "mercedes", "url": "https://en.wikipedia.org/wiki/Mercedes-Benz_in_Formula_One", "name": "Mercedes", "nationality": "German" } }, { "position": 4, "positionText": "4", "points": 173, "wins": 0, "Constructor": { "constructorId": "alpine", "url": "https://en.wikipedia.org/wiki/Alpine_F1_Team", "name": "Alpine F1 Team", "nationality": "French" } }, { "position": 5, "positionText": "5", "points": 159, "wins": 0, "Constructor": { "constructorId": "mclaren", "url": "https://en.wikipedia.org/wiki/McLaren", "name": "McLaren", "nationality": "British" } } ] } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Message" }, "example": { "message": "Standings not found" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Service Unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Message" }, "example": { "message": "Service unavailable" } } } } } } }, "/test": { "get": { "summary": "Test", "operationId": "test", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } } } } } }, "components": { "schemas": { "AverageSpeed": { "title": "AverageSpeed", "required": [ "units", "speed" ], "type": "object", "properties": { "units": { "title": "Units", "type": "string" }, "speed": { "title": "Speed", "type": "number" } } }, "Calendar": { "title": "Calendar", "required": [ "events" ], "type": "object", "properties": { "timestamp": { "title": "Timestamp", "type": "number" }, "events": { "title": "Events", "type": "array", "items": { "$ref": "#/components/schemas/Event" } } } }, "Circuit": { "title": "Circuit", "required": [ "circuitId", "url", "circuitName", "Location" ], "type": "object", "properties": { "timestamp": { "title": "Timestamp", "type": "number" }, "circuitId": { "title": "Circuitid", "type": "string" }, "url": { "title": "Url", "type": "string" }, "circuitName": { "title": "Circuitname", "type": "string" }, "Location": { "$ref": "#/components/schemas/Location" } } }, "Circuits": { "title": "Circuits", "required": [ "circuits" ], "type": "object", "properties": { "timestamp": { "title": "Timestamp", "type": "number" }, "circuits": { "title": "Circuits", "type": "array", "items": { "$ref": "#/components/schemas/Circuit" } } } }, "Constructor": { "title": "Constructor", "required": [ "constructorId", "url", "name", "nationality" ], "type": "object", "properties": { "timestamp": { "title": "Timestamp", "type": "number" }, "constructorId": { "title": "Constructorid", "type": "string" }, "url": { "title": "Url", "type": "string" }, "name": { "title": "Name", "type": "string" }, "nationality": { "title": "Nationality", "type": "string" } } }, "ConstructorStanding": { "title": "ConstructorStanding", "required": [ "position", "positionText", "points", "wins", "Constructor" ], "type": "object", "properties": { "timestamp": { "title": "Timestamp", "type": "number" }, "position": { "title": "Position", "type": "integer" }, "positionText": { "title": "Positiontext", "type": "string" }, "points": { "title": "Points", "type": "integer" }, "wins": { "title": "Wins", "type": "integer" }, "Constructor": { "$ref": "#/components/schemas/Constructor" } } }, "ConstructorStandings": { "title": "ConstructorStandings", "required": [ "standings" ], "type": "object", "properties": { "timestamp": { "title": "Timestamp", "type": "number" }, "standings": { "title": "Standings", "type": "array", "items": { "$ref": "#/components/schemas/ConstructorStanding" } } } }, "Constructors": { "title": "Constructors", "required": [ "constructors" ], "type": "object", "properties": { "timestamp": { "title": "Timestamp", "type": "number" }, "constructors": { "title": "Constructors", "type": "array", "items": { "$ref": "#/components/schemas/Constructor" } } } }, "Driver": { "title": "Driver", "required": [ "driverId", "url", "givenName", "familyName", "dateOfBirth", "nationality" ], "type": "object", "properties": { "timestamp": { "title": "Timestamp", "type": "number" }, "driverId": { "title": "Driverid", "type": "string" }, "url": { "title": "Url", "type": "string" }, "givenName": { "title": "Givenname", "type": "string" }, "familyName": { "title": "Familyname", "type": "string" }, "dateOfBirth": { "title": "Dateofbirth", "type": "string" }, "nationality": { "title": "Nationality", "type": "string" }, "permanentNumber": { "title": "Permanentnumber", "type": "integer" }, "code": { "title": "Code", "type": "string" } } }, "DriverStanding": { "title": "DriverStanding", "required": [ "position", "positionText", "points", "wins", "Driver", "Constructors" ], "type": "object", "properties": { "timestamp": { "title": "Timestamp", "type": "number" }, "position": { "title": "Position", "type": "integer" }, "positionText": { "title": "Positiontext", "type": "string" }, "points": { "title": "Points", "type": "integer" }, "wins": { "title": "Wins", "type": "integer" }, "Driver": { "$ref": "#/components/schemas/Driver" }, "Constructors": { "title": "Constructors", "type": "array", "items": { "$ref": "#/components/schemas/Constructor" } } } }, "DriverStandings": { "title": "DriverStandings", "required": [ "standings" ], "type": "object", "properties": { "timestamp": { "title": "Timestamp", "type": "number" }, "standings": { "title": "Standings", "type": "array", "items": { "$ref": "#/components/schemas/DriverStanding" } } } }, "Drivers": { "title": "Drivers", "required": [ "drivers" ], "type": "object", "properties": { "timestamp": { "title": "Timestamp", "type": "number" }, "drivers": { "title": "Drivers", "type": "array", "items": { "$ref": "#/components/schemas/Driver" } } } }, "Event": { "title": "Event", "required": [ "season", "round", "url", "raceName", "Circuit", "date" ], "type": "object", "properties": { "timestamp": { "title": "Timestamp", "type": "number" }, "season": { "title": "Season", "type": "integer" }, "round": { "title": "Round", "type": "integer" }, "url": { "title": "Url", "type": "string" }, "raceName": { "title": "Racename", "type": "string" }, "Circuit": { "$ref": "#/components/schemas/Circuit" }, "date": { "title": "Date", "type": "string" }, "time": { "title": "Time", "type": "string" }, "FirstPractice": { "$ref": "#/components/schemas/Session" }, "SecondPractice": { "$ref": "#/components/schemas/Session" }, "ThirdPractice": { "$ref": "#/components/schemas/Session" }, "Qualifying": { "$ref": "#/components/schemas/Session" } } }, "FastestLap": { "title": "FastestLap", "required": [ "rank", "lap", "Time", "AverageSpeed" ], "type": "object", "properties": { "rank": { "title": "Rank", "type": "integer" }, "lap": { "title": "Lap", "type": "integer" }, "Time": { "$ref": "#/components/schemas/Time" }, "AverageSpeed": { "$ref": "#/components/schemas/AverageSpeed" } } }, "HTTPValidationError": { "title": "HTTPValidationError", "type": "object", "properties": { "detail": { "title": "Detail", "type": "array", "items": { "$ref": "#/components/schemas/ValidationError" } } } }, "Location": { "title": "Location", "required": [ "lat", "long", "locality", "country" ], "type": "object", "properties": { "lat": { "title": "Lat", "type": "number" }, "long": { "title": "Long", "type": "number" }, "locality": { "title": "Locality", "type": "string" }, "country": { "title": "Country", "type": "string" } } }, "Message": { "title": "Message", "required": [ "message" ], "type": "object", "properties": { "message": { "title": "Message", "type": "string" } } }, "NextEvent": { "title": "NextEvent", "required": [ "season", "round" ], "type": "object", "properties": { "timestamp": { "title": "Timestamp", "type": "number" }, "season": { "title": "Season", "type": "integer" }, "round": { "title": "Round", "type": "integer" } } }, "QualifyingResult": { "title": "QualifyingResult", "required": [ "number", "position", "Driver", "Constructor" ], "type": "object", "properties": { "timestamp": { "title": "Timestamp", "type": "number" }, "number": { "title": "Number", "type": "integer" }, "position": { "title": "Position", "type": "integer" }, "Driver": { "$ref": "#/components/schemas/Driver" }, "Constructor": { "$ref": "#/components/schemas/Constructor" }, "Q1": { "title": "Q1", "type": "string" }, "Q2": { "title": "Q2", "type": "string" }, "Q3": { "title": "Q3", "type": "string" } } }, "QualifyingResults": { "title": "QualifyingResults", "required": [ "results" ], "type": "object", "properties": { "timestamp": { "title": "Timestamp", "type": "number" }, "results": { "title": "Results", "type": "array", "items": { "$ref": "#/components/schemas/QualifyingResult" } } } }, "RaceResult": { "title": "RaceResult", "required": [ "number", "position", "positionText", "points", "Driver", "Constructor", "grid", "laps", "status" ], "type": "object", "properties": { "timestamp": { "title": "Timestamp", "type": "number" }, "number": { "title": "Number", "type": "integer" }, "position": { "title": "Position", "type": "integer" }, "positionText": { "title": "Positiontext", "type": "string" }, "points": { "title": "Points", "type": "number" }, "Driver": { "$ref": "#/components/schemas/Driver" }, "Constructor": { "$ref": "#/components/schemas/Constructor" }, "grid": { "title": "Grid", "type": "integer" }, "laps": { "title": "Laps", "type": "integer" }, "status": { "title": "Status", "type": "string" }, "Time": { "$ref": "#/components/schemas/Time" }, "FastestLap": { "$ref": "#/components/schemas/FastestLap" } } }, "RaceResults": { "title": "RaceResults", "required": [ "results" ], "type": "object", "properties": { "timestamp": { "title": "Timestamp", "type": "number" }, "results": { "title": "Results", "type": "array", "items": { "$ref": "#/components/schemas/RaceResult" } } } }, "Session": { "title": "Session", "type": "object", "properties": { "date": { "title": "Date", "type": "string" }, "time": { "title": "Time", "type": "string" } } }, "Time": { "title": "Time", "required": [ "time" ], "type": "object", "properties": { "time": { "title": "Time", "type": "string" }, "millis": { "title": "Millis", "type": "string" } } }, "ValidationError": { "title": "ValidationError", "required": [ "loc", "msg", "type" ], "type": "object", "properties": { "loc": { "title": "Location", "type": "array", "items": { "anyOf": [ { "type": "string" }, { "type": "integer" } ] } }, "msg": { "title": "Message", "type": "string" }, "type": { "title": "Error Type", "type": "string" } } } } } }