Как узнать chat id для канала (группы) Telegram
Иногда требуется, чтобы бот Telegram, которого вы создаете, умел постить сообщения в сообщество или группу от имени этой самой группы. Но вот незадача — для отправки сообщения нужен ID чата, в который это самое сообщение отправлять. Нужно его каким-то образом получить. Итак, начнем.
Для начала делаем канал публичным. После получения id можно будет снова сделать его частным, если требуется.
Вводим адрес в строку браузера, изменив выделенное на своё:
BOT:TOKEN — токен бота, полученный при его создании.
@имяканала — создается при переводе канала в публичный.
В ответ получите закодированное в json сообщение:
Расшифровывается оно так:
ok: true — запрос успешно выполнен
id: -100xxxxxxx — это и буде ID чата, вводится со знаком минус.
UPDATE: Сделал сервис для быстрого получения Chat id — ССЫЛКА
mraaroncruz / steps.md
@crystalbit I found an alternative way in the meantime.
- Go to https://web.telegram.org
- Click on your channel
- Look at the URL and find the part that looks like c12112121212_17878787878787878
- Remove the underscore and after c12112121212
- Remove the prefixed letter 12112121212
- Prefix with a -100 so -10012112121212
- That’s your channel id.
Soooo stupid, but it is very quick and it works.
mraaroncruz commented Apr 30, 2020
And thanks for the comment!
ZeroDragon commented Aug 20, 2020 •
With the updated solution I did not even had to make my channel public!
japentaca commented Sep 28, 2020
- Go to https://web.telegram.org
- Click on your channel
- Look at the URL and find the part that looks like c12112121212_17878787878787878
- Remove the underscore and after c12112121212
- Remove the prefixed letter 12112121212
- Prefix with a -100 so -10012112121212
- That’s your channel id.
The only solution I found ! ! !
Thanks a lot !
syntaxhacker commented Oct 1, 2020

much easier way .. forward a message from that channel to this @JsonDumpBot bot
can voila there’s your ID
rajesh457 commented Oct 8, 2020
- Go to https://web.telegram.org
- Click on your channel
- Look at the URL and find the part that looks like c12112121212_17878787878787878
- Remove the underscore and after c12112121212
- Remove the prefixed letter 12112121212
- Prefix with a -100 so -10012112121212
- That’s your channel id.
Thank you so much
seupedro commented Jan 28, 2021

You can simply forward a message to @JsonDumpBot.
The bot dumps a complete json of all request that he receives.
NOTE: I’m not affiliate and it’s not my bot.
reasje commented Feb 17, 2021
much more easier way — to write public username to https://t.me/username_to_id_bot and then easily get the id in response
Thanks , worked for me !
OtenMoten commented May 7, 2021 •

much easier way .. forward a message from that channel to this @JsonDumpBot bot
can voila there’s your ID
Yo bro I donate 5 BAT to you because you save me a lot of lifetime.
mansourcodes commented Jun 1, 2021
much more easier way — to write public username to https://t.me/username_to_id_bot and then easily get the id in response
NeihTzxc commented Jul 12, 2021
can’t use this way anymore, do you have any other way?
OtenMoten commented Jul 12, 2021
much more easier way — to write public username to https://t.me/username_to_id_bot and then easily get the id in response
@NeihTzxc use this method.
ttodua commented Jul 22, 2021
a0eoc commented Aug 28, 2021
much easier way .. forward a message from that channel to this @JsonDumpBot bot
Still the easiest way
Thanks
talhazan commented Sep 10, 2021

much easier way .. forward a message from that channel to this @JsonDumpBot bot
can voila there’s your ID
rfwn commented Nov 8, 2021
what if i had a channel id and wanted to get the channel link?
mraaroncruz commented Nov 8, 2021
I still stand by my original solution above where you just have to remove a -100 from a number in a URL.
It feels a bit over-engineered to use a chatbot
mraaroncruz commented Nov 8, 2021
lol and there are three JsonDumpBots. The one that seems to work is the one with the dumptruck icon. But I wouldn’t forward them anything sensitive 😀 😀 😀 😀 😀
ayy-em commented Jan 15, 2022
just wanted to say @syntaxhacker is da MVP for that bot link
myfingerhurt commented Aug 8, 2022
Just right click on channel post and select Copy Post Link , you will get something looks like to this
https://t.me/c/123456789/137
Then do -100 + 123456789 = -100123456789 is your Channel id.

Footer
© 2022 GitHub, Inc.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
How to obtain the chat_id of a private Telegram channel
I use curl to update my public channels. This kind of syntax:
But what’s the chat_id of a private channel? It’s not the one you have in the private invite.
Because now we can pass a channel username (in the format @channelusername) in the place of chat_id in all methods (and instead of from_chat_id in forwardMessage). But what’s the @channelusername of a private channel that I administer?
![]()
15 Answers 15
Trending sort
Trending sort is based off of the default sorting method — by highest score — but it boosts votes that have happened recently, helping to surface more up-to-date answers.
It falls back to sorting by highest score if no posts are trending.
Switch to Trending sort
I found the way to write in private channels.
You should convert it to public with some @channelName
Send a message to this channel through the Bot API:
As the response, you will get information with chat_id of your channel.
Now you can convert the channel back to private (by deleting the channel’s link) and send a message directly to the chat_id "-1001005582487":
![]()
![]()
The easiest way:
Just send your invite link to your private channel to @username_to_id_bot (https://t.me/username_to_id_bot) bot. It will return its ID. The simplest level: maximum! 🙂
PS. I am not an owner of this bot.
PS 2. the Bot will not join your group, but to be sure in security. Just revoke your old invitation link if it is matter for you after bot using.
A more cumbersome way:
Making the channel public cannot be done by the user with exist at least five public groups/channels, so. the problem is not solved. Yes, you can revoke one of them, but for now, we cannot retrieve chat id another way.