telegram-export
Installation
SKILL.md
telegram-export
Overview
Export messages, media, and data from Telegram chats, groups, and channels. This skill covers two approaches: Telegram Desktop's built-in export (GUI, good for personal use) and Telethon (Python library for programmatic access through Telegram's MTProto API, signed in as your own account). Use cases range from personal chat backups to bulk media download from channels to data analysis of group conversations.
Instructions
Step 1: Get Telegram API Credentials
All programmatic approaches require API credentials from Telegram.
- Go to https://my.telegram.org and log in with your phone number.
- Click "API development tools."
- Create a new application — fill in app title and short name (anything works).
- Save your
api_id(integer) andapi_hash(string).
The credentials are free and tied to your Telegram account: one api_id per phone number. The api_hash is a secret that Telegram does not let you revoke, so keep both in environment variables (TELEGRAM_API_ID, TELEGRAM_API_HASH), never in a script.