TechBuzzPro

Telegram Bot API Rate Limits Explained

· 6 min read · Apps & Browsers

In this article
  1. Background: Why Telegram Imposes Rate Limits
  2. How Rate Limits Work in the Bot API
  3. How to Stay Within the Limits
  4. Common Problems and Misconceptions
  5. Comparing Limits Across Methods
  6. Costs and Alternatives
  7. Safety and Best Practices
  8. Frequently Asked Questions

The Telegram Bot API enforces rate limits to prevent abuse and ensure service stability. The most commonly cited limit is 30 messages per second to a single chat, but this is not a hard cap for all methods; it's a guideline that Telegram may adjust. For broadcasts to multiple users, the limit is about 30 messages per second overall, and for group chats, no more than 20 messages per minute per group. These limits are not strictly enforced for all bots, but exceeding them can lead to temporary restrictions or a ban. The API returns a 429 error with a retry_after parameter when you hit a limit, telling you how many seconds to wait. This article explains the actual rate limits, how they work, and how to stay within them.

Background: Why Telegram Imposes Rate Limits

Telegram's Bot API is used by millions of bots, from small utilities to large-scale services. Without rate limits, a single misbehaving bot could flood the network, degrade performance for others, or spam users. Rate limits also protect Telegram's infrastructure from abuse, such as message flooding or API scraping. The limits are part of Telegram's Terms of Service for bots, and violating them can result in your bot being restricted or banned. Telegram does not publish an exhaustive list of limits, but the documented guidelines and community experience provide a practical framework.

How Rate Limits Work in the Bot API

Telegram's rate limits are applied per bot, not per user or per chat, but some limits are specific to chats. The API uses a token bucket algorithm for some methods, allowing short bursts but enforcing a long-term average. When you exceed a limit, the API responds with HTTP 429 and a JSON body containing . You must wait X seconds before retrying. Ignoring this can lead to longer restrictions.

Key limits to know:

  • Messages to a single chat: About 1 message per second, with bursts up to 30 per second allowed for short periods. This is not a hard rule but a guideline; Telegram may throttle if you consistently exceed it.
  • Broadcasts to multiple users: Approximately 30 messages per second overall. This applies when sending to different users, such as via sendMessage with different chat_id values.
  • Group chats: No more than 20 messages per minute to the same group. This is stricter to prevent group spam.
  • Other methods: Methods like getUpdates and setWebhook have their own limits, but they are generally less restrictive. For example, getUpdates should not be called more than once per second.

These limits are not officially codified in a single document; they are derived from Telegram's Bot API documentation and observed behavior. Telegram may adjust them without notice.

How to Stay Within the Limits

To avoid hitting rate limits, implement throttling and queuing in your bot. Here are practical steps:

  1. Use a queue for outgoing messages. Instead of sending messages immediately, add them to a queue and process them at a controlled rate. For broadcasts, limit to 30 messages per second.
  2. Respect the 429 response. When you receive a 429, read the retry_after value and wait that many seconds before retrying. Do not retry immediately.
  3. Batch updates where possible. For example, use sendMediaGroup to send multiple photos or videos in one API call instead of separate calls.
  4. Avoid unnecessary API calls. Cache user data and avoid polling getUpdates too frequently; use webhooks instead for real-time updates.
  5. Monitor your bot's rate. Log API calls and watch for 429 errors to identify bottlenecks.

For high-volume bots, consider using multiple bot tokens or distributing load across shards, but note that each bot has its own limits.

Common Problems and Misconceptions

A common misconception is that the 30 messages per second limit applies to all messages, including those to the same chat. In reality, sending 30 messages per second to a single chat will likely trigger a 429 because the per-chat limit is lower. Another misconception is that rate limits are per user; they are per bot. If you have multiple bots, each has its own limits.

Another issue is that some methods, like sendChatAction (typing indicator), have their own limits. For example, you should not send a chat action more than once every few seconds per chat. Exceeding this can also result in a 429.

If you receive a 429, do not panic; it's a temporary restriction. However, repeated violations can lead to your bot being banned. Always implement backoff and respect retry_after.

Comparing Limits Across Methods

Different Bot API methods have different rate limits. Here's a comparison based on documented and observed behavior:

  • sendMessage: ~1 msg/sec per chat, ~30 msg/sec overall.
  • sendPhoto, sendVideo, etc.: Similar to sendMessage.
  • getUpdates: 1 request per second.
  • setWebhook: 1 request per second.
  • getMe: No strict limit, but avoid excessive calls.
  • answerCallbackQuery: Should be called within a few seconds of the callback; rate limits apply per chat.

These are guidelines; always handle 429 responses gracefully.

Costs and Alternatives

The Bot API is free to use, but rate limits are a form of cost in terms of throughput. If you need higher limits, consider using the Telegram API (MTProto) instead of the Bot API. The MTProto API allows you to create a full-fledged client with higher limits, but it requires more setup and is subject to its own limits. For most bots, the Bot API limits are sufficient if you implement proper queuing.

Another alternative is to use multiple bots for different functions, each with its own rate limit. However, this can complicate management.

Safety and Best Practices

To keep your bot safe and compliant:

  • Never ignore 429 errors; always back off.
  • Do not use bots for spamming or mass messaging without user consent.
  • Implement logging to detect rate limit issues early.
  • Use webhooks instead of polling to reduce API calls.
  • Test your bot's throughput in a staging environment before deploying to production.

Following these practices helps you avoid restrictions and ensures a smooth experience for your users.

Frequently Asked Questions

What is the exact rate limit for sending messages to a single chat?

Telegram does not publish an exact number, but the practical limit is about 1 message per second per chat, with short bursts allowed. Exceeding this consistently can trigger a 429 error.

Can I send 30 messages per second to the same chat?

No, that will likely hit the per-chat limit. The 30 messages per second figure applies to sending to different chats, not the same one.

What should I do when I get a 429 error?

Read the retry_after value from the response and wait that many seconds before retrying. Do not retry immediately.

Are rate limits per bot or per user?

Rate limits are applied per bot token. Each bot has its own limits, regardless of how many users it serves.

Is there a limit on group messages?

Yes, you should not send more than 20 messages per minute to the same group. This is stricter than private chats to prevent spam.

Can I increase my bot's rate limits?

No, the limits are fixed by Telegram. To handle higher throughput, optimize your code, use queues, or consider the MTProto API.