> 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/personalization/overview/using-the-api/limiting.md).

# Limiting

## Group limiting

The API provides a generic system to limit the returned items per group.

To limit the number of items that belong to a certain group, simply add the `group_limit=[group]:[limit]` query parameter to the url of the endpoint.

{% hint style="info" %}

### Simple group limit example

In this example we get at most 5 popular events per sport:

```bash
$ curl --request GET \\
  --url 'https://api.vaix.ai/api/sports/events/popular?group_limit=sport:5'
```

{% endhint %}

Not all endpoints support group limit. If group limiting is available for an endpoint, then the supported grouping fields are indicated in the documentation of that endpoint.

## Prioritized limiting

The API provides a generic system to apply prioritization limits to the returned items.

This is similar to group limiting, with the difference that it applies the limit on specific `values` of the result set, while the limits can vary per value. Also, the limited items are ensured to be present in the result set.

To limit the number of items that belong to a certain group, simply add the `prioritized_limit=[field]:[value]=[limit]` query parameter to the url of the endpoint.

{% hint style="info" %}

### Prioritized limit example on event `status`

In this example, we get the 5 most popular events, ensuring that up to 3 are `live` and up to 2 are `prematch`:

```bash
$ curl --request GET \\
  --url 'https://api.vaix.ai/api/sports/events/popular?count=5&prioritized_limit=status:live=3,not_started=2'
```

{% endhint %}

{% hint style="info" %}

### Prioritized limit example on event's `sport` values

In this example, we get the 10 most popular events, ensuring that up to 3 are `football` events and up to 2 are `basketball` events:

```bash
 $ curl --request GET \\
  --url 'https://api.vaix.ai/api/sports/events/popular?count=10&prioritized_limit=sport:football=3,basketball=2'
```

Notice that since we request the 10 most popular events, the total number of events returned will be 10, with the number of `football` and `basketball` events being at most 3 and 2 respectively.
{% endhint %}

{% hint style="info" %}

### Order of the final results

Notice that in both cases the initial order of the events will be preserved.

The parameters are applying the needed limits without changing the relative order between the items of the resulted set.
{% endhint %}


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.sportradar.com/personalization/overview/using-the-api/limiting.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
