Getting Started
Requirements
- Python 3.10+
- A Funstat API token — get one at funstat.info
Installation
Authentication
Pass your token when creating a client:
Checking the connection
ping = fs.ping()
print(ping.responce_ping) # round-trip time in seconds
balance = fs.get_balance()
print(balance.current_ballance)
Identifying users
All methods that accept a user argument are flexible — you can pass:
fs.stats(12345678) # numeric ID
fs.stats("durov") # username without @
fs.stats("@durov") # username with @
fs.stats("https://t.me/durov") # full t.me link
The same applies to group arguments.
Context managers
Both clients support context managers to ensure connections are closed properly: