# API rate limits

**URL:** https://meta.discourse.org/t/api-rate-limits/208405
**Category:** Development
**Tags:** rest-api
**Created:** [November 5, 2021, 10:27pm UTC](https://meta.discourse.org/t/api-rate-limits/208405 "2021-11-05T22:27:49Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![lstuartfry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lstuartfry/32/236018_2.png) [@lstuartfry](https://meta.discourse.org/u/lstuartfry)
#### Post date: [November 5, 2021, 10:27pm UTC](https://meta.discourse.org/t/api-rate-limits/208405/1 "2021-11-05T22:27:49Z")

</div>

Hey all,  
I’ve come across several (somewhat-old) articles on this forum that outline API rate limits (ex: [Available settings for global rate limits and throttling](https://meta.discourse.org/t/global-rate-limits-and-throttling-in-discourse/78612)). I’m interested in this because, during the customization of our site, we’re making several API calls related to users and topics, and I’d like to ensure we keep the calls to a minimum.

Are these settings still configurable via the Admin panel? I haven’t come across anything thus far that relates to the Discourse API rate limits.

If not, is there a way to monitor the request activity somewhere?

Thank you in advance!

---

<div class="post-metadata">

### Author: ![blake](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/blake/32/157322_2.png) [@blake](https://meta.discourse.org/u/blake)
#### Post date: [November 6, 2021, 1:19pm UTC](https://meta.discourse.org/t/api-rate-limits/208405/2 "2021-11-06T13:19:21Z")

</div>

> [@lstuartfry](#):
>
> Are these settings still configurable via the Admin panel? I haven’t come across anything thus far that relates to the Discourse API rate limits.

These API rate limit settings are not configured via the admin panel, but you will add them to the app.yml file on the server where your discourse site is hosted. So you will have to ssh into your server to make the change if you are self hosted.

> [@Available settings for global rate limits and throttling](https://meta.discourse.org/t/available-settings-for-global-rate-limits-and-throttling/78612/1):
>
> ### How do I amend these limits?
> 
> To amend the limits add the desired change into your `app.yml` file in the `env` section.
> 
> If you are hosted by Discourse contact [team@discourse.org](mailto:team@discourse.org)

---

<div class="post-metadata">

### Author: ![lstuartfry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lstuartfry/32/236018_2.png) [@lstuartfry](https://meta.discourse.org/u/lstuartfry)
#### Post date: [November 8, 2021, 5:59pm UTC](https://meta.discourse.org/t/api-rate-limits/208405/3 "2021-11-08T17:59:25Z")

</div>

@blake thank you for the response! My team is actually going to lean on Discourse for hosting, so we don’t have any of our own config files. Are there any avenues for viewing or tweaking the API limits if this is the route we go down?

---

<div class="post-metadata">

### Author: ![blake](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/blake/32/157322_2.png) [@blake](https://meta.discourse.org/u/blake)
#### Post date: [November 8, 2021, 6:10pm UTC](https://meta.discourse.org/t/api-rate-limits/208405/4 "2021-11-08T18:10:43Z")

</div>

> [@lstuartfry](#):
>
> My team is actually going to lean on Discourse for hosting

👍

> [@lstuartfry](#):
>
> Are there any avenues for viewing or tweaking the API limits if this is the route we go down?

If you are on enterprise we can tweak some of these limits for you as well as provide some api guidance so that we can reduce your api usage load.

What we recommend is to have your app that is making the API calls handle 429 errors and then check the `Retry-After` header that is received and this will let you know when you can start making requests again.

---

<div class="post-metadata">

### Author: ![lstuartfry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lstuartfry/32/236018_2.png) [@lstuartfry](https://meta.discourse.org/u/lstuartfry)
#### Post date: [November 8, 2021, 8:25pm UTC](https://meta.discourse.org/t/api-rate-limits/208405/5 "2021-11-08T20:25:49Z")

</div>

@blake thanks again for the info! I think my team is most likely fine with the current standard rate limits as defined by Discourse. Can you share what these limits are? I’ve been unable to track down a definitive list thus far.

---

<div class="post-metadata">

### Author: ![blake](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/blake/32/157322_2.png) [@blake](https://meta.discourse.org/u/blake)
#### Post date: [November 8, 2021, 8:57pm UTC](https://meta.discourse.org/t/api-rate-limits/208405/6 "2021-11-08T20:57:14Z")

</div>

> [@lstuartfry](#):
>
> Can you share what these limits are?

Yea the default limits are listed here for the pro/business plans.

> <https://github.com/discourse/discourse/blob/main/config/discourse_defaults.conf#L224-L231>

---

<div class="post-metadata">

### Author: ![lstuartfry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lstuartfry/32/236018_2.png) [@lstuartfry](https://meta.discourse.org/u/lstuartfry)
#### Post date: [November 8, 2021, 9:26pm UTC](https://meta.discourse.org/t/api-rate-limits/208405/7 "2021-11-08T21:26:52Z")

</div>

@blake once again, thank you for the information! This is somewhat related, but do you know if there is a timeline to add serializer customizations to at the themes/component level? I’ve seen that feature mentioned on this forum here and there over the past year, but I know it hasn’t been implemented yet.

I ask because we’re currently fetching user data on a per-topic basis in the topic list, which can add up once our platform has more and more users. Adding certain pieces of data of the user model to certain serializers could help cut down the API calls we’re currently having to make.

---

<div class="post-metadata">

### Author: ![blake](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/blake/32/157322_2.png) [@blake](https://meta.discourse.org/u/blake)
#### Post date: [November 8, 2021, 9:33pm UTC](https://meta.discourse.org/t/api-rate-limits/208405/8 "2021-11-08T21:33:50Z")

</div>

There is not a timeline for that that I’m aware of.

However, I recommend using the data-explorer plugin for custom data requests like this. What you can do is create your own custom sql query and save it so that it gets an id. Then you can make an API call to that saved query and it will execute then and return the json you are after in a single request.

> [@Run Data Explorer queries with the Discourse API](https://meta.discourse.org/t/how-to-run-data-explorer-queries-with-the-discourse-api/120063):
>
> bookmark This guide explains how to use the Discourse API to create, run, and manage queries with the [Data Explorer](https://meta.discourse.org/t/32566?silent=true) plugin. person_raising_hand Required user level: Administrator Virtually any action that can be performed through the Discourse user interface can also be triggered with the Discourse API. This document provides a comprehensive overview for utilizing the API specifically in conjunction with the [Data Explorer](https://meta.discourse.org/t/32566?silent=true) plugin. For a general overview of how to find the correct API …
