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. Lastly, the Gateway API allows any business, app or website to send verification codes through Telegram instead of traditional SMS.
You can also add Telegram Widgets to your website.
Designers are welcome to create Animated Stickers and Emoji or Custom Themes for Telegram.
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. These accounts serve as an interface for code running somewhere on your server.
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. You communicate with this server via a simple HTTPS-interface that offers a simplified version of the Telegram API.
Learn more about the Bot APIBot developers can also make use of our Payments API to accept payments from Telegram users around the world.
TDLib
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, so that you can dedicate more time to design, responsive interfaces and beautiful animations. TDLib supports all Telegram features and makes developing Telegram apps a breeze on any platform. It can be used on Android, iOS, Windows, macOS, Linux and virtually any other system. The library is open source and compatible with virtually any programming language.
Learn more about TDLibGateway API
The Telegram Gateway API allows any business, app or website to send authorization codes through Telegram instead of traditional SMS – offering a powerful and convenient way to lower costs while increasing the security and delivery speed of your codes to Telegram's 1 billion monthly active users.
Users will instantly receive messages with codes in a special chat inside Telegram. Telegram's Gateway API is completely free to test.
Learn more hereTelegram API
This API allows you to 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 of how things work here. Don't forget to register your application in our system.
Register your applicationGetting 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 to a user's account if they have enabled 2FA, how to change password.
QR code login
QR code login flow.
Error handling
How to handle API return errors correctly.
Handling different data centers
How to connect to the closest DC access point for faster interaction with the API.
Handling updates
How to subscribe to updates and handle them properly.
Handling PUSH-notifications
How to subscribe and handle them properly.
Channels, supergroups, gigagroups and basic groups
How to handle channels, supergroups, gigagroups, basic groups, and what's the difference between them.
Forums
Telegram allows creating forums with multiple distinct topics.
Direct messages to channels
Telegram supports direct messages to channels, which can also be used to suggest channel posts.
Channel statistics
Telegram offers detailed channel statistics for channels and supergroups.
Calling methods
Additional options for calling methods.
Uploading and Downloading Files
How to transfer large data batches correctly.
Pagination
How to fetch results from large lists of objects.
Client configuration
The MTProto API has multiple client configuration parameters.
Security
API Methods
Working with Bots
Working with bots, using the MTProto API
How to work with bots using the MTProto API.
Bot API dialog IDs
Convert MTProto peer IDs to bot API dialog IDs and vice versa.
Commands
Bots offer a set of commands that can be used by users in private, or in a chat.
Buttons
Users can interact with your bot via buttons or even inline buttons.
Menu button
Bots can choose the behavior of the menu button shown next to the text input field.
Inline queries
Users can interact with your bot via inline queries.
Games
Bots can offer users HTML5 games to play solo or to compete against each other.
Mini apps
Bots can offer users interactive HTML5 mini apps to completely replace any website.
Affiliate programs
Developers can open affiliate programs for their mini app.
Attachment menu
Bots can install attachment menu entries, offering conveniently accessible mini apps.
Content & Media
Stories
Telegram users and channels can easily post and view stories through the API.
Similar channels and bots
Obtain a list of similarly themed public channels and bots.
Accent colors
Users and channels can change the accent color and background pattern.
Privacy settings
Users can specify granular privacy settings.
Search & filters
Apply detailed message filters while looking for messages in chats.
Polls
Telegram allows sending polls and quizzes.
Checklists
Premium users can create collaborative checklists in any chat.
Reactions
Users can react on any message using specific emojis.
Animated message effects
Adding spectacular animated effects to messages.
Emoji categories
Sticker, custom emoji and GIF selection UIs.
Emoji status
Users can set an emoticon or a custom emoji as status.
Groups & Channels
Invite links and join requests
Private invite links may be further enhanced with per-user join requests.
Admin, banned and default rights
Handle admin permissions, granular bans and global permissions.
Discussion groups
Groups can be associated to a channel as a discussion group.
Channel comments and message threads
Commenting on a channel post or on a generic group message.
Admin log
A log of recent relevant supergroup and channel actions.
Pinned messages
Telegram allows pinning multiple messages on top of a specific chat.
Mentions
Mentioning other users and quickly navigating to those mentions.
Scheduled messages
Telegram allows scheduling messages.
Live geolocations
Sending the live geolocation of a user in a chat.
Monetization
Telegram Stars
Virtual items that allow users to purchase digital goods and services.
Subscriptions
Bots and channels may create subscriptions, periodically charging users.
Gifts
Users can send Gifts to their friends and display them on their profile pages.
Paid media
Content creators can accept Stars by publishing paid photos or videos.
Paid messages
Telegram Stars can be used to pay for sending messages.
Suggested posts
A powerful monetization feature to channel administrators.
Channel and supergroup boosts
Premium users can grant their favorite channels additional features.
Giveaways & gifts
Randomly distribute Telegram Premium subscriptions among followers.
Channel and bot ad revenue
Channel and bot owners can receive 50% of the revenue from ads.
Premium & Business
Other Articles
Saved messages
A personal cloud storage for any messages or media.
Profile
Telegram offers many customization options for your profile.
Themes
Generating, sharing and synchronizing app themes.
Sponsored messages
Support for official sponsored messages in Telegram channels.
Fact-checks
Displaying fact-checks added to messages by independent fact-checkers.
Contacts
Working with contacts in the API.
Blocklist
Working with the blocklist.
Nearby users & chats
Geolocation-based features like geochats and the nearby users feature.
Age verification
Some legislations require age verification to view restricted content.
Deep links
Handle special tg:// and t.me deep links.
Takeout
Export all user information through the takeout API.