> For the complete documentation index, see [llms.txt](https://docs.sportradar.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sportradar.com/uof/api-and-structure/api-stage-structure/formula-1.md).

# Formula 1

One of the most important examples of stage strucutured sport in UOF is Formula 1.

We will report below an example of how to get info related to races in such a case of stage structure.

First of all let's introduce the concept of parenting among stages.

The are stages which are parents of other stages which on their side can be parent of child stages as reported in image below:<br>

<figure><img src="/files/gEebpZsYN0NF98DtuPQK" alt=""><figcaption></figcaption></figure>

Using the "All sports" end point we can retrieve the ID of the Formula 1 sport which is 40 as shown below.

```xml
<sport id="sr:sport:40" name="Formula 1"/>
```

Once we get the ID of the sport then  we can use the end point "All available tournament for a sport" filtering by using sport id=40 and we can get the following xml:

```xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<sport_tournaments xmlns="http://schemas.sportradar.com/sportsapi/v1/unified" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" generated_at="2021-10-06T09:35:09+00:00" 
xsi:schemaLocation="http://schemas.sportradar.com/sportsapi/v1/unified http://schemas.sportradar.com/ufsportsapi/v1/endpoints/unified/ufsportsapi.xsd">

<sport id="sr:sport:40" name="Formula 1"/>
<tournaments>
<tournament id="sr:stage:547803" name="Formula 1 2020" scheduled="2020-03-13T01:00:00+00:00" scheduled_end="2020-12-13T16:00:00+00:00">
<sport id="sr:sport:40" name="Formula 1"/>
<category id="sr:category:36" name="Formula 1"/>
</tournament>

<tournament id="sr:stage:686252" name="Formula 1 2021" scheduled="2021-03-26T11:00:00+00:00" scheduled_end="2021-12-12T15:10:00+00:00">
<sport id="sr:sport:40" name="Formula 1"/>
<category id="sr:category:36" name="Formula 1"/>
</tournament>
</tournaments>

</sport_tournaments>
```

\
As we can see from the response of the end point the tournaments filtered by sport have the following id: "sr:stage:547803" and "sr:stage:686252" so in case of Formula 1 the structure is organized into stages.

This was  the first step in order to identify the stages for Formula 1.

Let us consider now is the second stage i.e. "sr:stage:686252".

This is a parent stage which will have several child stages below it.

In order to retrieve all the stages related to this one we can use the "Schedule for a Tournament" end point filtering by stage 686252.

The result will be the one shown in the following example i.e. the list of all the stages contained in 686252.

The answer of the end point shows that they are all parent stage which means they have child stages below them.

```xml
<?xml version="1.0" encoding="UTF-8"?>
  <race_schedule xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" generated_at="2021-10-06T07:51:27+00:00" xmlns="http://schemas.sportradar.com/sportsapi/v1/unified" xsi:schemaLocation="http://schemas.sportradar.com/sportsapi/v1/unified http://schemas.sportradar.com/bsa/unified/v1/xml/endpoints/unified/race_schedule.xsd">
    <tournament id="sr:stage:686252" scheduled="2021-03-26T11:00:00+00:00" scheduled_end="2021-12-12T15:10:00+00:00" name="Formula 1 2021">
      <sport id="sr:sport:40" name="Formula 1"/>
      <category id="sr:category:36" name="Formula 1"/>
    </tournament>
    <sport_events>
      <sport_event id="sr:stage:699614" scheduled="2021-03-12T00:00:00+00:00" scheduled_end="2021-03-14T23:55:00+00:00" name="Pre season Testing 2021 - Bahrain" type="parent"/>
      <sport_event id="sr:stage:686472" scheduled="2021-03-26T11:30:00+00:00" scheduled_end="2021-03-28T17:00:00+00:00" name="Bahrain Grand Prix 2021" type="parent"/>
      <sport_event id="sr:stage:686692" scheduled="2021-04-09T03:00:00+00:00" scheduled_end="2021-04-11T08:10:00+00:00" name="Chinese Grand Prix 2021" type="parent"/>
      <sport_event id="sr:stage:694156" scheduled="2021-04-16T09:30:00+00:00" scheduled_end="2021-04-18T15:00:00+00:00" name="Imola Grand Prix 2021" type="parent"/>
      <sport_event id="sr:stage:686922" scheduled="2021-04-30T10:30:00+00:00" scheduled_end="2021-05-02T16:00:00+00:00" name="Portuguese Grand Prix 2021" type="parent"/>
      <sport_event id="sr:stage:687140" scheduled="2021-05-07T09:30:00+00:00" scheduled_end="2021-05-09T15:00:00+00:00" name="Gran Premio de Espana 2021" type="parent"/>
      <sport_event id="sr:stage:687358" scheduled="2021-05-20T09:30:00+00:00" scheduled_end="2021-05-23T15:00:00+00:00" name="Grand Prix de Monaco 2021" type="parent"/>
      <sport_event id="sr:stage:687576" scheduled="2021-06-04T08:30:00+00:00" scheduled_end="2021-06-06T14:00:00+00:00" name="Azerbaijan Grand Prix 2021" type="parent"/>
      <sport_event id="sr:stage:687806" scheduled="2021-06-11T15:30:00+00:00" scheduled_end="2021-06-13T20:00:00+00:00" name="Grand Prix du Canada 2021" type="parent"/>
      <sport_event id="sr:stage:688024" scheduled="2021-06-18T09:30:00+00:00" scheduled_end="2021-06-20T15:00:00+00:00" name="Grand Prix de France 2021" type="parent"/>
      <sport_event id="sr:stage:707664" scheduled="2021-06-25T09:30:00+00:00" scheduled_end="2021-06-27T15:00:00+00:00" name="Styrian Grand Prix 2021" type="parent"/>
      <sport_event id="sr:stage:688254" scheduled="2021-07-02T09:30:00+00:00" scheduled_end="2021-07-04T15:00:00+00:00" name="Grosser Preis von Osterreich 2021" type="parent"/>
      <sport_event id="sr:stage:710374" scheduled="2021-07-16T13:30:00+00:00" scheduled_end="2021-07-18T16:00:00+00:00" name="British Grand Prix 2021" type="parent"/>
      <sport_event id="sr:stage:688702" scheduled="2021-07-30T09:30:00+00:00" scheduled_end="2021-08-01T15:00:00+00:00" name="Magyar Nagydij 2021" type="parent"/>
      <sport_event id="sr:stage:688932" scheduled="2021-08-27T09:30:00+00:00" scheduled_end="2021-08-29T15:00:00+00:00" name="Belgian Grand Prix 2021" type="parent"/>
      <sport_event id="sr:stage:689174" scheduled="2021-09-03T09:30:00+00:00" scheduled_end="2021-09-05T15:00:00+00:00" name="Dutch Grand Prix 2021" type="parent"/>
      <sport_event id="sr:stage:718534" scheduled="2021-09-10T12:30:00+00:00" scheduled_end="2021-09-12T15:00:00+00:00" name="Gran Premio DItalia 2021" type="parent"/>
      <sport_event id="sr:stage:689622" scheduled="2021-09-24T08:30:00+00:00" scheduled_end="2021-09-26T14:00:00+00:00" name="Russian Grand Prix 2021" type="parent"/>
      <sport_event id="sr:stage:689852" scheduled="2021-10-01T09:00:00+00:00" scheduled_end="2021-10-03T14:00:00+00:00" name="Singapore Grand Prix 2021" type="parent"/>
      <sport_event id="sr:stage:690082" scheduled="2021-10-08T02:30:00+00:00" scheduled_end="2021-10-10T07:00:00+00:00" name="Japanese Grand Prix 2021" type="parent"/>
      <sport_event id="sr:stage:705000" scheduled="2021-10-08T08:30:00+00:00" scheduled_end="2021-10-10T14:00:00+00:00" name="Turkish Grand Prix 2021" type="parent"/>
      <sport_event id="sr:stage:690300" scheduled="2021-10-22T16:30:00+00:00" scheduled_end="2021-10-24T21:00:00+00:00" name="United States Grand Prix 2021" type="parent"/>
      <sport_event id="sr:stage:690518" scheduled="2021-11-05T16:30:00+00:00" scheduled_end="2021-11-07T21:00:00+00:00" name="Gran Premio de Mexico 2021" type="parent"/>
      <sport_event id="sr:stage:690736" scheduled="2021-11-12T14:30:00+00:00" scheduled_end="2021-11-14T19:00:00+00:00" name="Grande Premio do Brasil 2021" type="parent"/>
      <sport_event id="sr:stage:725424" scheduled="2021-11-19T00:00:00+00:00" scheduled_end="2021-11-21T23:55:00+00:00" name="Qatar GP" type="parent"/>
      <sport_event id="sr:stage:686254" scheduled="2021-11-19T01:30:00+00:00" scheduled_end="2021-11-21T08:00:00+00:00" name="Australian Grand Prix 2021" type="parent"/>
      <sport_event id="sr:stage:690978" scheduled="2021-12-03T12:30:00+00:00" scheduled_end="2021-12-05T18:00:00+00:00" name="Saudi Arabian Grand Prix 2021" type="parent"/>
      <sport_event id="sr:stage:691196" scheduled="2021-12-10T09:30:00+00:00" scheduled_end="2021-12-12T15:00:00+00:00" name="Abu Dhabi Grand Prix 2021" type="parent"/>
    </sport_events>
  </race_schedule>

```

Once we have retrieved all the stages below Formula 1 2021 (which are all Grand Prix) we can go deeper and get more detailed info for each of them.

Let's use as an example the first one above: 699614

```xml
<fixtures_fixture generated_at="2021-10-06T10:04:16.444+00:00" xsi:schemaLocation="http://schemas.sportradar.com/sportsapi/v1/unified http://schemas.sportradar.com/bsa/unified/v1/xml/endpoints/unified/fixtures_fixture.xsd" xmlns="http://schemas.sportradar.com/sportsapi/v1/unified" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <fixture liveodds="not_available" id="sr:stage:699614" name="Pre season Testing 2021 - Bahrain" type="parent" stage_type="event" scheduled="2021-03-12T00:00:00+00:00" scheduled_end="2021-03-14T23:55:00+00:00">
    <parent id="sr:stage:686252" name="Formula 1 2021" type="parent" stage_type="season"/>
    <tournament id="sr:stage:686252" name="Formula 1 2021" scheduled="2021-03-26T11:00:00+00:00" scheduled_end="2021-12-12T15:10:00+00:00">
      <sport id="sr:sport:40" name="Formula 1"/>
      <category id="sr:category:36" name="Formula 1"/>
    </tournament>
    <races>
      <sport_event id="sr:stage:699616" type="child" stage_type="practice" scheduled="2021-03-12T00:00:00+00:00"/>
      <sport_event id="sr:stage:699618" type="child" stage_type="practice" scheduled="2021-03-13T00:00:00+00:00"/>
      <sport_event id="sr:stage:699620" type="child" stage_type="practice" scheduled="2021-03-14T00:00:00+00:00"/>
      <sport_event id="sr:stage:699622" type="child" stage_type="qualifying" scheduled="1970-01-01T00:00:00+00:00"/>
      <sport_event id="sr:stage:699630" type="child" stage_type="race" scheduled="1970-01-01T00:00:00+00:00"/>
    </races>
    <venue id="sr:venue:1013" name="Bahrain International Circuit"/>
  </fixture>
</fixtures_fixture>
```

As we can see in the answer of the end point we get listed the id of the child stage and the info if we are talking about practice, qualiyfing or race.

We can go again deeper and filter the first stage 699616 in the fixture end point and we will get more detailed info related to the stage.

```xml
<fixtures_fixture generated_at="2021-10-06T10:10:07.780+00:00" xsi:schemaLocation="http://schemas.sportradar.com/sportsapi/v1/unified 
http://schemas.sportradar.com/bsa/unified/v1/xml/endpoints/unified/fixtures_fixture.xsd" xmlns="http://schemas.sportradar.com/sportsapi/v1/unified" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <fixture liveodds="not_available" id="sr:stage:699616" name="Practice 1" type="child" stage_type="practice" scheduled="2021-03-12T00:00:00+00:00" scheduled_end="2021-03-12T23:55:00+00:00">
    <parent id="sr:stage:699614" name="Pre season Testing 2021 - Bahrain" type="parent" stage_type="event"/>
    <tournament id="sr:stage:686252" name="Formula 1 2021" scheduled="2021-03-26T11:00:00+00:00" scheduled_end="2021-12-12T15:10:00+00:00">
      <sport id="sr:sport:40" name="Formula 1"/>
      <category id="sr:category:36" name="Formula 1"/>
    </tournament>
  </fixture>
</fixtures_fixture>

```

It is very important to keep in mind that the dates provided in the end points can be taken into consideration for outrights but the best way in order to get dates related to outrights is to use the AMQP message related where the dates are&#x20;

reported exactly for the specific outright.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sportradar.com/uof/api-and-structure/api-stage-structure/formula-1.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
