# Discourse API Generating 429

**URL:** https://meta.discourse.org/t/discourse-api-generating-429/259749
**Category:** Support
**Created:** [March 28, 2023, 6:40pm UTC](https://meta.discourse.org/t/discourse-api-generating-429/259749 "2023-03-28T18:40:29Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![ckdev](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ckdev/32/299996_2.png) [@ckdev](https://meta.discourse.org/u/ckdev)
#### Post date: [March 28, 2023, 6:40pm UTC](https://meta.discourse.org/t/discourse-api-generating-429/259749/1 "2023-03-28T18:40:29Z")

</div>

Hello,

I am trying to use the Discourse API to give silly responses in a forum. For example, if someone says “Linux” in a thread Discobot will respond “Do you mean GNU/Linux?”

It works, unless someone responds with the same phrase, then I get a bunch of 429 or empty responses for two minutes (it’s almost exactly two minutes), at which point the API will start handling responses normally again.

For example:

Linux  
FOSS  
dotnet  
Java  
Linux

This will function correctly. However:

Linux  
FOSS  
dotnet  
Linux  
Linux

This will break.

Any idea what the two minute window is pertaining to? We’ve played with the app.yml settings and adjusted API rate limits. It did not seem to have any effect.

Thank you!

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [March 28, 2023, 6:46pm UTC](https://meta.discourse.org/t/discourse-api-generating-429/259749/2 "2023-03-28T18:46:09Z")

</div>

We need more info. What is the API endpoint you are calling and getting 429?

---

<div class="post-metadata">

### Author: ![ckdev](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ckdev/32/299996_2.png) [@ckdev](https://meta.discourse.org/u/ckdev)
#### Post date: [March 28, 2023, 6:47pm UTC](https://meta.discourse.org/t/discourse-api-generating-429/259749/3 "2023-03-28T18:47:38Z")

</div>

```plaintext
https://forum.domain.net/t/1000/highestPost.json

```

GET request on that

highestPost being the `highest_post_number` of the thread

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [March 28, 2023, 6:50pm UTC](https://meta.discourse.org/t/discourse-api-generating-429/259749/4 "2023-03-28T18:50:07Z")

</div>

That means that you are being rate limited. If you want to keep track of new posts, pooling like that is very inefficient. Can I suggest using webhooks ? That way you can react to new posts, instead of pooling even when nothing is happening.

---

<div class="post-metadata">

### Author: ![ckdev](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ckdev/32/299996_2.png) [@ckdev](https://meta.discourse.org/u/ckdev)
#### Post date: [March 28, 2023, 6:52pm UTC](https://meta.discourse.org/t/discourse-api-generating-429/259749/5 "2023-03-28T18:52:24Z")

</div>

Sure, I can take a gander at web-hooks.

Do you know how to disable the response rate-limits? I believe we’ve changed a few in the app.yml already, anything that pertained to API from this link:

> [@Available settings for global rate limits and throttling](https://meta.discourse.org/t/available-settings-for-global-rate-limits-and-throttling/78612):
>
> Discourse ships with 3 different global rate limits that can be configured by site admins. Global per-ip rate limits These limits apply to every unique IP address that hits the Discourse application. (files that are served directly from the filesystem or the CDN are excluded) By default this rate limit is enabled, you may disable it or set it to a reporting mode. DISCOURSE\_MAX\_REQS\_PER\_IP\_MODE : default block, this rate limit applies out of the box. (other options are warn, warn+block, and n…

Is this something specific in Nginx we need to explore?

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [March 28, 2023, 6:57pm UTC](https://meta.discourse.org/t/discourse-api-generating-429/259749/6 "2023-03-28T18:57:34Z")

</div>

> [@ckdev](#):
>
> Is this something specific in Nginx we need to explore?

There is a nginx template that is added by default. It’s will be one of the very first lines of the app.yml. You may want to remove the one about rate limits and rebuild for it to take effect.

---

<div class="post-metadata">

### Author: ![ckdev](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ckdev/32/299996_2.png) [@ckdev](https://meta.discourse.org/u/ckdev)
#### Post date: [March 28, 2023, 7:01pm UTC](https://meta.discourse.org/t/discourse-api-generating-429/259749/7 "2023-03-28T19:01:39Z")

</div>

w00t. Will try that. Thank you for the assistance!

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [April 27, 2023, 7:02pm UTC](https://meta.discourse.org/t/discourse-api-generating-429/259749/8 "2023-04-27T19:02:29Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
