Skip to content

Latest commit

Β 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

TG Analytics

Python pywebview Telethon License: MIT Platform Release

A modern open-source desktop app for Telegram channel analytics. Track subscriber growth, engagement rates, top posts, best posting times and content mix β€” for your own channels and any public channel. Analytics data and settings are stored locally on your machine.

Features β€’ Screenshots β€’ Installation β€’ Usage β€’ Privacy β€’ FAQ β€’ Support


About

TG Analytics is a free, open-source desktop application that helps Telegram channel owners, marketers and content creators understand their audience.

Unlike SaaS analytics platforms (TGStat, Telemetr), TG Analytics:

  • Has no proprietary analytics backend β€” there is no server that receives your data
  • Analyzes any public channel β€” track competitors without admin rights
  • Works offline after initial sync β€” all charts and reports render from the local database
  • Is completely free β€” no subscriptions, no limits, no ads, no telemetry

Perfect for:

  • Channel owners β€” monitor growth, engagement, and find the best time to post
  • Content teams β€” understand which content types perform best
  • Marketers β€” research competitors and benchmark against industry peers
  • Agencies β€” generate beautiful PDF reports for clients

The app connects directly to the official Telegram API through Telethon. There is no intermediary server β€” your requests go straight from your machine to Telegram.


✨ Features

πŸ“Š Analytics

  • Subscriber growth β€” daily/hourly chart with automatic granularity (raw β†’ hourly β†’ daily)
  • Engagement rate (ER) β€” average views Γ· subscribers, per period and per content type
  • Best posting time β€” 7Γ—24 heatmap of average views by weekday and hour
  • Top posts β€” ranking by views, reactions and forwards
  • Content mix β€” text / photo / video / documents with per-type ER

πŸ“‘ Channel tracking

  • Your own channels β€” auto-detects channels where you're an admin or owner
  • Any public channel β€” add by @username, t.me/... link or numeric ID
  • Background collection β€” configurable interval (15 min – 6 hours or manual)
  • Import history β€” up to 100 latest posts per channel on first sync

πŸ” Comparison

  • Side-by-side metrics β€” compare up to 6 channels on one screen
  • Multi-line growth chart β€” one line per channel with shared timeline
  • Average views & ER bars β€” instant visual comparison

πŸ“€ Export

  • PDF report β€” beautifully typeset A4 report with charts and branding
  • JSON β€” full structured dump (snapshots + posts + metrics)
  • CSV β€” raw post data, Excel-friendly (UTF-8-BOM, ; delimiter)

🎨 Interface

  • Modern dark / light / system theme β€” follows OS by default
  • English + Русский + EspaΓ±ol + PortuguΓͺs + Deutsch β€” instantly switchable
  • Smooth animations, zero flicker β€” built on HTML/CSS/JS via pywebview
  • Responsive layout β€” sidebar fixed, only content scrolls

πŸ”’ Local-first

  • No analytics backend β€” the developer of TG Analytics does not receive your data
  • No telemetry β€” the app has no usage tracking, no crash reporting to any server
  • Open source β€” audit every line

πŸ” Privacy

TG Analytics is designed local-first: analytics data, settings and exports are stored on your machine. The app has no proprietary backend and no telemetry. It talks directly to the official Telegram API for authentication and data collection β€” nothing goes through a middleman.

What stays local:

  • SQLite database with channels, snapshots and posts β†’ ~/.tg_analytics/analytics.db
  • Configuration (including API credentials and phone number) β†’ ~/.tg_analytics/config.json
  • Telegram session file β†’ ~/.tg_analytics/sessions/
  • Exports (PDF / JSON / CSV) β†’ user-chosen folder
  • Logs β†’ ~/.tg_analytics/logs/

What leaves your machine:

  • Authentication requests, channel metadata and post data β€” sent directly to Telegram servers, because that's how the Telegram API works
  • Nothing else. There is no analytics endpoint, no error reporter, no update pings to any developer server

What is not encrypted by the app:

  • The Telegram session file is not encrypted on disk (Telethon default). Anyone with read access to that file can potentially access your authorized Telegram account.
  • config.json stores api_id, api_hash and phone number in plain text.
  • The SQLite database is not encrypted.

What this means in practice:

  • Use TG Analytics on a device you control and trust.
  • If you are concerned about the session file, consider using a dedicated Telegram account for analytics rather than your main account with sensitive chats and administrative access.
  • You can revoke a session at any time from Telegram β†’ Settings β†’ Devices.
  • Full technical detail is available in the source code on GitHub β€” every file is open.

πŸ“Έ Screenshots

Dashboard Channels
Dashboard Channels
Compare Login
Compare Login

πŸš€ Installation

Option 1: Download prebuilt executable (recommended)

Grab the latest release for your OS from the Releases page:

  • Windows β€” TGAnalytics-Windows.exe
  • Linux β€” TGAnalytics-Linux (make it executable with chmod +x)
  • macOS β€” TGAnalytics-macOS.zip (unzip and drag TG Analytics.app into Applications)

Each release asset includes a SHA-256 checksum published by GitHub β€” you can verify the download.

⚠️ Windows SmartScreen: The executable is not code-signed. Windows may show a warning β€” click More info β†’ Run anyway. You can also build from source if you prefer.

⚠️ macOS: The app is not notarized with an Apple Developer certificate. On first launch, open Terminal and run:

xattr -cr "/Applications/TG Analytics.app"

Or right-click the app β†’ Open β†’ Open in the dialog.

No Python installation required.

Option 2: Run from source

Requirements: Python 3.10 or newer.

git clone https://github.com/Igor-Shelloff/tg-analytics.git
cd tg-analytics
python -m venv venv

# Windows
venv\Scripts\activate

# Linux / macOS
source venv/bin/activate

pip install -r requirements.txt
python main.py

πŸ“– Usage

1. Get your Telegram API credentials

  1. Go to my.telegram.org
  2. Log in with your phone number
  3. Open API Development Tools and create a new app
  4. Copy your API ID and API Hash

2. Sign in

Open the app, paste your API ID, API Hash and phone number β€” or scan the QR code with the Telegram mobile app.

3. Track channels

  • Your own channels β€” the Channels tab automatically lists every channel where you're an admin
  • Any public channel β€” click Add public channel, paste a @username or t.me/... link

Click Track to start monitoring. The app fetches the latest 100 posts immediately, then updates on schedule.

4. Explore the dashboard

Open Dashboard and pick a channel. Choose period 7d / 30d / 90d / all time. Explore:

  • Subscriber growth chart
  • Average views, ER and posts per period
  • Best posting time heatmap
  • Top 10 posts
  • Content type breakdown

5. Compare and export

  • Compare β€” pick 2–6 channels, see metrics side by side
  • Export β€” generate a PDF report, JSON dump or CSV of raw posts

6. Configure collection

Open Settings to:

  • Set auto-collect interval (15 min – 6 h or manual)
  • Choose data retention (30 days – forever)
  • Switch language and theme
  • Open the logs folder

❓ FAQ

Is this really free?

Yes. MIT-licensed, no subscriptions, no feature gates. You can also build it yourself from source.

Where is my data stored?

Everything is stored locally in ~/.tg_analytics/:

  • analytics.db β€” SQLite database with channels, snapshots and posts
  • config.json β€” settings including API credentials and phone number (plain text)
  • sessions/ β€” Telegram session files
  • exports/ β€” your exported reports
  • logs/ β€” application logs

See the Privacy section for details on what stays local and what is sent to Telegram.

Is my Telegram session encrypted?

No β€” the session file is stored in Telethon's default format and is not encrypted by the app. Anyone with read access to ~/.tg_analytics/sessions/ can potentially access your authorized Telegram account.

If this concerns you:

  • Use the app on a device you control.
  • Consider a dedicated Telegram account for analytics instead of your main account.
  • You can revoke a session any time in Telegram β†’ Settings β†’ Devices.
Can I track public channels I don't own?

Yes. Click Add public channel, paste @username or a t.me/... link. The app will resolve and track it just like your own channels.

Why does the growth chart show only today?

Subscriber counts are not available historically β€” the app can only record them from the moment you start tracking. The chart will fill in over days and weeks. Posts, views and reactions, on the other hand, are fetched from Telegram's history immediately.

Do old posts keep their views up to date?

Partially. The app refreshes views, reactions and forwards for the most recent posts on every collection cycle. Older posts keep the values captured when they were last in the update window. This means top-post rankings for older posts may slightly lag behind the current reality. If this matters for your workflow, use manual collection before generating reports.

The app was flagged by my antivirus β€” why?

