How to use the API to obtain the number of participants of the channel of the Telegrams?

Hello! Please help to find a team, how to use the API in Telegram it is possible to obtain the value of the number of subscribers on the channel that I signed. Thanks in advance!
June 14th 19 at 20:33
3 answers
June 14th 19 at 20:35
June 14th 19 at 20:37
Palud a close:
Hey, I for his use of banned
June 14th 19 at 20:39
Using Python 3 is very simple:

from time import sleep

from telethon import TelegramClient

from import GetParticipantsRequest
from import ChannelParticipantsSearch

api_id = <app_id>
api_hash = '<app_hash>'
phone = '+88005553535'
group_link = '<group_hash>'

client = TelegramClient('session_name', api_id, api_hash)
channel = client.get_entity(group_link)

if not client.is_user_authorized():
 client.sign_in(phone input('Please Enter the verification code: '))

def get_users(a_channel):
 offset = 0
 limit = 100
 all_participants = []
 while True:
 participants = client.invoke(GetParticipantsRequest(
 a_channel, ChannelParticipantsSearch("), offset, limit, hash=0
 if not participants.users:
 offset += len(participants.users)
 return all_participants

def print_users(a_users):
 for user in a_users:


Read more:

Find more questions by tags PHPMessengersTelegramHTMLJavaScript