How to get a Telegram chat_id

Every Telegram bot needs a chat_id to send messages. Here are three reliable ways to find one — for private DMs, groups, supergroups, and channels.

Method 1 — getUpdates (fastest, no extra tools)

  1. Add your bot to the target chat (or DM it).
  2. Send any message in that chat.
  3. Open this URL in your browser, replacing <TOKEN>:
    https://api.telegram.org/bot<TOKEN>/getUpdates
  4. Look for "chat":{"id":...} in the JSON response. That number is your chat_id.

Gotcha: getUpdates only returns recent unconsumed updates. If your bot already has a webhook configured, you'll get an empty response — remove the webhook with /deleteWebhook first, or use method 2.

Method 2 — @userinfobot (for users), @RawDataBot (for any chat)

Method 3 — tgkit's resolver

For public channels, groups, or users, paste the username into Get Telegram ID. Returns the numeric ID immediately. Useful when you don't have access to add a bot.

chat_id formats by type

Private DM with a user123456789 (positive)
Basic group-123456789 (negative)
Supergroup / channel-1001234567890 (starts with -100)
Anonymous channel adminThe chat_id of the channel, not the user

Common errors

"Bad Request: chat not found"

The bot isn't a member of the chat, or you passed a username for a chat that doesn't have one. For private chats you must use the numeric ID of a user who has DM'd your bot at least once.

"Forbidden: bot was blocked by the user"

The user blocked your bot. You'll need them to unblock or restart it.

"Forbidden: bot is not a member of the supergroup chat"

Add the bot to the group. For channels, also promote it to admin if you want to post messages.

Quick code samples

Python (python-telegram-bot)

from telegram import Bot
bot = Bot(token="YOUR_TOKEN")
await bot.send_message(chat_id=-1001234567890, text="hello")

curl

curl -s "https://api.telegram.org/bot$TOKEN/sendMessage" \
  -d chat_id=-1001234567890 \
  -d text="hello"

Node.js (node-telegram-bot-api)

const TelegramBot = require("node-telegram-bot-api");
const bot = new TelegramBot(process.env.TOKEN);
bot.sendMessage(-1001234567890, "hello");

Need to verify a token first? Use the Bot Token Tester.

Related tools