PyInstaller-built executables are sometimes flagged as false positives. The full source is open β€” you can build it yourself or add an exception in your antivirus. Release assets include SHA-256 checksums you can verify.

Does it work behind a proxy?

Yes. Telethon supports SOCKS5, SOCKS4 and HTTP proxies. Proxy settings are on the roadmap β€” meanwhile, you can set a system-level proxy for the Telegram API.

How do I reset everything?

Delete the ~/.tg_analytics/ folder. That removes sessions, database and all cached data.


πŸš€ What about publishing?

TG Analytics answers "what works?" β€” but if you also want to act on it, check out Telegram AutoPoster by the same team β†’ tgautoposter.com

AutoPoster is a desktop tool for automated publishing and audience growth on Telegram. What it does:

  • Scheduled auto-posting β€” templates, variables, time windows, per-day scheduling
  • Multi-account management β€” run one or hundreds of accounts from a single UI
  • Bulk group joining β€” mass-join groups and channels from invite links
  • Story campaigns β€” auto-publish stories on schedule
  • Subscriber outreach β€” collect audience from groups, send personalized DMs with {name}, {username} and other variables
  • Auto-stop protection β€” instantly halts on PEER_FLOOD, consecutive errors or FloodWait spikes
  • Per-account proxies β€” SOCKS5, SOCKS4, HTTP support
  • Forward from Saved Messages β€” repost content from your saved messages with one click
  • Telegram reports β€” daily / weekly digests sent straight to your chat
  • Auto-updates β€” seamless version upgrades
  • 12 UI languages β€” English, Русский, ν•œκ΅­μ–΄, ΰ€Ήΰ€Ώΰ€¨ΰ₯ΰ€¦ΰ₯€, EspaΓ±ol, Deutsch, FranΓ§ais, Italiano, PortuguΓͺs, Bahasa Indonesia, Ψ§Ω„ΨΉΨ±Ψ¨ΩŠΨ©, TiαΊΏng Việt

Free trial available. All proceeds from AutoPoster support the ongoing development of TG Analytics and other open-source tools.

πŸ‘‰ tgautoposter.com


πŸ’– Support the project

TG Analytics is a passion project β€” free, open-source, and ad-free. If it saves you time, here's how to say thanks:

  • ⭐ Star the repo β€” helps more people discover it
  • πŸ› Report bugs β€” open an issue
  • πŸ’‘ Suggest features β€” start a discussion
  • β˜• Buy me a coffee β€” Lava.top or boosty.to/igorshelloffdev
  • πŸ“£ Tell a friend β€” share on Twitter / Reddit / Telegram

πŸ›  Tech stack

πŸ“ Project structure

tg-analytics/
β”œβ”€β”€ main.py                  # entry point
β”œβ”€β”€ build.py                 # PyInstaller build script
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ README.md
β”œβ”€β”€ LICENSE
β”œβ”€β”€ .github/workflows/       # CI: build + release
β”œβ”€β”€ app/                     # Python backend
β”‚   β”œβ”€β”€ config.py            # paths, AppConfig
β”‚   β”œβ”€β”€ database.py          # SQLite wrapper
β”‚   β”œβ”€β”€ telegram_client.py   # Telethon worker (own event loop)
β”‚   β”œβ”€β”€ collector.py         # background data collection
β”‚   β”œβ”€β”€ analytics.py         # pure computation (ER, growth, heatmap)
β”‚   β”œβ”€β”€ api.py               # JS ↔ Python bridge
β”‚   β”œβ”€β”€ logger.py            # file + crash logging
β”‚   └── exports/
β”‚       └── pdf_report.py    # PDF generator
└── web/                     # Frontend (HTML/CSS/JS)
    β”œβ”€β”€ index.html
    β”œβ”€β”€ css/main.css         # design system
    β”œβ”€β”€ js/                  # app, router, api, charts, pages
    └── locales/             # en.json, ru.json, es.json, pt.json, de.json

🀝 Contributing

Pull requests are welcome. For big changes, please open an issue first to discuss what you'd like to change.

  1. Fork the repo
  2. Create a branch: git checkout -b feature/awesome-thing
  3. Commit: git commit -m "Add awesome thing"
  4. Push: git push origin feature/awesome-thing
  5. Open a Pull Request

πŸ“„ License

MIT Β© Igor Shilov


Made with ❀️ for the Telegram community