A tool for exporting Telegram group chats into static websites like mailing list archives.
Python
1,173
85 commits
updated Mar 1, 2026

tg-archive is a tool for exporting Telegram group chats into static websites, preserving chat history like mailing list archives.
IMPORTANT: I'm no longer actively maintaining or developing this tool. Can review and merge PRs (as long as they're not massive and are clearly documented).
The @fossunited Telegram group archive.

tg-archive uses the Telethon Telegram API client to periodically sync messages from a group to a local SQLite database (file), downloading only new messages since the last sync. It then generates a static archive website of messages to be published anywhere.
Get Telegram API credentials. Normal user account API and not the Bot API.
Install with: uv pip install tg-archive (tested with Python 3.13.2).
tg-archive --new --path=mysite (creates a new site. cd into mysite and edit config.yaml).tg-archive --sync (syncs data into data.sqlite).
Note: First time connection will prompt for your phone number + a Telegram auth code sent to the app. On successful auth, a session.session file is created. DO NOT SHARE this session file publicly as it contains the API autorization for your account.tg-archive --build (builds the static site into the site directory, which can be published)Edit the generated template.html and static assets in the ./static directory to customize the site.
Licensed under the MIT license.
Overall
Maintained
Code review
PyPI
Latest release
Releases this year
2,245 followers · starred Dec 2022
285 followers · starred Mar 2021
71 followers · starred Aug 2024
263 followers · starred Apr 2025
A tool for exporting Telegram group chats into static websites like mailing list archives.
Python
1,173
85 commits
updated Mar 1, 2026

tg-archive is a tool for exporting Telegram group chats into static websites, preserving chat history like mailing list archives.
IMPORTANT: I'm no longer actively maintaining or developing this tool. Can review and merge PRs (as long as they're not massive and are clearly documented).
The @fossunited Telegram group archive.

tg-archive uses the Telethon Telegram API client to periodically sync messages from a group to a local SQLite database (file), downloading only new messages since the last sync. It then generates a static archive website of messages to be published anywhere.
Get Telegram API credentials. Normal user account API and not the Bot API.
Install with: uv pip install tg-archive (tested with Python 3.13.2).
tg-archive --new --path=mysite (creates a new site. cd into mysite and edit config.yaml).tg-archive --sync (syncs data into data.sqlite).
Note: First time connection will prompt for your phone number + a Telegram auth code sent to the app. On successful auth, a session.session file is created. DO NOT SHARE this session file publicly as it contains the API autorization for your account.tg-archive --build (builds the static site into the site directory, which can be published)Edit the generated template.html and static assets in the ./static directory to customize the site.
Licensed under the MIT license.
Overall
Maintained
Code review
PyPI
Latest release
Releases this year
2,245 followers · starred Dec 2022
285 followers · starred Mar 2021
71 followers · starred Aug 2024
263 followers · starred Apr 2025