Sticker and custom emoji ID

How to get a Telegram sticker file_id, its set name and a custom_emoji_id: send the sticker or emoji to a bot and read the update. The inspector below pulls each ID out of the getUpdates JSON in your browser.

Steps

  1. Send the sticker or emoji to a bot

    A bot you created with @BotFather. For a custom emoji, send it inside a text message.

  2. Call getUpdates

    Run the command shown in the inspector.

  3. Read message.sticker

    file_id, set_name and — for custom emoji — custom_emoji_id. Emoji inside text are in message.entities.

A whole set at once

If you know the set's name (from its t.me/addstickers/… or t.me/addemoji/… link):

curl -s "https://api.telegram.org/bot$TOKEN/getStickerSet" \
  -d name=<set name>

The inspector reads that answer too.

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"

file_id, file_unique_id and custom_emoji_id

A sticker in an update carries several identifiers, and they do different jobs.

  • file_id: what your bot passes to sendSticker to send that sticker. It is valid only for the bot that received it.
  • file_unique_id: the same for every bot, so useful to recognise a sticker or store it, but it cannot be used to send it.
  • set_name: the sticker pack, the part after t.me/addstickers/.
  • custom_emoji_id: on custom emoji, the ID used in message entities and emoji-related methods.

A worked example

You want your bot to answer “thanks” with a particular sticker. Send that sticker to the bot, call getUpdates and paste the JSON. Copy message.sticker.file_id. From then on, sendSticker with that value sends exactly that sticker, from that bot. Another bot needs its own file_id, obtained the same way.

Whole sets

To list every sticker in a pack, call getStickerSet with the set name. The answer lists each sticker with its file_id, so you do not have to send them one by one.

A common mistake

Sharing a file_id between bots, or between a test bot and the live one. It fails with “wrong file identifier”. Store file_unique_id to recognise a sticker, and get each bot its own file_id.

FAQ

How do I find a custom emoji ID?

Send a message containing the custom emoji to a bot and look at message.entities: the entity of type custom_emoji carries custom_emoji_id. A custom emoji sent as a sticker has it in message.sticker.custom_emoji_id.

Is a sticker file_id the same for every bot?

No. A file_id is only valid for the bot that received it. file_unique_id is the same for all bots but cannot be used to send the sticker.

How do I list all stickers of a set?

Call getStickerSet with the set's name (the part after t.me/addstickers/ or t.me/addemoji/). The answer lists every sticker with its file_id and, for emoji sets, custom_emoji_id.

Where can a bot use a custom_emoji_id?

In message entities of type custom_emoji, in getCustomEmojiStickers, as a forum topic icon and in a few other fields. Which bots may send custom emoji in messages is restricted by Telegram; see the Bot API documentation of MessageEntity.

Does a sticker file_id expire?

Telegram does not state an expiry for file_id values a bot received. They are tied to the bot, so they stop working for any other bot.