> For the complete documentation index, see [llms.txt](https://docs.sportmonks.com/v3/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sportmonks.com/v3/tutorials-and-guides/tutorials/enrich-your-response/nested-includes/syntax-and-relations.md).

# Syntax and relations

How to know what syntax to use? And how can you add additional information about participants (players, coaches, teams etc.)? It’s essential to check the API response to see which model is returned.&#x20;

Two of the most overlooked nested includes are:

* `players.player` → Can be used to include player details on various endpoints.

{% code overflow="wrap" %}

```javascript
https://api.sportmonks.com/v3/football/teams/{ID}?api_token=YOUR_TOKEN&include=players.player 
```

{% endcode %}

* `teams.team` → Can be used to include team details on various endpoints.

{% code overflow="wrap" %}

```javascript
https://api.sportmonks.com/v3/football/players/{ID}?api_token=YOUR_TOKEN&include=teams.team
```

{% endcode %}

{% hint style="info" %}
Check the exact relation of the requested entities to determine the syntax.
{% endhint %}

**Player transfers**

Let’s say you’re interested in the players from a specific team with all the historical transfers of the player. You can use the Team by ID endpoint with the `players` include:

`https://api.sportmonks.com/v3/football/teams/{ID}?api_token=YOUR_TOKEN&include=players`&#x20;

This request returns a list of player IDs with start and end dates but not the player record. Therefore if you use the `players.transfer` include, you will only receive the transfer that led the player to the requested team.

If you’re interested in all transfers, you must include the player model first. You can do this by adding the nested include .`player`:

`https://api.sportmonks.com/v3/football/teams/{ID}?api_token=YOUR_TOKEN&include=players.player`

Now you can add the transfers include for all the player’s historical transfers.

`https://api.sportmonks.com/v3/football/teams/{ID}?api_token=YOUR_TOKEN&include=players.player.transfers`


---

# 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.sportmonks.com/v3/tutorials-and-guides/tutorials/enrich-your-response/nested-includes/syntax-and-relations.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.
