skip to Main Content

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


  1. 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.

    Login or Signup to reply.
  2. Can anyone point me to a way to get a list of all public channels and member counts?

    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.


    Any idea how these channel directory sites get their data if the apis don’t exist

    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:

    1. SearchGlobalRequest: Search for channels using (eg) some keyword:
    2. Loop over the result of (1)
    3. getFullChannel get information about channel
    4. Write to DB
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search