# tg-archive

> Syncs a Telegram group's messages and media into SQLite and builds a static, browsable website archive of the chat.

Source: https://osinttools.io/tools/tg-archive/ (Markdown view of an OSINTtools.io page; append `.md` to any page URL for this format).

- **Inputs:** Username, URL
- **Category:** Data capturing
- **Pricing:** Free, open source
- **Footprint:** passive (does not contact the target)
- **Account required:** yes, for full results
- **API:** no public API
- **Platforms:** Python CLI
- **Website:** https://github.com/knadh/tg-archive
- **GitHub:** knadh/tg-archive, 1,176 stars · Python · MIT · last commit 2026-03-01
- **Listed:** Dec 3
- **Last verified by an editor:** Dec 3, 2026

## What it does

tg-archive is a Python command-line tool that logs in with a Telegram user account through the API, copies a group's messages into a local SQLite file and then renders them as a static website laid out like a mailing-list archive. Later syncs fetch only messages newer than the last run, and it can download avatars, photos, documents and other media and embed them in the pages.

Investigators use it to keep a dated, readable copy of a group they are a member of, with year, month and day indexes, reply links between messages and an RSS feed of recent posts. Its author states it is no longer actively developed, though pull requests are still reviewed.

Footprint is passive: it reads its own index or third-party records and does not contact the target. An account is needed for full results. There is no public API.

## Features

- Incremental sync of group messages to SQLite
- Downloads avatars and media
- Static HTML archive with date indexes
- Reply links across pages
- Poll results rendered
- RSS / Atom feed of recent messages

## Pros

- Output is plain files you can keep, hash or host anywhere
- Resumable: a sync can be stopped and continued
- Single editable HTML template

## Cons

- Needs a Telegram api_id and api_hash and a logged-in account (use a research account)
- No longer actively developed by its author
- Long histories and large media can hit Telegram's rate limits

## When to use it

- Use it when you need a browsable offline copy of a group you have joined, kept up to date on a schedule.
- Use it when you want a group's history preserved as static pages rather than inside the Telegram app.

## Quick start

Install and build an archive:

```
uv pip install tg-archive
tg-archive --new --path=mysite
cd mysite
tg-archive --sync
tg-archive --build
```

## Alternatives

- [tdl](https://osinttools.io/tools/tdl/): Go command-line toolkit that downloads files from Telegram chats, including protected ones, and exports messages and members to JSON. (Open source · URL, Username · passive · 8,347 GitHub stars)
- [Telegram Media Downloader](https://osinttools.io/tools/telegram-media-downloader/): Python script that downloads every photo, video, voice note and document from chats or channels you belong to, picking up where it stopped. (Open source · Username, URL · passive · 2,769 GitHub stars)
- [Telegram Archive](https://osinttools.io/tools/telegram-archive/): Self-hosted, scheduled backup of your Telegram account that keeps edits and deleted messages, with a searchable local web viewer. (Open source · Username, URL · passive · 263 GitHub stars)
- [TgWitness](https://osinttools.io/tools/tgwitness/): Self-hosted Telegram archiver that keeps observed edits and deletions and exports signed, timestamped HTML, JSON and PDF records. (Open source · Username, URL · passive · 246 GitHub stars)
- [ta (Telegram Archive)](https://osinttools.io/tools/ta-telegram-archive/): Go command-line and terminal app that backs up chats, groups and channels to Desktop-style JSON or offline HTML with media. (Open source · Username, URL · passive · 78 GitHub stars)
- [SockPuppet](https://osinttools.io/tools/sockpuppet/): Managed platform that gives investigation teams isolated research environments, virtual phones and managed research personas. (Paid · Username, URL · depends)

All alternatives to tg-archive in one table: https://osinttools.io/tools/tg-archive/alternatives/

## Change history

- 2026-12-03: Listed in the directory.

Feed of changes to tg-archive: https://osinttools.io/tools/changes/feed.xml?tool=tg-archive

---

Listings on OSINTtools.io are reviewed by editors and re-verified on a schedule; check pricing and availability on the vendor's site before relying on them, and use OSINT tools only with a lawful basis.
Site index for agents: https://osinttools.io/llms.txt · Full catalog: https://osinttools.io/llms-full.txt · MCP server (Streamable HTTP, no auth): https://osinttools.io/mcp/
