Telegram Bot
Simplified HTTP version of the MTProto API for bots
- Authentication
- API Key
- HTTPS
- Yes
- CORS
- Unknown
- Category
- Social
- Documentation / URL
- https://core.telegram.org/bots/api
Overview
The Telegram Bot API lets you build bots that send and receive messages, photos, documents, polls, and more inside Telegram — with zero hosting cost for the API itself. Bots are controlled over plain HTTPS calls; Telegram pushes updates to you either via long polling or webhooks.
Getting Started
- Talk to @BotFather in Telegram and run
/newbot. - Copy the bot token — it looks like
123456789:AAHf.... - Verify it works (this is what an invalid token returns — HTTP 401):
curl "https://api.telegram.org/bot123456789:AAHf.../getMe"
- Send your first message:
curl -X POST "https://api.telegram.org/botTOKEN/sendMessage" \
-d chat_id=123456789 -d text="Hello from my bot!"
How updates arrive
| Mode | How it works | Best for |
|---|---|---|
| Long polling | call getUpdates, Telegram holds the connection until an update arrives |
small bots, no public server |
| Webhook | set a public HTTPS URL with setWebhook, Telegram POSTs updates to it |
production bots |
Authentication
- The token IS the authentication — it’s embedded in the URL path (
/bot<TOKEN>/method), not in a header. - Keep it secret: anyone with the token controls your bot. Use environment variables, never commit it.
getMeis the standard token health-check.
Rate Limits & Notes
- No hard rate limit is documented, but Telegram expects bots to respect humans: don’t spam the same chat.
- The API does not set CORS headers — call it from a server, not from browser JavaScript.
sendPhoto/sendDocumentaccept file IDs, URLs, ormultipart/form-datauploads.- For heavy traffic, use webhooks +
max_connectionsinstead of polling.
FAQ
Is the Telegram Bot API free? Yes — creating bots and calling the API is free.
Do I need a server for my bot?
Only for webhook mode. Long-polling (getUpdates) works from any process that can make HTTPS calls.
Can I call it from the browser? Not directly — the API doesn’t send CORS headers and the token would be exposed. Always call from your backend.
More in Social
| API | Auth | HTTPS | CORS | |
|---|---|---|---|---|
| 4chan Simple image-based bulletin board dedicated to a variety of topics | No auth | Yes | Yes | ↗ |
| Ayrshare Social media APIs to post, get analytics, and manage multiple users social media accounts | API Key | Yes | Yes | ↗ |
| aztro Daily horoscope info for yesterday, today, and tomorrow | No auth | Yes | Unknown | ↗ |
| Blogger The Blogger APIs allows client applications to view and update Blogger content | OAuth | Yes | Unknown | ↗ |
| Bluesky Decentralized social networking via the AT protocol | No auth | Yes | Yes | ↗ |