> For the complete documentation index, see [llms.txt](https://docs.thesports.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.thesports.com/help-center/football/how-to-obtain-data-for-a-specified-competition.md).

# How to obtain data for a specified competition?

#### **Schedule**

Use the [**Schedule and Results - season query(newest season)**](/thesports-docs/basic-data/schedule-and-results-season-query-newest-season.md) API endpoint. Use the `season id` parameter to retrieve all schedules for that season. Only the latest season can be queried.

For example, to retrieve the Premier League schedule, first find the `season id` of the latest Premier League season. Then use the `season id` parameter with this API endpoint to retrieve the schedule for that season.

#### **Teams**

From the schedules retrieved in the previous step, collect the associated home team ids and away team ids. Use each team id as the value of the `uuid` parameter in the [**Team** ](/thesports-docs/basic-info/team.md)API endpoint to retrieve the corresponding team data.

#### **Players**

For each team retrieved in the previous step, use its team id as the value of the `uuid` parameter in the [**Team lineup**](/thesports-docs/advanced-data/team-lineup.md) API endpoint included in the high-level package to retrieve the team's lineup data.

This API endpoint returns all player ids for the specified team. After obtaining a player id, use it as the value of the `uuid` parameter in the [**Player**](/thesports-docs/basic-info/player.md) API endpoint to retrieve the corresponding player data.

#### **Real-time data**

The [**Real-time data**](/thesports-docs/basic-data/real-time-data.md) API endpoint returns the complete dataset and does not support queries by other dimensions. Save all returned data locally first, then filter it locally.

#### **`uuid` queries**

Some list API endpoints support the `uuid` parameter and return data for the specified id.

For example, to retrieve Fulham's team data, use `vl7oqdehz23r510` as the value of the `uuid` parameter in the **Team** API endpoint. The API endpoint then returns the data for Fulham.

<figure><img src="/files/41q290ngV3iZock7NBcq" alt=""><figcaption></figcaption></figure>


---

# 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, and the optional `goal` query parameter:

```
GET https://docs.thesports.com/help-center/football/how-to-obtain-data-for-a-specified-competition.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
