# Rate limiting

You can make **300 requests per minute** to each API in our system. Check the returned HTTP headers of any API request to see your current rate limit status. When you reached your rate limit, the API will return `429` status code

By default we return the following status codes

<table><thead><tr><th width="374">Status code</th><th>Description</th></tr></thead><tbody><tr><td><code>200</code></td><td>Success</td></tr><tr><td><code>429</code></td><td>Too many requests from rate limiting</td></tr></tbody></table>

And the following headers

| Response header         | Description                                                                                                   |
| ----------------------- | ------------------------------------------------------------------------------------------------------------- |
| `X-RateLimit-Limit`     | The maximum number of requests that the consumer is permitted to make per minute (by default 300 per minute). |
| `X-RateLimit-Remaining` | The number of requests remaining in the current rate limit window.                                            |
| `X-RateLimit-Reset`     | The number of seconds to wait until the rate limit window resets. This header is sent for each response.      |

Here is an example in python to handle rate limiting

```python
#make sure you have requests installed or run the following pip3 install requests

from datetime import datetime
from time import sleep
import requests

url = "https://{subdomain}.everreal-dev.co/api/reporting/graphql"
token =  'ey...'

payload="{\"query\":\"query {\\r\\n  users(input: { paging: { take: 10, skip: 0 }, filter: { email: \\\"email@domain.com\\\" } }) {\\r\\n    id\\r\\n    email\\r\\n  }\\r\\n}\",\"variables\":{}}"
headers = {
  'Authorization': f'Bearer {token}',
  'Content-Type': 'application/json',
}

for i in range(0,100):
    response = requests.request("POST", url, headers=headers, data=payload)
    print(f"response code {response.status_code} at {datetime.now()}")
    print("remaining", response.headers['X-RateLimit-Remaining'])
    if(response.headers['X-RateLimit-Remaining'] == 0):
        print(f"Sleeping {response.headers['X-RateLimit-Reset']}")
        sleep(int(response.headers['X-RateLimit-Reset']))
    print("-------------------------------------------------------")
```


---

# 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://api-docs.everreal.co/rate-limiting.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.
