Skip to content

funstat-api

Python client for the Funstat API — Telegram user and group statistics.

Supports both sync and async modes out of the box.


Installation

pip install funstat-api

Quick Example

from funstat_api import FunstatClient

with FunstatClient("your_token") as fs:
    stats = fs.stats("durov")
    print(stats.data.total_msg_count)
import asyncio
from funstat_api import AsyncFunstatClient

async def main():
    async with AsyncFunstatClient("your_token") as fs:
        stats = await fs.stats("durov")
        print(stats.data.total_msg_count)

asyncio.run(main())

Features

  • ✅ Sync client powered by requests
  • ✅ Async client powered by httpx
  • ✅ Fully typed — all responses are Pydantic models
  • ✅ Accepts username, @username, numeric ID, or t.me/ link
  • ✅ Auto-resolves usernames to IDs internally

Get Started