getUpdates inspector

Paste the JSON from Telegram’s getUpdates and this inspector lists every chat ID, user ID, topic ID, forward origin and sticker ID in it. It works for any chat, private or public, and fixes the common case of a getUpdates result that comes back empty. Parsed in your browser.

getUpdates inspector

Paste what getUpdates returned (or a single update or message). Every ID in it is listed. Read in your browser — nothing is uploaded.

1 · Fetch your bot's updates in a terminal
# in your own terminal: $TOKEN is your bot's token, which never goes into this page
curl -s "https://api.telegram.org/bot$TOKEN/getUpdates"

Where each ID sits

Chatmessage.chat.id
Sendermessage.from.id
Channel postchannel_post.chat.id
Forum topicmessage.message_thread_id
Forwarded frommessage.forward_origin
Bot added to a chatmy_chat_member.chat.id

How getUpdates works

getUpdates is the simplest way for a bot to receive what happens: the bot asks, Telegram answers with the updates waiting for it. Each update has an update_id and one object, such as message, channel_post, my_chat_member or callback_query, and inside it the chat and the sender with their IDs.

A worked example

Create a bot with @BotFather, add it to your private group and send /start@yourbot there. Open the getUpdates URL for your bot in a browser, copy the JSON and paste it here. The inspector shows the group as a chat with a negative ID, and you as the sender with a positive ID. Those are the two numbers most automation tools ask for.

When the result is empty

  • Nobody has written to the bot since the last call that confirmed the updates. Send a message and call again.
  • A webhook is set. Then getUpdates answers 409 Conflict; remove the webhook with deleteWebhook or read the updates on your server.
  • Privacy mode is on and the message in the group was not a command, a reply to the bot or a mention.
  • More than 24 hours passed. Telegram does not keep updates longer.

Offset and confirmation

Calling getUpdates with offset set to the last update_id plus one tells Telegram those updates were handled; they are not sent again. Without an offset you see the same updates on every call, up to 100 at a time.

FAQ

Where is the chat ID in getUpdates?

In result[n].message.chat.id. For a channel post it is result[n].channel_post.chat.id. The sender's user ID is message.from.id.

Why is my getUpdates result empty?

Either nobody has written to the bot since the last call, or a webhook is set (then getUpdates does not work), or the bot is in a group with privacy mode on and only receives commands, mentions and replies. Send /start to the bot and call it again.

How long does Telegram keep updates?

Up to 24 hours. An update that was already confirmed with a higher offset is gone.

Is my pasted JSON sent anywhere?

No. It is parsed by JavaScript in your browser. The page makes no request with it.

What is the getUpdates URL?

The Bot API method URL for your bot followed by /getUpdates, opened in a browser or with curl. The inspector page shows the exact command once you choose to run it yourself.

What does 409 Conflict on getUpdates mean?

A webhook is set for the bot. getUpdates and a webhook cannot be used together; call deleteWebhook to switch back to polling.