Rate limits for API users

I want to create a sister app at some point that will post topics on to the forum via an API user account - is there any info available on rate limits for this? Can we ‘trust’ certain accounts so that rate limits do not apply?

As far as I know, using an API key (generated in the admin interface) bypasses rate limits that are checked within the rails stack, e.g. limits on the number of posts.
It will not bypass the general limit on the number of requests per second enforced by nginx, but most likely, that won’t be a problem :slight_smile:

You can explicitly bypass validations if you are using the API and API key, the limits in general will hold though.

I’m not too bothered by validations Sam, but by-passing rate limits for specific accounts could be helpful.

Does the response include the specific error code if rate limits have been by-passed? That could be helpful if there’s no chance of including an option to by-pass…

I kind of worry about answering questions about problems that do not exist :blush:

If you hit the limits let me know and let me know what errors you are getting

I did actually hit the limit previously - we currently have 6 monthly giveaways and every night a cron runs to check whether there is a ‘bonus day’, if there is, it posts an update on the forum. What I was finding was the crons running later weren’t posting. However I’ve since changed the cron jobs to run a minute after each other. (This is fine for this situation.)

I’ll keep you posted re the other app (which will be posting via the API much more frequently) though I don’t expect this to go live for a few months yet.

We use discourse via API from a Rails server. Which means all the traffic coming from one IP. We have enough traffic that it hits the rate limiter. I second the need for an API exception to this rate limit.

قد يكون هذا مناسبًا لك لتعليق عليه اليوم @sam — هل توجد حدود للمضيفين الذاتيين؟ هل لدينا حدود؟ كيف نفكر في هذا الآن، حيث تغير الأمر…

في هذه الأيام، لدينا حدود عالمية صريحة لواجهة برمجة التطبيقات (API)، ومع ذلك، في بعض الأحيان تتراكم هذه الحدود.

تُعرِّف بعض وحدات التحكم (controllers) حدودًا، مثل الحد الأقصى لعدد المواضيع التي يمكنك إنشاؤها كل N ثانية وما إلى ذلك.

بالنسبة لطلبات GET البسيطة، يمكنك رفع حد معدل الـ API بشكل كبير دون الوصول إلى أي حدود من Discourse. لا تزال هناك بعض الحدود في NGINX تحتاج إلى تعديلها.

كيف سيؤثر ذلك على حساب يريد نشر مواضيع أو منشورات جديدة عبر مفتاح الـ API الخاص به يا سام؟

أين يمكننا فعل ذلك يا سام؟

أنا أيضًا أفكر حاليًا في إنشاء بوابة ستستخدم مكتبة discourse_api لجلب كمية كبيرة من البيانات من المنتدى، هل من المرجح أن أصل إلى حدود المعدل هنا؟ أحب أن نتمكن من تجاوز أي حدود معدل للحسابات التي قمنا بتعيينها كـ ‘آمنة’.

أوصي بقراءة حدودنا للمعدل هنا:

يجب أن يكون لدينا توثيق لحدود أخرى مختلفة منتشرة في موقع meta.

شكرًا لك سام، لذا للمرجع المستقبلي (ولأي شخص آخر يبحث عن هذا في المستقبل)، إليك التفاصيل الكاملة:

  • لدي سؤال حول عناوين IP الخاصة، لكنني سأشاركه في الموضوع الرئيسي. يمكن إغلاق هذا الموضوع على الأرجح في هذه المرحلة لأن ذلك الموضوع آخر أحدث.*