Telegram APIs
We offer three kinds of APIs for developers. The Bot API allows you to easily create programs that use Telegram messages for an interface. The Telegram API and TDLib allow you to build your own customized Telegram clients. You are welcome to use both APIs free of charge.
Bot API
This API allows you to connect bots to our system. Telegram Bots are special accounts that do not require an additional phone number to set up.
To use this, you don't need to know anything about how our MTProto encryption protocol works — our intermediary server will handle all encryption and communication with the Telegram API for you.
Learn more about the Bot APITDLib
Build your own Telegram apps with our Telegram Database Library - a tool for third-party developers that makes it easy to build fast, secure and feature-rich Telegram apps.
TDLib takes care of all network implementation details, encryption and local data storage. It's open source and compatible with virtually any programming language.
Learn more about TDLibGateway API
Send verification codes through Telegram instead of traditional SMS – lower costs while increasing security and delivery speed.
Users instantly receive messages with codes in a special chat inside Telegram. Telegram's Gateway API is completely free to test.
Learn more about Gateway APITelegram API
Build your own customized Telegram clients. It is 100% open for all developers who wish to create Telegram applications on our platform.
Feel free to study the open source code of existing Telegram applications for examples. Don't forget to register your application in our system.
Learn more about Telegram APIGetting Started
Creating an application
How to get your application identifier and create a new Telegram app.
User authorization
How to register a user's phone to start using the API.
Two-factor authentication
How to login if 2FA is enabled, how to change password.
QR code login
QR code login flow for quick authentication.
Error handling
How to handle API return errors correctly.
Handling updates
How to subscribe to updates and handle them properly.
Security
Working with Bots
Using MTProto API
How to work with bots using the MTProto API.
Commands
Bots offer commands that can be used by users in private or chat.
Buttons
Users can interact via buttons or inline buttons from any chat.
Inline queries
Users can interact via inline queries from the text input field.
Games
Bots can offer users HTML5 games to play solo or compete.
Mini apps
Bots can offer interactive HTML5 mini apps to replace any website.
Groups & Channels
Channels, supergroups, gigagroups
Understanding the differences between group types.
Forums
Creating forums with multiple distinct topics.
Channel statistics
Detailed channel statistics for channels and supergroups.
Discussion groups
Associate groups with channels for post discussions.
Invite links and join requests
Public usernames and private invite links with join requests.
Admin rights and permissions
Handle admin permissions and granular bans.
Premium & Monetization
Telegram Premium
Optional subscription service with additional features.
Telegram Business
Business features like opening hours, quick replies, and more.
Telegram Stars
Virtual items for purchasing digital goods and services.
Subscriptions
Create subscriptions charging users Telegram Stars.
Channel boosts
Premium users can grant channels additional features.
Giveaways & gifts
Distribute Premium subscriptions among followers.