I’m in the process of experimenting and learning the Telegram API and bot system.
Can anyone point me to a way to get a list of all public channels and member counts? I’m interested in all channels and not just the ones that I am a member of.
I do see some sites that list all channels which seem to be presenting themselves as directory services. Googling the question does not come up with much.
Does the Telegram API provide this information, or do I have to scrape this myself?
Thank you in advance.
2
Answers
tele bot api can’t do this job. This api bot acts as a client generally, not as a server side.
unless the bot is there first, at the start of the channel. give him the task to
record in a special log like a spreadsheet who joined, what date, etc.
There is no Bot API route to get this information.
The only route that comes near is to use the
getFullChannel
method from the Telegram Core API. This will provide you with channel information and members, but your user must be a member of the channel.They’ve probably made a custom Telegram client, for example using Telethon, which let there user join the Channel, and then use the mentioned method from above to scrape the channel info and member count, store that to a private database and show those results on the site you’ve linked.
Again, no automatic system, but custom using the Telegram Core API (MTProto).
So to give you an idea how to approach this using a MT Proto lib:
SearchGlobalRequest
: Search for channels using (eg) some keyword:getFullChannel
get information about channel