### Server Startup - Bash Source: https://context7.com/race-tech/f1-api/llms.txt Example bash command to start the F1 API server using a configuration file. ```bash node server.js --config config.yml ``` -------------------------------- ### F1 API Configuration Example (YAML) Source: https://github.com/race-tech/f1-api/blob/master/README.md This snippet demonstrates the structure of the `config.yaml` file used to configure the F1 API. It specifies network ports, database connection details, and middleware settings like GraphiQL enablement. The configuration file location can be overridden by the `F1_API_CONFIG` environment variable. ```yaml port: 8000 database: name: f1db hostname: database port: 3306 user: user password: password middlewares: - graphiql: enabled: true route: / ``` -------------------------------- ### Docker Compose for F1 API Development Source: https://context7.com/race-tech/f1-api/llms.txt Starts the F1 API and its dependencies using Docker Compose. This command builds the necessary images and runs the containers in detached mode. Ensure the `docker-compose.dev.yml` file is present in the project root. The API will be accessible at `http://localhost:8000`. ```bash docker-compose -f docker-compose.dev.yml up -d --build ``` -------------------------------- ### Programmatic API Initialization in Rust Source: https://context7.com/race-tech/f1-api/llms.txt Initializes and serves the F1 API programmatically using Rust. This snippet shows how to set up the logger, load configuration from a YAML file (or default), and start the API server. It requires the `tokio`, `infrastructure`, `api_lib`, and `shared` crates. The configuration file location can be customized using the `F1_API_CONFIG` environment variable. ```rust // Programmatic API initialization in Rust use infrastructure::config::Config; use api_lib::Api; #[tokio::main] async fn main() -> shared::error::Result<()> { // Initialize logger logger::Logger::new() .init() .expect("cannot initialize the logger"); // Load configuration let config = Config::try_new()?; // Create and serve API Api::try_from(config)?.serve().await; Ok(()) } ``` -------------------------------- ### GraphQL Query - Get Constructor Standings Source: https://context7.com/race-tech/f1-api/llms.txt Query championship standings for constructors (teams) for a given season or after a specific round. This query allows filtering by year, round, and constructor reference, returning performance data for constructors. ```graphql # Get constructor standings for a season query { constructorsStandings( options: { year: 2023 } pagination: { page: 1, limit: 10 } ) { data { season round position positionText points wins constructor { constructorRef name nationality } } } } # Get constructor standings after a specific round query { constructorsStandings( options: { year: 2023, round: 15, constructorRef: "ferrari" } ) { data { position points wins constructor { name } } } } ``` -------------------------------- ### GraphQL Query - Retrieve Driver Standings Source: https://context7.com/race-tech/f1-api/llms.txt Query championship standings for drivers at specific rounds or end of season. This endpoint is described but no query example is provided in the input. ```APIDOC ## GraphQL Query - Retrieve Driver Standings ### Description Query championship standings for drivers at specific rounds or end of season. ### Method POST (GraphQL endpoint) ### Endpoint /graphql ### Parameters #### Query Parameters - **query** (String) - Required - The GraphQL query string. - **variables** (Object) - Optional - Variables for the query. #### Request Body (This is a GraphQL API, so the request is typically sent as a JSON payload in the body of a POST request) ```json { "query": "# Query driver standings for a specific season and round\nquery {\n driverStandings(season: 2023, round: 10) {\n driver {\n driverRef\n givenName\n familyName\n }\n position\n points\n wins\n }\n}" } ``` ### Request Example ```json { "query": "# Query driver standings for the end of a season\nquery {\n driverStandings(season: 2023) {\n driver {\n driverRef\n givenName\n familyName\n }\n position\n points\n wins\n }\n}" } ``` ### Response #### Success Response (200) - **data** (Object) - Contains the query results. - **driverStandings** (Array) - List of driver standings. - **driver** (Object) - Information about the driver. - **driverRef** (String) - Unique reference for the driver. - **givenName** (String) - The given name of the driver. - **familyName** (String) - The family name of the driver. - **position** (Int) - The driver's position in the standings. - **points** (Float) - The total points accumulated by the driver. - **wins** (Int) - The number of wins for the driver. #### Response Example ```json { "data": { "driverStandings": [ { "driver": { "driverRef": "verstappen", "givenName": "Max", "familyName": "Verstappen" }, "position": 1, "points": 300.0, "wins": 10 } ] } } ``` ``` -------------------------------- ### GraphQL Query - Get Driver Standings Source: https://context7.com/race-tech/f1-api/llms.txt Retrieve current season driver standings or standings after a specific round. This query requires the year and optionally the round number. It returns driver and constructor details along with their season performance metrics. ```graphql # Get current season driver standings query { driversStandings( options: { year: 2023 } pagination: { page: 1, limit: 10 } ) { data { season round position positionText points wins driver { driverRef givenName familyName permanentNumber } constructors { constructorRef name } } } } # Get driver standings after a specific round query { driversStandings( options: { year: 2023, round: 10 } ) { data { position points wins driver { familyName givenName } } } } ``` -------------------------------- ### GraphQL Query - Retrieve Pit Stop Data Source: https://context7.com/race-tech/f1-api/llms.txt Access pit stop information including duration and timing for races. You can query pit stops for a specific race or filter further to get pit stops for a particular driver within a race. ```graphql # Get pit stops for a specific race query { pitStops( options: { year: 2023, round: 8 } pagination: { page: 1, limit: 50 } ) { race { year round raceName } pitStops { driverRef stop lap time duration } } } # Get pit stops for a specific driver in a race query { pitStops( options: { year: 2023, round: 8, driverRef: "hamilton" } ) { pitStops { stop lap time duration } } } ``` -------------------------------- ### Server Configuration - YAML Source: https://context7.com/race-tech/f1-api/llms.txt Configure and run the F1 API server with database connection and middleware settings. This YAML file defines the server port, database connection details, and enables GraphQL introspection. ```yaml # config.yml port: 8000 database: name: f1db hostname: database port: 3306 user: user password: password middlewares: - graphiql: enabled: true route: / ``` -------------------------------- ### Server Configuration Source: https://context7.com/race-tech/f1-api/llms.txt Configuration settings for running the F1 API server, including port, database connection details, and middleware enablement. ```APIDOC ## Server Configuration and Startup ### Description Configure and run the F1 API server with database connection and middleware settings. ### Method N/A (Configuration File) ### Endpoint N/A ### Parameters N/A ### Request Example (config.yml) ```yaml port: 8000 database: name: f1db hostname: database port: 3306 user: user password: password middlewares: - graphiql: enabled: true route: / ``` ### Response N/A (Server startup based on configuration) #### Server Startup Command Example ```bash node server.js --config config.yml ``` ``` -------------------------------- ### GraphQL Query - Retrieve Constructor Information Source: https://context7.com/race-tech/f1-api/llms.txt Access constructor (team) data from the F1 API. Supports querying individual constructors by reference or fetching lists of constructors for a specific season, with options for filtering by driver. ```graphql # Query a single constructor query { constructor(constructorRef: "ferrari") { constructorRef name nationality url } } # Query constructors for a specific season query { constructors( options: { year: 2023, driverRef: "leclerc" } pagination: { page: 1, limit: 30 } ) { data { constructorRef name nationality } pagination { page total } } } # Response { "data": { "constructors": { "data": [ { "constructorRef": "ferrari", "name": "Scuderia Ferrari", "nationality": "Italian" } ], "pagination": { "page": 1, "total": 1 } } } } ``` -------------------------------- ### GraphQL Query - Retrieve Constructor Information Source: https://context7.com/race-tech/f1-api/llms.txt Access constructor (team) data with support for historical queries and filtering. You can query individual constructors or lists of constructors for a specific season. ```APIDOC ## GraphQL Query - Retrieve Constructor Information ### Description Access constructor (team) data with support for historical queries and filtering. ### Method POST (GraphQL endpoint) ### Endpoint /graphql ### Parameters #### Query Parameters - **query** (String) - Required - The GraphQL query string. - **variables** (Object) - Optional - Variables for the query. #### Request Body (This is a GraphQL API, so the request is typically sent as a JSON payload in the body of a POST request) ```json { "query": "query { constructor(constructorRef: \"ferrari\") { constructorRef name nationality url } }" } ``` ### Request Example ```json { "query": "query { constructors(options: { year: 2023, driverRef: \"leclerc\" } pagination: { page: 1, limit: 30 }) { data { constructorRef name nationality } pagination { page total } } }" } ``` ### Response #### Success Response (200) - **data** (Object) - Contains the query results. - **constructors** (Object) - List of constructors matching the criteria. - **data** (Array) - Array of constructor objects. - **constructorRef** (String) - Unique reference for the constructor. - **name** (String) - The name of the constructor. - **nationality** (String) - The nationality of the constructor. - **pagination** (Object) - Pagination details. - **page** (Int) - The current page number. - **total** (Int) - The total number of records. #### Response Example ```json { "data": { "constructors": { "data": [ { "constructorRef": "ferrari", "name": "Scuderia Ferrari", "nationality": "Italian" } ], "pagination": { "page": 1, "total": 1 } } } } ``` ``` -------------------------------- ### GraphQL Query - Retrieve Season Information Source: https://context7.com/race-tech/f1-api/llms.txt Query supported seasons with filtering options based on driver, constructor, circuit, grid position, or race results. Supports pagination. ```APIDOC ## GraphQL Query - Retrieve Season Information ### Description Query supported seasons with filtering options based on driver, constructor, circuit, grid position, or race results. ### Method POST (GraphQL endpoint) ### Endpoint /graphql ### Parameters #### Query Parameters - **query** (String) - Required - The GraphQL query string. - **variables** (Object) - Optional - Variables for the query. #### Request Body (This is a GraphQL API, so the request is typically sent as a JSON payload in the body of a POST request) ```json { "query": "query { seasons(pagination: { page: 1, limit: 10 }) { data { season url } pagination { page maxPage total } } }" } ``` ### Request Example ```json { "query": "query { seasons(options: { driverRef: \"alonso\" } pagination: { page: 1, limit: 5 }) { data { season url } } }" } ``` ### Response #### Success Response (200) - **data** (Object) - Contains the query results. - **seasons** (Object) - List of seasons matching the criteria. - **data** (Array) - Array of season objects. - **season** (Int) - The year of the season. - **url** (String) - URL related to the season (e.g., Wikipedia). - **pagination** (Object) - Pagination details. - **page** (Int) - The current page number. - **maxPage** (Int) - The maximum available page number. - **total** (Int) - The total number of records. #### Response Example ```json { "data": { "seasons": { "data": [ { "season": 2023, "url": "http://en.wikipedia.org/wiki/2023_Formula_One_World_Championship" }, { "season": 2022, "url": "http://en.wikipedia.org/wiki/2022_Formula_One_World_Championship" } ] } } } ``` ``` -------------------------------- ### GraphQL Query - Retrieve Circuit Information Source: https://context7.com/race-tech/f1-api/llms.txt Access circuit (track) data, including location and reference information. You can query for a single circuit by its reference or retrieve a paginated list of all circuits for a specific year. ```graphql # Query a single circuit query { circuit(circuitRef: "monaco") { circuitRef circuitName location { locality country lat long } url } } # Query all circuits query { circuits( options: { year: 2023 } pagination: { page: 1, limit: 5 } ) { data { circuitRef circuitName location { locality country } } } } ``` -------------------------------- ### GraphQL Query - Retrieve Constructor Standings Source: https://context7.com/race-tech/f1-api/llms.txt Query championship standings for constructors (teams) throughout the season, with options for filtering and pagination. ```APIDOC ## GraphQL Query - Retrieve Constructor Standings ### Description Query championship standings for constructors (teams) throughout the season, with options for filtering and pagination. ### Method POST ### Endpoint /graphql ### Parameters #### Query Parameters - **query** (String) - Required - The GraphQL query string. ### Request Body ```graphql { constructorsStandings(options: { year: Int, round: Int, constructorRef: String }, pagination: { page: Int, limit: Int }) { data { season round position positionText points wins constructor { constructorRef name nationality } } } } ``` ### Request Example ```json { "query": "query { constructorsStandings(options: { year: 2023 }, pagination: { page: 1, limit: 10 }) { data { season round position points constructor { name } } } }" } ``` ### Response #### Success Response (200) - **data** (Object) - The response data containing constructor standings. - **constructorsStandings** (Object) - **data** (Array of Objects) - List of constructor standings entries. - **season** (Int) - The racing season year. - **round** (Int) - The race round number. - **position** (Int) - The constructor's position in the standings. - **positionText** (String) - The constructor's position as text. - **points** (Int) - The total points accumulated by the constructor. - **wins** (Int) - The number of race wins. - **constructor** (Object) - Information about the constructor. - **constructorRef** (String) - Unique reference for the constructor. - **name** (String) - The name of the constructor. - **nationality** (String) - The nationality of the constructor. #### Response Example ```json { "data": { "constructorsStandings": { "data": [ { "season": 2023, "round": 22, "position": 1, "positionText": "1", "points": 860, "wins": 21, "constructor": { "constructorRef": "red_bull", "name": "Red Bull Racing", "nationality": "Austrian" } } ] } } } ``` ``` -------------------------------- ### GraphQL Query - Retrieve Circuit Information Source: https://context7.com/race-tech/f1-api/llms.txt Access circuit (track) data including location and reference information. Allows querying for a single circuit by its reference or all circuits within a given year with pagination. ```APIDOC ## GraphQL Query - Retrieve Circuit Information ### Description Access circuit (track) data including location and reference information. Allows querying for a single circuit by its reference or all circuits within a given year with pagination. ### Method POST ### Endpoint /graphql ### Parameters #### Query Parameters - **query** (String) - Required - The GraphQL query string. ### Request Body ```graphql { circuit(circuitRef: String) { circuitRef circuitName location { locality country lat long } url } circuits(options: { year: Int }, pagination: { page: Int, limit: Int }) { data { circuitRef circuitName location { locality country } } } } ``` ### Request Example ```json { "query": "query { circuit(circuitRef: \"monaco\") { circuitRef circuitName location { country } } }" } ``` ### Response #### Success Response (200) - **data** (Object) - The response data containing circuit information. - **circuit** (Object, optional) - Information about a specific circuit. - **circuitRef** (String) - Unique reference for the circuit. - **circuitName** (String) - The full name of the circuit. - **location** (Object) - Geographic location of the circuit. - **locality** (String) - The city or town where the circuit is located. - **country** (String) - The country where the circuit is located. - **lat** (Float) - Latitude coordinate. - **long** (Float) - Longitude coordinate. - **url** (String) - URL to a Wikipedia page about the circuit. - **circuits** (Object, optional) - **data** (Array of Objects) - List of circuits matching the query. - **circuitRef** (String) - Unique reference for the circuit. - **circuitName** (String) - The full name of the circuit. - **location** (Object) - **locality** (String) - The city or town where the circuit is located. - **country** (String) - The country where the circuit is located. #### Response Example ```json { "data": { "circuit": { "circuitRef": "monaco", "circuitName": "Circuit de Monaco", "location": { "locality": "Monte-Carlo", "country": "Monaco", "lat": 43.7347, "long": 7.42056 }, "url": "http://en.wikipedia.org/wiki/Circuit_de_Monaco" } } } ``` ``` -------------------------------- ### GraphQL Query - Retrieve Driver Information Source: https://context7.com/race-tech/f1-api/llms.txt Query individual drivers or lists of drivers using the F1 API. Supports filtering by constructor and year, with pagination for large datasets. Requires a GraphQL client to interact with the API. ```graphql # Query a single driver by reference query { driver(driverRef: "hamilton") { driverRef givenName familyName dateOfBirth nationality permanentNumber code url } } # Query multiple drivers with pagination query { drivers( pagination: { page: 1, limit: 10 } options: { constructor: "mclaren", year: 2023 } ) { data { driverRef givenName familyName permanentNumber code nationality } pagination { page maxPage total } } } # Response { "data": { "drivers": { "data": [ { "driverRef": "piastri", "givenName": "Oscar", "familyName": "Piastri", "permanentNumber": 81, "code": "PIA", "nationality": "Australian" } ], "pagination": { "page": 1, "maxPage": 1, "total": 2 } } } } ``` -------------------------------- ### GraphQL Query - Retrieve Season Information Source: https://context7.com/race-tech/f1-api/llms.txt Query available Formula 1 seasons using the F1 API. Supports fetching all seasons with pagination or filtering seasons based on driver participation. Returns season year and related URL. ```graphql # Query all available seasons query { seasons(pagination: { page: 1, limit: 10 }) { data { season url } pagination { page maxPage total } } } # Query seasons where a specific driver competed query { seasons( options: { driverRef: "alonso" } pagination: { page: 1, limit: 5 } ) { data { season url } } } # Response { "data": { "seasons": { "data": [ { "season": 2023, "url": "http://en.wikipedia.org/wiki/2023_Formula_One_World_Championship" }, { "season": 2022, "url": "http://en.wikipedia.org/wiki/2022_Formula_One_World_Championship" } ] } } } ``` -------------------------------- ### GraphQL Query - Retrieve Lap Times Source: https://context7.com/race-tech/f1-api/llms.txt Query detailed lap timing data for specific races and drivers. This allows fetching lap times for a particular race and driver, or for an entire race, providing insights into lap performance. ```graphql # Get lap times for a specific race and driver query { lapTimes( options: { year: 2023, round: 5, driverRef: "verstappen" } pagination: { page: 1, limit: 10 } ) { race { year round raceName } laps { lapNumber timings { driverRef position time } } } } # Get lap times for entire race query { lapTimes( options: { year: 2023, round: 10 } pagination: { page: 1, limit: 20 } ) { race { raceName } laps { lapNumber timings { driverRef time position } } } } ``` -------------------------------- ### GraphQL Query - Retrieve Driver Information Source: https://context7.com/race-tech/f1-api/llms.txt Query individual drivers or lists of drivers with filtering and pagination support. You can fetch details like driverRef, givenName, familyName, dateOfBirth, nationality, permanentNumber, code, and url. ```APIDOC ## GraphQL Query - Retrieve Driver Information ### Description Query individual drivers or lists of drivers with filtering and pagination support. ### Method POST (GraphQL endpoint) ### Endpoint /graphql ### Parameters #### Query Parameters - **query** (String) - Required - The GraphQL query string. - **variables** (Object) - Optional - Variables for the query. #### Request Body (This is a GraphQL API, so the request is typically sent as a JSON payload in the body of a POST request) ```json { "query": "query { driver(driverRef: \"hamilton\") { driverRef givenName familyName dateOfBirth nationality permanentNumber code url } }" } ``` ### Request Example ```json { "query": "query { drivers(pagination: { page: 1, limit: 10 } options: { constructor: \"mclaren\", year: 2023 }) { data { driverRef givenName familyName permanentNumber code nationality } pagination { page maxPage total } } }" } ``` ### Response #### Success Response (200) - **data** (Object) - Contains the query results. - **drivers** (Object) - List of drivers matching the criteria. - **data** (Array) - Array of driver objects. - **driverRef** (String) - Unique reference for the driver. - **givenName** (String) - The given name of the driver. - **familyName** (String) - The family name of the driver. - **permanentNumber** (Int) - The permanent racing number of the driver. - **code** (String) - The three-letter driver code. - **nationality** (String) - The nationality of the driver. - **pagination** (Object) - Pagination details. - **page** (Int) - The current page number. - **maxPage** (Int) - The maximum available page number. - **total** (Int) - The total number of records. #### Response Example ```json { "data": { "drivers": { "data": [ { "driverRef": "piastri", "givenName": "Oscar", "familyName": "Piastri", "permanentNumber": 81, "code": "PIA", "nationality": "Australian" } ], "pagination": { "page": 1, "maxPage": 1, "total": 2 } } } } ``` ``` -------------------------------- ### GraphQL Query - Retrieve Lap Times Source: https://context7.com/race-tech/f1-api/llms.txt Query detailed lap timing data for specific races and drivers, or for an entire race. ```APIDOC ## GraphQL Query - Retrieve Lap Times ### Description Query detailed lap timing data for specific races and drivers, or for an entire race. ### Method POST ### Endpoint /graphql ### Parameters #### Query Parameters - **query** (String) - Required - The GraphQL query string. ### Request Body ```graphql { lapTimes(options: { year: Int, round: Int, driverRef: String }, pagination: { page: Int, limit: Int }) { race { year round raceName } laps { lapNumber timings { driverRef position time } } } } ``` ### Request Example ```json { "query": "query { lapTimes(options: { year: 2023, round: 5 }, pagination: { page: 1, limit: 10 }) { race { raceName } laps { lapNumber timings { driverRef time } } } }" } ``` ### Response #### Success Response (200) - **data** (Object) - The response data containing lap times. - **lapTimes** (Object) - **race** (Object) - Information about the race. - **year** (Int) - The racing season year. - **round** (Int) - The race round number. - **raceName** (String) - The name of the race. - **laps** (Array of Objects) - Details for each lap. - **lapNumber** (Int) - The number of the lap. - **timings** (Array of Objects) - Timing information for drivers in that lap. - **driverRef** (String) - Unique reference for the driver. - **position** (Int) - The driver's position during that lap. - **time** (String) - The driver's lap time in HH:MM:SS.ms format. #### Response Example ```json { "data": { "lapTimes": { "race": { "year": 2023, "round": 10, "raceName": "Belgian Grand Prix" }, "laps": [ { "lapNumber": 1, "timings": [ { "driverRef": "max_verstappen", "position": 1, "time": "1:47.775" }, { "driverRef": "leclerc", "position": 2, "time": "1:47.900" } ] } ] } } } ``` ``` -------------------------------- ### GraphQL Query - Retrieve Race Information Source: https://context7.com/race-tech/f1-api/llms.txt Access Formula 1 race data via the F1 API. Includes endpoints for the latest race, specific races by year and round, and filtering races by year and circuit. Returns details like race name, circuit, and date. ```graphql # Get the latest race query { latestRace { year round raceName circuit { circuitRef circuitName location { locality country } } date time } } # Get a specific race query { race(year: 2023, round: 5) { year round raceName circuit { circuitRef circuitName } date } } # Query races with filtering query { races( options: { year: 2023, circuitRef: "monza" } pagination: { page: 1, limit: 10 } ) { data { year round raceName date } } } # Response { "data": { "race": { "year": 2023, "round": 5, "raceName": "Miami Grand Prix", "circuit": { "circuitRef": "miami", "circuitName": "Miami International Autodrome" }, "date": "2023-05-07" } } } ``` -------------------------------- ### GraphQL Query - Retrieve Pit Stop Data Source: https://context7.com/race-tech/f1-api/llms.txt Access pit stop information including duration and timing for races, with options to filter by specific drivers. ```APIDOC ## GraphQL Query - Retrieve Pit Stop Data ### Description Access pit stop information including duration and timing for races, with options to filter by specific drivers. ### Method POST ### Endpoint /graphql ### Parameters #### Query Parameters - **query** (String) - Required - The GraphQL query string. ### Request Body ```graphql { pitStops(options: { year: Int, round: Int, driverRef: String }, pagination: { page: Int, limit: Int }) { race { year round raceName } pitStops { driverRef stop lap time duration } } } ``` ### Request Example ```json { "query": "query { pitStops(options: { year: 2023, round: 8 }, pagination: { page: 1, limit: 50 }) { race { raceName } pitStops { driverRef stop time duration } } }" } ``` ### Response #### Success Response (200) - **data** (Object) - The response data containing pit stop information. - **pitStops** (Object) - **race** (Object) - Information about the race. - **year** (Int) - The racing season year. - **round** (Int) - The race round number. - **raceName** (String) - The name of the race. - **pitStops** (Array of Objects) - List of pit stop entries. - **driverRef** (String) - Unique reference for the driver. - **stop** (Int) - The pit stop number (e.g., 1 for the first stop). - **lap** (Int) - The lap number during which the pit stop occurred. - **time** (String) - The time of the pit stop in HH:MM:SS.ms format. - **duration** (String) - The duration of the pit stop in seconds. #### Response Example ```json { "data": { "pitStops": { "race": { "year": 2023, "round": 8, "raceName": "Spanish Grand Prix" }, "pitStops": [ { "driverRef": "max_verstappen", "stop": 1, "lap": 15, "time": "13:45:10.123", "duration": "2.5" }, { "driverRef": "leclerc", "stop": 1, "lap": 17, "time": "13:47:05.456", "duration": "2.8" } ] } } } ``` ``` -------------------------------- ### GraphQL Query - Retrieve Driver Standings Source: https://context7.com/race-tech/f1-api/llms.txt Query championship standings for drivers for a given year, with options for pagination and filtering by round. ```APIDOC ## GraphQL Query - Retrieve Driver Standings ### Description Query championship standings for drivers for a given year, with options for pagination and filtering by round. ### Method POST ### Endpoint /graphql ### Parameters #### Query Parameters - **query** (String) - Required - The GraphQL query string. ### Request Body ```graphql { driversStandings(options: { year: Int, round: Int }, pagination: { page: Int, limit: Int }) { data { season round position positionText points wins driver { driverRef givenName familyName permanentNumber } constructors { constructorRef name } } } } ``` ### Request Example ```json { "query": "query { driversStandings(options: { year: 2023 }, pagination: { page: 1, limit: 10 }) { data { season round position points driver { givenName familyName } } } }" } ``` ### Response #### Success Response (200) - **data** (Object) - The response data containing driver standings. - **driversStandings** (Object) - **data** (Array of Objects) - List of driver standings entries. - **season** (Int) - The racing season year. - **round** (Int) - The race round number. - **position** (Int) - The driver's position in the standings. - **positionText** (String) - The driver's position as text. - **points** (Int) - The total points accumulated by the driver. - **wins** (Int) - The number of race wins. - **driver** (Object) - Information about the driver. - **driverRef** (String) - Unique reference for the driver. - **givenName** (String) - The driver's first name. - **familyName** (String) - The driver's last name. - **permanentNumber** (Int) - The driver's permanent car number. - **constructors** (Array of Objects) - Constructors the driver raced for in that season/round. - **constructorRef** (String) - Unique reference for the constructor. - **name** (String) - The name of the constructor. #### Response Example ```json { "data": { "driversStandings": { "data": [ { "season": 2023, "round": 22, "position": 1, "positionText": "1", "points": 575, "wins": 19, "driver": { "driverRef": "max_verstappen", "givenName": "Max", "familyName": "Verstappen", "permanentNumber": 1 }, "constructors": [ { "constructorRef": "red_bull", "name": "Red Bull Racing" } ] } ] } } } ``` ``` -------------------------------- ### GraphQL Query - Retrieve Race Information Source: https://context7.com/race-tech/f1-api/llms.txt Access race data including the latest race, specific races by year and round, or lists of races with filtering. Supports pagination. ```APIDOC ## GraphQL Query - Retrieve Race Information ### Description Access race data including the latest race, specific races by year and round, or lists of races with filtering. ### Method POST (GraphQL endpoint) ### Endpoint /graphql ### Parameters #### Query Parameters - **query** (String) - Required - The GraphQL query string. - **variables** (Object) - Optional - Variables for the query. #### Request Body (This is a GraphQL API, so the request is typically sent as a JSON payload in the body of a POST request) ```json { "query": "query { latestRace { year round raceName circuit { circuitRef circuitName location { locality country } } date time } }" } ``` ### Request Example ```json { "query": "query { race(year: 2023, round: 5) { year round raceName circuit { circuitRef circuitName } date } }" } ``` ### Response #### Success Response (200) - **data** (Object) - Contains the query results. - **latestRace** (Object) - Information about the latest race. - **year** (Int) - The year of the race. - **round** (Int) - The round number of the race. - **raceName** (String) - The name of the race. - **circuit** (Object) - Information about the circuit. - **circuitRef** (String) - Unique reference for the circuit. - **circuitName** (String) - The name of the circuit. - **location** (Object) - Location details of the circuit. - **locality** (String) - The city or locality of the circuit. - **country** (String) - The country of the circuit. - **date** (String) - The date of the race (YYYY-MM-DD). - **time** (String) - The start time of the race. - **race** (Object) - Information about a specific race. - **year** (Int) - The year of the race. - **round** (Int) - The round number of the race. - **raceName** (String) - The name of the race. - **circuit** (Object) - Information about the circuit. - **circuitRef** (String) - Unique reference for the circuit. - **circuitName** (String) - The name of the circuit. - **date** (String) - The date of the race (YYYY-MM-DD). - **races** (Object) - List of races matching the criteria. - **data** (Array) - Array of race objects. - **year** (Int) - The year of the race. - **round** (Int) - The round number of the race. - **raceName** (String) - The name of the race. - **date** (String) - The date of the race (YYYY-MM-DD). #### Response Example ```json { "data": { "race": { "year": 2023, "round": 5, "raceName": "Miami Grand Prix", "circuit": { "circuitRef": "miami", "circuitName": "Miami International Autodrome" }, "date": "2023-05-07" } } } ``` ``` -------------------------------- ### GraphQL Query - Retrieve Driver Standings Source: https://context7.com/race-tech/f1-api/llms.txt Query championship standings for Formula 1 drivers from the F1 API. Allows retrieval of standings at specific race rounds or for the end of a season. ```graphql # Placeholder for driver standings query examples. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.