Credentials. The export needs your Telegram API_HASH and a Telethon session file, so keep .env and the sessions folder private and out of shared repos.
Who it is forA community manager or analyst who needs a full local copy of a channel's discussion for review or reporting.
The problemComment threads and reactions in Telegram are hard to analyze in the app and cannot be filtered or summarized offline.
The outcomeA dated JSON export in data/raw that the dashboard can open and that other tools can read.
What you need first
- Docker Desktop (recommended) or Python with the packages in requirements.txt
- Telegram API credentials: API_ID and API_HASH from https://my.telegram.org/apps
- A Telegram account session for Telethon, needed only for live exports
Steps
- Get
API_IDandAPI_HASHathttps://my.telegram.org/apps. - Run
docker compose up --buildonce so Docker creates.envfrom.env.example. - Open
http://localhost:9595, then fill in the Telegram settings in the Export tab. - Run
docker compose run --rm cli export jsonto start the export from the command line. - Open the new file under
data/raw/in the dashboard.
Prompt for your agent
In the TheMyxa/telegram-parser repo, configure .env with API_ID, API_HASH, CHANNEL set to <channel-username>, and TELEGRAM_SESSION, then run `docker compose run --rm cli export json`. Expected output is a new JSON file in data/raw/. Verify the file exists and contains a list of posts before reporting success.
Caveat. Live exports need your own Telegram account session, and the README does not describe how the session file is created.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for TheMyxa/telegram-parser and "Export a Telegram channel's posts and comments to JSON"
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer