<metaproperty="description"content="We offer two kinds of APIs for developers. The Bot API allows you to easily create programs that use Telegram messages for…">
<metaproperty="og:description"content="We offer two kinds of APIs for developers. The Bot API allows you to easily create programs that use Telegram messages for…">
<divid="dev_page_content"><p>We offer two kinds of APIs for developers. The <ahref="#bot-api"><strong>Bot API</strong></a> allows you to easily create programs that use Telegram messages for an interface. The <ahref="#tdlib-build-your-own-telegram"><strong>Telegram API and TDLib</strong></a> allow you to build your own customized Telegram clients. You are welcome to use both APIs free of charge.</p>
<p>You can also add <ahref="/widgets"><strong>Telegram Widgets</strong></a> to your website.</p>
<p>Designers are welcome to create <ahref="/animated_stickers"><strong>Animated Stickers</strong></a> or <ahref="/themes"><strong>Custom Themes</strong></a> for Telegram.</p>
<p>This API allows you to connect bots to our system. <ahref="/bots"><strong>Telegram Bots</strong></a> 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.</p>
<p>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.</p>
<p>Bot developers can also make use of our <ahref="/bots/payments"><strong>Payments API</strong></a> to accept <strong>payments</strong> from Telegram users around the world.</p>
<h3><aclass="anchor"name="tdlib-build-your-own-telegram"href="#tdlib-build-your-own-telegram"><iclass="anchor-icon"></i></a>TDLib – build your own Telegram</h3>
<p>Even if you're looking for maximum customization, you don't have to create your app from scratch. Try our <ahref="https://core.telegram.org/tdlib"><strong>Telegram Database Library</strong></a> (or simply TDLib), a tool for third-party developers that makes it easy to build fast, secure and feature-rich Telegram apps.</p>
<p>TDLib takes care of all <strong>network implementation</strong> details, <strong>encryption</strong> and <strong>local data storage</strong>, so that you can dedicate more time to design, responsive interfaces and beautiful animations.</p>
<p>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 <strong>any programming language</strong>.</p>
<blockquote>
<p><ahref="https://core.telegram.org/tdlib"><strong>Learn more about TDLib here »</strong></a></p>
<p>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 <ahref="https://telegram.org/apps#source-code">source code</a> of existing Telegram applications for examples of how things work here. Don't forget to <ahref="/api/obtaining_api_id">register</a> your application in our system. </p>
<h4><aclass="anchor"name="creating-an-application"href="#creating-an-application"><iclass="anchor-icon"></i></a><ahref="/api/obtaining_api_id">Creating an application</a></h4>
<h4><aclass="anchor"name="handling-different-data-centers"href="#handling-different-data-centers"><iclass="anchor-icon"></i></a><ahref="/api/datacenter">Handling different data centers</a></h4>
<h4><aclass="anchor"name="uploading-and-downloading-files"href="#uploading-and-downloading-files"><iclass="anchor-icon"></i></a><ahref="/api/files">Uploading and Downloading Files</a></h4>
<h4><aclass="anchor"name="end-to-end-encryption-in-voice-and-video-calls"href="#end-to-end-encryption-in-voice-and-video-calls"><iclass="anchor-icon"></i></a><ahref="https://core.telegram.org/api/end-to-end/video-calls">End-to-End Encryption in Voice and Video Calls</a></h4>
<h4><aclass="anchor"name="working-with-bots-using-the-mtproto-api"href="#working-with-bots-using-the-mtproto-api"><iclass="anchor-icon"></i></a><ahref="/api/bots">Working with bots, using the MTProto API</a></h4>
<p>Users can interact with your bot via <strong>buttons</strong> or even <strong>inline buttons</strong>, straight from inline <strong>messages</strong> in <strong>any</strong> chat. </p>
<p>Users can interact with your bot via <strong>inline queries</strong>, straight from the <strong>text input field</strong> in <strong>any</strong> chat. </p>
<p>Bots can offer users HTML5 games to play solo or to compete against each other in groups and one-on-one chats; how to work with games in the MTProto API.</p>
<h4><aclass="anchor"name="search-amp-filters"href="#search-amp-filters"><iclass="anchor-icon"></i></a><ahref="/api/search">Search & filters</a></h4>
<p>Telegram allows applying detailed message filters while looking for messages in chats.<br>This allows the server to filter messages based on a text query, and even on their type, and this feature is often used by graphical clients to implement features like the chat gallery, chat profile pictures and more.</p>
<h4><aclass="anchor"name="invite-links-and-join-requests"href="#invite-links-and-join-requests"><iclass="anchor-icon"></i></a><ahref="/api/invites">Invite links and join requests</a></h4>
<p>Channels, basic groups and supergroups may have a public username or a private invite link: private invite links may be further enhanced with per-user join requests.</p>
<h4><aclass="anchor"name="admin-banned-and-default-rights-for-channels-supergroups-and-gro"href="#admin-banned-and-default-rights-for-channels-supergroups-and-gro"><iclass="anchor-icon"></i></a><ahref="/api/rights">Admin, banned and default rights for channels, supergroups and groups</a></h4>
<p><ahref="/api/channel">Groups</a> can be associated to a <ahref="/api/channel">channel</a> as a <ahref="https://telegram.org/blog/privacy-discussions-web-bots">discussion group</a>, to allow users to discuss about posts. </p>
<h4><aclass="anchor"name="channel-comments-and-message-threads"href="#channel-comments-and-message-threads"><iclass="anchor-icon"></i></a><ahref="/api/threads">Channel comments and message threads</a></h4>
<p>Telegram allows commenting on a <ahref="/api/channel">channel post</a> or on a generic <ahref="/api/channel">group message</a>, thanks to message threads.</p>
<p>Both supergroups and channels offer a so-called <ahref="https://telegram.org/blog/admin-revolution">admin log</a>, a log of recent relevant supergroup and channel actions, like the modification of group/channel settings or information on behalf of an admin, user kicks and bans, and more. </p>
<p>Telegram allows mentioning other users in case of urgent duckling matters, and quickly navigating to those mentions in order to read them as swiftly as possible.</p>
<p>Sometimes, <ahref="/constructor/user">user</a> and <ahref="/constructor/channel">channel</a> constructors met in group chat updates may not contain full info about the user: how to handle such constructors.</p>
<h4><aclass="anchor"name="styled-text-with-message-entities"href="#styled-text-with-message-entities"><iclass="anchor-icon"></i></a><ahref="/api/entities">Styled text with message entities</a></h4>
<h4><aclass="anchor"name="working-with-animated-emojis"href="#working-with-animated-emojis"><iclass="anchor-icon"></i></a><ahref="/api/animated-emojis">Working with animated emojis</a></h4>
<h4><aclass="anchor"name="working-with-animated-dice"href="#working-with-animated-dice"><iclass="anchor-icon"></i></a><ahref="/api/dice">Working with animated dice</a></h4>
<p>If <ahref="/method/contacts.toggleTopPeers">enabled</a>, the rating of <ahref="/constructor/topPeer">top peers</a> indicates the relevance of a frequently used peer in a certain <ahref="/type/TopPeerCategory">category</a> (frequently messaged users, frequently used bots, inline bots, frequently visited channels and so on).</p>