Official Chanify SDK - monetize your Telegram bot with ads
Project description
Chanify Python SDK
Official Python SDK for Chanify — the ad network for Telegram bots, channels, and Mini Apps.
Installation
pip install chanify
Quick Start
from chanify import Chanify
chanify = Chanify("chanify_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
# After each bot response — add one line:
await chanify.show_ad(chat_id=message.chat.id, user=message.from_user)
Usage with aiogram 3.x
from aiogram import Router
from aiogram.filters import CommandStart
from aiogram.types import Message
from chanify import Chanify
router = Router()
chanify = Chanify("chanify_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
@router.message(CommandStart())
async def start(message: Message):
await message.answer("Hello! How can I help?")
await chanify.show_ad(chat_id=message.chat.id, user=message.from_user)
Full API
await chanify.show_ad(
chat_id=message.chat.id,
user=message.from_user,
country="US", # optional — if your bot knows the user's country
after_delay=1.5 # seconds to wait before showing ad, default 1.0
)
| Parameter | Type | Required | Description |
|---|---|---|---|
chat_id |
int | Yes | Telegram chat ID |
user |
object | No | Telegram user object — passes language, Premium status |
country |
str | No | ISO 3166-1 alpha-2 country code |
after_delay |
float | No | Delay in seconds before the ad is sent (default: 1.0) |
Returns True if an ad was shown, False otherwise. Never raises exceptions — safe to call without try/except.
Requirements
- Python 3.8+
- httpx >= 0.24.0
Get your API key
- Sign up at chanify.online
- Go to Publisher → My Bots → Add Bot
- Copy your
chanify_live_API key from Step 3
Links
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
chanify-0.1.0.tar.gz
(2.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file chanify-0.1.0.tar.gz.
File metadata
- Download URL: chanify-0.1.0.tar.gz
- Upload date:
- Size: 2.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ae6088c7b83696a54d6ebdcab6844343c1e92f2c7557f1768bb47a6933aa63ac
|
|
| MD5 |
d2c9f3de5c97a19d88e303d5d497fce7
|
|
| BLAKE2b-256 |
f125b4daab372d8958d7090d7f6cb86c12f8737a970c1a98177bc1d1889bd131
|
File details
Details for the file chanify-0.1.0-py3-none-any.whl.
File metadata
- Download URL: chanify-0.1.0-py3-none-any.whl
- Upload date:
- Size: 2.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6b927f209be9340c22e636bda224b8bb732b93a1ea7ce9a5cedf6883341aa127
|
|
| MD5 |
8cb0c5a6d85528ba8cc254009e4eaaff
|
|
| BLAKE2b-256 |
b3bef274e9e3d8ae882fb35890ec05b2ff15025ee771d1db78d1cecad5a392c7
|