To work with Telegram’s MTProto API (for userbots or custom clients), you need two unique identifiers: api_id and api_hash.

Step-by-Step Instructions

  1. Login: Go to my.telegram.org.
  2. Authentication: Enter your phone number in international format. You will receive a confirmation code via the Telegram app (not SMS).
  3. API Development: Click on the “API development tools” link.
  4. Create App: Fill out the form:
    • App title: Any name you prefer.
    • Short name: A simple alphanumeric string.
    • Platform: Select any (e.g., Web or Android).
  5. Save: Click “Create application.” You will now see your App api_id and App api_hash.

Why do you need them?

Unlike the Bot API (used for @BotFather bots), these credentials allow you to:

  • Build custom Telegram clients.
  • Automate your personal account (Userbots).
  • Analyze large amounts of public channel data.
  • Manage account-level settings programmatically.

Security Warning

Keep your api_hash secret. If someone obtains your hash and phone number, they can gain full access to your account. Do not hardcode these values in public GitHub repositories.

Basic Example (Python/Telethon)

from telethon import TelegramClient

api_id = 12345
api_hash = 'your_api_hash_here'

with TelegramClient('session_name', api_id, api_hash) as client:
    client.loop.run_until_complete(client.send_message('me', 'Hello from my blog!'))

Telegram API_ID & API_HASH

Author

xdesai

Publish Date

Feb 02, 2026

License

Unlicensed