Skip to main content

funstat-api

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

Supports both sync and async usage.

Documentation: https://chizumeiji.github.io/funstat-api/

Installation

pip install funstat-api

Quick Start

Sync

from funstat_api import FunstatClient, FunstatConfig

# Optional: configure custom headers or base URL
config = FunstatConfig(headers={"X-My-Header": "Value"})
fs = FunstatClient("your_token", config=config)

# Get user stats
stats = fs.stats("durov")
print(stats.data.total_msg_count)

# Get group members
members = fs.get_group_members("https://t.me/mychat")

# Use as context manager
with FunstatClient("your_token") as fs:
    print(fs.ping())

Async

import asyncio
from funstat_api import AsyncFunstatClient, UserHiddenError

async def main():
    async with AsyncFunstatClient("your_token") as fs:
        try:
            stats = await fs.stats("durov")
            print(stats.data.total_msg_count)
        except UserHiddenError:
            print("This user's data is hidden by privacy settings.")

asyncio.run(main())

Available Methods

Method Description
ping() Check API availability and latency
get_balance() Get current token balance
resolve_username(username) Resolve username to user info
basic_info_by_id(ids) Get basic info by user ID(s)
stats_min(user) Get minimal user statistics
stats(user) Get full user statistics
messages_count(user) Get total message count
groups_count(user) Get number of groups
get_messages(user, ...) Get paginated message list
get_chats(user) Get user's chat list
get_names(user) Get name history
get_usernames(user) Get username history
get_stickers(user) Get used sticker packs
get_gifts(user) Get gift relations
common_groups(user) Get common groups stats
username_usage(username) Who uses or used a username
name_usage(name) Search name usage
rep(user) Get user reputation info
common_groups_for_users(ids) Get common groups for specified users
get_group_info(group) Get group/channel info
get_group_members(group) Get group members
search_text(query) Search messages by text

user and group arguments accept: numeric ID, @username, or https://t.me/... link.

Dependencies

  • pydantic >= 2.0
  • requests >= 2.28 (sync client)
  • httpx >= 0.24 (async client)

Credits

License

MIT

Metadata

Release files for funstat-api 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for funstat-api 0.2.0
File Size Uploaded Provenance
funstat_api-0.2.0.tar.gz 23.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for funstat-api 0.2.0
File Interpreter ABI Platform
funstat_api-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 34.1 kB

Release files / funstat_api-0.2.0.tar.gz

Download URL funstat_api-0.2.0.tar.gz
Size 23.2 kB
Tags Source
SHA-256 checksum
How to use checksums
5eca37ff0d7a0d88617b1fc705efdb9302e262b7a0bf61eb3c00046683e68365
BLAKE2b-256 checksum
How to use checksums
168f9fa2e408d74cf1596533045ab43d35e5e450d0022760ef96eebd6be7986c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.1

Release files / funstat_api-0.2.0-py3-none-any.whl

Download URL funstat_api-0.2.0-py3-none-any.whl
Size 10.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c4d72a8a875f59c714d35233d0aceca15e04b3ea87bb9bf90aaace784bc85fcb
BLAKE2b-256 checksum
How to use checksums
b3ab233866438e6414bcc04c40fd22f0d23618c3e34f150d35feec40291b0480
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.1

Security for funstat-api 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page