A Python-based tool that fetches similar channel recommendations from Telegram and exports them to Google Sheets.
- Fetch similar Telegram channels via Telegram's official API
- Process and organize channel data with proper metadata
- Export results to Google Sheets
- Support multiple input methods (CLI, file, Google Sheets)
- Proper error handling and logging
- Rate limiting protection to avoid Telegram API limits
- Python 3.7+
- Telegram API credentials (API ID and API Hash)
- Google Sheets API credentials (service account JSON file)
- Clone this repository
- Install the required packages:
pip install -r requirements.txt - Copy
.env.exampleto.envand fill in your credentials - Prepare your Google Sheets service account JSON file
- Visit my.telegram.org/apps
- Log in with your Telegram account
- Fill in the form with any name and description
- Get your API ID and API Hash
- Add these values to your
.envfile
- Go to Google Cloud Console
- Create a new project or select an existing one
- Enable the Google Sheets API and Google Drive API
- Create a service account
- Download the service account JSON key file
- Place this file in your project directory and update the path in your
.envfile
The script supports three methods of inputting channel usernames:
python telegram_crawler.py --channels channelname1 channelname2 channelname3