# Limiters

Rate limiting is an essential part of using the Riot Games API.

* Prevents requests hitting 429.
* Lowers the risk of being banned due to excessive 429s.

They are only used in the RiotAPI store, different rate limiters has different pros and cons.

Rate limiters are configured on the `rate_limiter` param of the store configuration, the configurable values of rate limiters are params in the `__init__` definition of each rate limiter. Similar to how stores are configured.

There are a few configurable values that exists across multiple rate limiters, they will be documented here.

* `limiting_share`: `float = 1`

  > Value from 0 to 1. Rate limiter will only allow requests up to `bucket_max * limiting_share` (e.g. 0.7 will result in only using 70% of the limit).

## Example

```python
    # ... Other stores
    {
        "backend": "pyot.stores.riotapi.RiotAPI",
        "api_key": os.environ["RIOT_API_KEY"],
        "rate_limiter": {
            "backend": "pyot.limiters.redis.RedisLimiter",
            "limiting_share": 1,
            "host": "127.0.0.1",
            "port": 6379,
            "db": 0,
        }
    }
```


---

# Agent Instructions: 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://pyot.iann838.com/limiters.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.
