Get Telegram Group Members with Python and Telethon
Telegram is one of the best communications apps around the world. People usually use Telegram for managing their communities and promotions. In this tutorial, you will learn how to use Telegram API extract group members.
Let’s get the your telegram api_id and api_hash values. Go to my.telegram.org you will see this are:

Log in here to manage your apps using Telegram API or delete your account. Enter your number and we will send you a confirmation code via Telegram (not SMS).
After login, you will see this picture:

Click on API development tools and fill the required fields. You can choose any name for your app. For example I choosed demo1. After submitting, you will receive App api_id and api_hash like on the picture.

Please save your api_id and api_hash values to somewhere. You will use these api_id and api_hash to login to Telegram API.
What is Telethon?
Telethon is an asyncio Python 3 MTProto library to interact with Telegram’s API as a user or through a bot account. This library is meant to make it easy for you to write Python programs that can interact with Telegram. Think of it as a wrapper that has already done the heavy job for you, so you can focus on developing an application.
Let’s install telethon using pip:
pip install telethonAfter installing telethon library. Here is the all code block with statements.






