Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add Millions of contacts to telegram?

My goal is to add 10M contacts to telegram.

How can we add contacts to telegram using telegram API? I have tried using telethon in which I batched 500 contacts in one request. However, telegram responded all such requests with all contacts in retry_contacts and none were imported.

I have also found out a solution to convert the txt file of 10M contacts to csv file and import them using an android app. But this takes approx 10 mins for 10k contacts. So this won't be a good idea for adding 10M contacts.

Any other method for having this done is also welcomed.

like image 952
Shreeya Patel Avatar asked Mar 04 '23 22:03

Shreeya Patel


1 Answers

This is not possible. Telegram has deliberately set limits on the number of contacts you can add. Initially you can add about 5000 contacts and after that you can add about 100 more every day. This is because of security not decreasing their API load. If you could add 10M numbers, you could easily map @usernames to numbers which is against Telegram privacy policy.

In my experience, the best practical option is to add an array of 10 numbers each time using telethon's ImportContactsRequest, until you get locked. Then try 24 hours later again until you get locked again, and so on. This is the fastest solution and due to Telegram restrictions, if you only have 1 SIM card, it takes around 274 years to add 10M contacts.

like image 117
Ali Hashemi Avatar answered Mar 10 '23 12:03

Ali Hashemi