Telegram exporter
Skill 0xdeval/telegram-exporter/.claude/skills/telegram-exporter
A Python CLI tool for exporting Telegram group member lists to JSON files using your personal account. LLM support is included via Claude Code skillsFrom the repository description
npx -y skills add 0xdeval/telegram-exporter --skill telegram-exporterAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
4.6 KB, ~1.3k tokens by cl100k_base, as published. Nobody here has run it
telegram-exporter
Export members from Telegram groups into JSON files using your personal account.
Overview
This skill allows you to export member lists from Telegram groups without leaving Claude Code. It uses the Telegram user API (not Bot API) with built-in safety features:
- Sequential processing (no parallel requests)
- Rate-limit detection and graceful handling
- 2-second delays between requests
- Session persistence
- Deduplication and filtering
Usage
Export members from one or multiple Telegram groups by providing:
- Group ID(s) - Single ID or comma-separated list (fastest, no full scan)
- Group name(s) - By name or partial match
Examples
Export one group by ID:
/telegram-exporter --id 2805943040
Export multiple groups by IDs (comma-separated):
/telegram-exporter --ids 2805943040,1234567890,9876543210
Export groups by name (partial match):
/telegram-exporter --names MyGroup "Work Team"
List all groups with their IDs:
/telegram-exporter --list
Getting Group IDs
Method 1: List All Groups
/telegram-exporter --list
Method 2: From web.telegram.org
- Open https://web.telegram.org
- Click the group
- Extract ID from URL:
Use:https://web.telegram.org/a/#-1002805943040 ^^^^^^^^^^^^^^2805943040(without the-100prefix)
Configuration
All settings are in the project's .env file. Key options:
| Option | Default | Purpose |
|---|---|---|
TELEGRAM_API_ID | Required | API credential from my.telegram.org |
TELEGRAM_API_HASH | Required | API credential from my.telegram.org |
TELEGRAM_PHONE | Required | Your phone number with country code |
DRY_RUN | false | Test without saving files |
MAX_GROUPS | 0 | Limit number of groups (0 = unlimited) |
MAX_MEMBERS_PER_GROUP | 0 | Limit members per group (0 = unlimited) |
DELAY_BETWEEN_REQUESTS_MS | 2000 | Delay between requests (ms) |
Output
Creates JSON files in exports/ folder, one per group:
File: GroupName.json
{
"group_name": "Coinly",
"members": [
{
"telegram_username": "alice_smith",
"telegram_userhandle": "@alice_smith"
},
{
"telegram_username": "bob_jones",
"telegram_userhandle": "@bob_jones"
}
],
"exported_at": "2026-03-17T14:23:45.123Z",
"total_members": 2
}
Features
- ✅ One file per group
- ✅ Members with public usernames only
- ✅ Automatic deduplication
- ✅ Excludes users in
exclude_list.json(if exists) - ✅ ISO 8601 timestamps
Exclude List
Create exclude_list.json in project root to filter users:
[
"@spam_bot",
"@fake_user",
"another_handle"
]
Users in this list won't appear in exports. Handles work with or without @ prefix.
Testing
Use dry-run mode to test without saving files:
-
Edit
.env:DRY_RUN=true MAX_GROUPS=1 -
Run:
/telegram-exporter --id 2805943040 -
Check console output for what would be saved
-
When ready, change
DRY_RUN=falseand run again
First Setup
-
Get API credentials:
- Visit https://my.telegram.org/apps
- Log in with your Telegram account
- Create app and copy API_ID and API_HASH
-
Configure:
- Edit
.envwith your credentials:TELEGRAM_API_ID=your_id TELEGRAM_API_HASH=your_hash TELEGRAM_PHONE=+1234567890
- Edit
-
List groups:
/telegram-exporter --listFirst run will prompt for verification code via Telegram
-
Export:
/telegram-exporter --id 2805943040
Safety Features
- Rate limit protection - Detects and stops gracefully on rate limits
- Sequential processing - One group at a time, never parallel
- Configurable delays - 2000ms default + random jitter
- Session persistence - Logs in once, reuses session
- Graceful errors - Skips inaccessible groups, logs warnings
- Data filtering - Deduplicates, excludes empty entries, filters excluded users
Troubleshooting
"Invalid group ID"
- Ensure ID is a number
- Remove any minus sign: use
2805943040not-1002805943040
"Group not found"
- Check spelling with
/telegram-exporter --list - Use exact group name
Rate Limited
- Increase delays in
.env:DELAY_BETWEEN_REQUESTS_MS=5000 DELAY_JITTER_MS=2000 - Wait 60+ seconds before retrying
Need to Re-login
- Delete session:
rm telegram_session.session - Run again, you'll be prompted for verification code
Documentation
- Full project README:
README.md - Configuration guide:
.env.example - Exclude list example:
exclude_list.json.example
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.