Telegram has always been an important source of information for everyone, and it is also one of the valuable resources for open source intelligence. I recommend a handy tool called telegram-phone-number-checker, which is used to check if a phone number is registered on Telegram and retrieve information.
The code can be found at: https://github.com/bellingcat/telegram-phone-number-checker
The tool is written in Python and can check one or multiple numbers at once. It takes about one second to complete, and the information results are in a useful JSON format. The test results are as follows:
Tool Introduction:
The telegram-phone-number-checker tool is used to identify Telegram users through phone numbers. With this tool, you will collect usernames, display names, and other valuable information related to the target phone number on Telegram.
This tool requires a Telegram API key to work. Obtaining a Telegram API key is free. First, go to Telegram and create an account with a valid phone number (if you don't already have one).
It is recommended to use a disposable phone number, but your personal device is also fine. Remember that someone can use this tool with your phone number.
Running this tool requires:
- A Telegram account with a valid phone number
- Telegram API ID and API HASH, which you can obtain by creating a developer account at https://my.telegram.org/. Put these values in a .env file along with the phone number of your Telegram account:
API_ID=
API_HASH=
PHONE_NUMBER=
If you don't create this file, you can also provide these 3 values when calling the tool, or run the program with interactive prompts to input them.
Usage:
This tool accepts a comma-separated list of phone numbers to check, which you can pass as information when calling the tool or interactively.
See the examples below:
Check one number:
telegram-phone-number-checker --phone-numbers +1234567890
Check multiple numbers:
telegram-phone-number-checker --phone-numbers +1234567890,+9876543210,+111111111
Interactive version, the system will prompt you to enter phone numbers:
telegram-phone-number-checker
Override the telegram API key in .env (or if .env is not found):
telegram-phone-number-checker --api-id YOUR_API_KEY --api-hash YOUR_API_HASH --api-phone-number YOUR_PHONE_NUMBER --phone-numbers +1234567890
The query results will be output to the console and also written to a file in JSON format. You can write it to another file by adding --output your_filename.json to the command.
For each phone number, you may receive one of the following possible responses:
- If available, you will receive the Telegram username, name, and ID associated with that number.
- "No username detected." This means that the number seems to be used for creating a Telegram account, but the user has not chosen a Telegram username. You can choose to create a username on Telegram.
- "Error: No response, user does not exist or has blocked adding contacts." The reasons for this response can be multiple. The phone number has not been used to create a Telegram account. Or: the phone number is linked to a Telegram account, but the user has restricted the option to be found by their phone number.
- Or: another error occurred.