Briza Hub API for bot owners

Sell the spots in your bot's force-sub block: Briza Hub supplies advertisers' channels and pays for every subscriber.

How you earn

Quickstart

Python in 2 minutes, other languages in 5

Your bot gets tasks for a user from Briza, shows them as buttons and checks the subscription.

Step 1 · Get your key

@BrizaHubBot → Sell traffic → Connect a bot → With a token. After review (usually within a day) the bot sends an API key — put it in place of your_key_here.

Step 2 · Python: install the package faster

Requests, timeouts and errors are handled inside: no answer in 3 s or a failure — the user goes through.

pip install brizahub
pip install "brizahub[aiogram]"   # + middleware for aiogram 3

Step 3 · One line in your handler

from brizahub import Briza

# your key from @BrizaHubBot; smart_links — more advertisers: device-targeted orders and visits
briza = Briza("your_key_here", smart_links=True)


@dp.message()
async def work(message: Message) -> None:
    if not await briza.check(message.from_user):   # False — Briza has shown the sponsors as your bot
        return
    await message.answer("⏳ Downloading…")         # your bot's real work

Done. Your own block design and every parameter — in the package description.

Other languages: HTTP API

Without the package — two API requests in any language.

Address: https://api.brizahub.com. Key: Authorization: Bearer ….

1 · First request: tasks for a user

When a user messages your bot, request tasks for them:

# user_id, language_code, is_premium, first_name — from the Telegram user; has_photo — getUserProfilePhotos
curl -s -X POST "https://api.brizahub.com/v1/tasks" \
  -H "Authorization: Bearer your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "user_id": 123456789,
    "language_code": "fa",
    "is_premium": false,
    "has_photo": true,
    "first_name": "Ali",
    "smart_links": true,
    "mini_apps": true
  }'

2 · Handle the answer

It all comes down to the tasks list:

Briza's answerYour bot
tasks is emptyLet the user through. "suspicious": true — the user is flagged by our anti-fraud; what to do with them in your bot is up to you.
tasks has tasksButtons with link plus “Check” → POST /v1/tasks/check. Hold while any task is incomplete.
an error, or no answer within 3 secondsLet the user through.

A minimal handler:

import aiohttp

BRIZA_KEY = "your_key_here"   # your key from @BrizaHubBot
BRIZA = "https://api.brizahub.com"
HEADERS = {"Authorization": f"Bearer {BRIZA_KEY}"}
TIMEOUT = aiohttp.ClientTimeout(total=3)


async def briza(path: str, payload: dict) -> dict:
    """{} if Briza did not answer — let the user in."""
    try:
        async with aiohttp.ClientSession(timeout=TIMEOUT) as s:
            async with s.post(BRIZA + path, json=payload, headers=HEADERS) as r:
                return await r.json() if r.status == 200 else {}
    except (aiohttp.ClientError, TimeoutError):
        return {}


async def sponsors(user, has_photo: bool | None = None) -> list[dict]:
    """user — message.from_user; has_photo — getUserProfilePhotos(user.id).total_count > 0. Empty — let the user in."""
    return (await briza("/v1/tasks", {
        "user_id": user.id,
        "language_code": user.language_code,
        "is_premium": bool(user.is_premium),
        "first_name": user.first_name,
        "has_photo": has_photo,                # «photo only» orders pay more
        "smart_links": True,                   # more advertisers: device-targeted orders and visits
        "mini_apps": True,                     # mini app tasks too
    })).get("tasks", [])


async def must_hold(user_id: int, task_ids: list[str]) -> bool:
    """«Check» pressed. True — hold the user."""
    answer = await briza("/v1/tasks/check", {"user_id": user_id, "task_ids": task_ids})
    return any(x["status"] == "incomplete" for x in answer.get("results", []))

Next: the reference and a full bot.

Or turnkey: Briza shows the force-sub block, you keep one line — if not await briza_check(user): return.

No code? Take a smart link instead: @BrizaHubBot → Sell traffic → Connect a bot → No code. Put it in your force-sub or menu — we show the tasks and check the subscriptions ourselves.

Turnkey: Briza shows the force-sub block

One line in your handlers: if not await briza.check(message.from_user): return.

Full bot:

# pip install "brizahub[aiogram]" — Briza Hub turnkey
import asyncio

from aiogram import Bot, Dispatcher
from aiogram.filters import CommandStart
from aiogram.types import Message
from brizahub import Briza
from brizahub.aiogram import BrizaMiddleware

BRIZA_KEY = "your_key_here"                    # your key from @BrizaHubBot
BOT_TOKEN = "your_bot_token_here"              # your bot's token from @BotFather

bot = Bot(BOT_TOKEN)
dp = Dispatcher()
briza = Briza(BRIZA_KEY, smart_links=True)     # more advertisers: device-targeted orders and visits

dp.message.middleware(BrizaMiddleware(briza))  # force-sub before every handler
dp.callback_query.middleware(BrizaMiddleware(briza))
dp.shutdown.register(briza.close)


@dp.message(CommandStart())
async def start(message: Message) -> None:
    await message.answer("Hi! Send me a link and I will download the video.")


@dp.message()
async def work(message: Message) -> None:
    await message.answer("⏳ Downloading…")     # your bot's real work


if __name__ == "__main__":
    asyncio.run(dp.start_polling(bot))

API reference

https://api.brizahub.com, key in Authorization: Bearer …, JSON. Limit: 65 requests per second.

Read-only key (bzr_…) — for a stats dashboard or your accountant: opens /v1/me, /v1/stats, /v1/balance, issues no tasks. Create it in @BrizaHubBot: your bot's card → “👁 Read-only key”.

POST/v1/tasks

Tasks for the force-sub block. Until the user completes them, the same ones come back. Once they pass the block, no new ones until the list reset (bot settings in @BrizaHubBot, 6 h by default).

Parameters

  • user_idintegerrequired

    from.id

  • limitintegeroptional

    1–10, more is cut to 10. Default — your bot's setting (5).

  • language_codestringoptional

    from.language_code. Omitted — we detect it by user_id.

  • is_premiumbooleanoptional

    from.is_premium

  • has_photobooleanoptional

    Whether the user has a profile photo (your bot sees it via getUserProfilePhotos). Gives “photo only” orders; we check it after the subscription.

  • first_namestringoptional

    from.first_name — we compare it with Telegram after the subscription.

  • min_pricestringoptional

    Minimum payout per task, USDT, e.g. "0.015".

  • smart_linksbooleanoptional

    Whether to take tasks with smart links. We recommend true: more advertisers.

  • mini_appsbooleanoptional

    Whether to take mini-app tasks (type: app). Without true you get none.

Response fields

  • tasksarray

    Empty — let the user through.

  • task_idstring

    For /v1/tasks/check.

  • typestring

    channel, group, bot, link, folder (a chat folder — t.me/addlist/…; show it like a channel), app (a bot's mini app; button “Open”).

  • linkstring

    Button link.

  • titlestring

    Button text.

  • pricestring

    Your payout, USDT.

  • photostring

    Picture of the channel, group or bot (a mini app — its bot): a link to a JPEG of exactly 320×320 px on api.brizahub.com, the same size for every task. No photo, a website or a folder — a Telegram-style placeholder of the same size.

  • photo_placeholderboolean

    true — photo is a placeholder (gradient and initials): show it or draw your own. A real photo — no field.

Example

# user_id, language_code, is_premium, first_name — from the Telegram user; has_photo — getUserProfilePhotos
curl -s -X POST "https://api.brizahub.com/v1/tasks" \
  -H "Authorization: Bearer your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "user_id": 123456789,
    "language_code": "fa",
    "is_premium": false,
    "has_photo": true,
    "first_name": "Ali",
    "smart_links": true,
    "mini_apps": true
  }'

POST/v1/tasks/check

Checks tasks when the user presses “Check”.

Parameters

  • user_idintegerrequired

    from.id

  • task_idsarrayrequired

    1–20 task_ids.

Response fields

  • resultsarray

    One per task_id.

  • statusstring

    incomplete, pending, completed, unavailable — see statuses.

  • reasonstring

    For unavailable: expired, order_inactive, member, left, not_paid, suspicious, removed, unconfirmed, check_failed, not_found.

Example

# user_id — from the Telegram user; task_ids — the tasks you showed
curl -s -X POST "https://api.brizahub.com/v1/tasks/check" \
  -H "Authorization: Bearer your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"user_id": 123456789, "task_ids": ["t_Qx3kW2", "t_Lm9pR4"]}'

POST/v1/check

Checks the user and, if needed, shows the force-sub block as your bot.

Parameters

  • user_idintegerrequired

    from.id

  • chat_idintegeroptional

    Default — user_id.

  • limitintegeroptional

    1–10, more is cut to 10. Default — your bot's setting (5).

  • language_codestringoptional

    Which language to show the force-sub block in (from.language_code, 30 Telegram languages). Omitted — we detect it by user_id; unknown — English.

  • is_premiumbooleanoptional

    from.is_premium

  • has_photobooleanoptional

    Whether the user has a profile photo (your bot sees it via getUserProfilePhotos). Gives “photo only” orders; we check it after the subscription.

  • first_namestringoptional

    from.first_name — we compare it with Telegram after the subscription.

  • messageobjectoptional

    text up to 4096: HTML, parse_mode MarkdownV2 or entities copied from a message; premium emoji, $name — the user's name. rows (1–3), button_join, button_channel, button_bot, button_url; icons button_icon (custom emoji id), color button_style. Premium emoji show if your bot's owner has Telegram Premium.

  • min_pricestringoptional

    Minimum payout per task, USDT, e.g. "0.015".

  • smart_linksbooleanoptional

    Whether to take tasks with smart links. We recommend true: more advertisers.

Response fields

  • skipboolean

    true — let through, false — hold.

  • tasksarray

    Tasks in the block.

  • message_idinteger

    The block message.

Example

# user_id, language_code, is_premium, first_name — from the Telegram user; has_photo — getUserProfilePhotos
curl -s -X POST "https://api.brizahub.com/v1/check" \
  -H "Authorization: Bearer your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "user_id": 123456789,
    "language_code": "fa",
    "is_premium": false,
    "has_photo": true,
    "first_name": "Ali",
    "smart_links": true
  }'

GET/v1/me

Your platform and today's counters.

No parameters.

Response fields

  • platformobject

    Name, status, webhook, bot token.

  • statsobject

    Today and all time.

Example

curl -s "https://api.brizahub.com/v1/me" \
  -H "Authorization: Bearer your_key_here"

GET/v1/stats

Daily stats (UTC).

Parameters

  • daysintegeroptional

    1–90 (more is cut to 90), 7 by default.

Response fields

  • daysarray

    One row per day.

Example

curl -s "https://api.brizahub.com/v1/stats?days=7" \
  -H "Authorization: Bearer your_key_here"

GET/v1/balance

Earnings, USDT.

No parameters.

Response fields

  • balanceobject

    available — withdrawable, pending — waiting 24 h, paid — paid out, requested — requested.

  • min_payoutstring

    Minimum withdrawal, USDT.

Example

curl -s "https://api.brizahub.com/v1/balance" \
  -H "Authorization: Bearer your_key_here"

Try it

“Send” makes a real request with your key.

The key goes only to api.brizahub.com. Tasks are real — test with your own ID.

Request code

curl -s -X POST "https://api.brizahub.com/v1/tasks" \
  -H "Authorization: Bearer your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "user_id": 123456789,
    "smart_links": true,
    "mini_apps": true
  }'

Smart links and clicks

Webhook instead of polling

import hashlib
import hmac
import time

WEBHOOK_SECRET = "whsec_your_secret"            # @BrizaHubBot → your bot → API → Webhook → Copy secret


def briza_signature_ok(headers, raw_body: bytes) -> bool:
    """raw_body — the request body exactly as received (bytes), not re-serialized JSON."""
    ts = headers.get("X-Briza-Timestamp", "")
    expected = "sha256=" + hmac.new(WEBHOOK_SECRET.encode(), ts.encode() + b"." + raw_body,
                                    hashlib.sha256).hexdigest()
    fresh = ts.isdigit() and abs(time.time() - int(ts)) < 300      # older than 5 minutes — reject
    return fresh and hmac.compare_digest(expected, headers.get("X-Briza-Signature", ""))

Task statuses

StatusMeaningYour bot
incompletenot subscribed yethold
pendingsubscribed or sent a join request — paid later (a subscriber — in 24 h)let through
completedpaidlet through
unavailablethe task is gone, see reasonlet through

Errors and timeouts

Errors: {"ok": false, "error": "…"} with an HTTP code; on 429 retry after Retry-After seconds. Timeout: 3 s — no answer, don't hold the user.

HTTPerror
400bad_json, bad_user_id, bad_task_ids, bad_is_premium, bad_has_photo, bad_first_name, bad_smart_links, bad_mini_apps, bad_min_price, bad_chat_id, bad_message
401no_key — no key; bad_key — wrong key — copy it in @BrizaHubBot
403paused — the bot is paused: no tasks; banned — the bot or account is banned; read_only — read-only key: no tasks; on_review — the bot is on moderation — the key starts working by itself after approval; rejected — the bot was not approved
409no_token
413too_large
429rate_limited
500internal

Complete bot

Fill in BRIZA_KEY and BOT_TOKEN.

# pip install aiogram brizahub — a bot with force-sub from Briza Hub
import asyncio

from aiogram import Bot, Dispatcher, F
from aiogram.filters import CommandStart
from aiogram.types import CallbackQuery, InlineKeyboardButton, InlineKeyboardMarkup, Message
from brizahub import Briza

BRIZA_KEY = "your_key_here"                    # your key from @BrizaHubBot
BOT_TOKEN = "your_bot_token_here"              # your bot's token from @BotFather

bot = Bot(BOT_TOKEN)
dp = Dispatcher()
briza = Briza(BRIZA_KEY, smart_links=True, mini_apps=True)    # more advertisers: device-targeted orders, visits, mini apps


def block(sponsors) -> InlineKeyboardMarkup:
    # a visit may go to another offer for this device — label it generically, not with the site's name
    rows = [[InlineKeyboardButton(text="🎁 Offer" if s.type == "link" else s.title or "Subscribe", url=s.link)]
            for s in sponsors]
    rows.append([InlineKeyboardButton(text="✅ Check", callback_data="briza:check")])
    return InlineKeyboardMarkup(inline_keyboard=rows)


@dp.message(CommandStart())
async def start(message: Message) -> None:
    await message.answer("Hi! Send me a link and I will download the video.")


@dp.message(F.text)
async def work(message: Message) -> None:
    photos = await bot.get_user_profile_photos(message.from_user.id, limit=1)   # «photo only» orders pay more
    sponsors = await briza.get_sponsors(message.from_user, has_photo=photos.total_count > 0)
    if sponsors:                               # force-sub first; [] — let the user in
        await message.answer("Join our sponsors to use the bot:", reply_markup=block(sponsors))
        return
    await message.answer("⏳ Downloading…")     # your bot's real work


@dp.callback_query(F.data == "briza:check")
async def check(call: CallbackQuery) -> None:
    if await briza.check_sponsors(call.from_user):     # not joined yet
        await call.answer("Please join all the channels first", show_alert=True)
        return
    await call.answer()
    await call.message.edit_text("✅ Thank you! Now send me a link.")


if __name__ == "__main__":
    dp.shutdown.register(briza.close)
    asyncio.run(dp.start_polling(bot))

API changelog

/v1 is stable since 09.11.2026: only compatible additions — new optional fields and parameters. Breaking changes go to /v2, announced here and in @BrizaHub 14 days ahead.

Ready to earn on your traffic?

Connect your bot in @BrizaHubBot — it takes a minute.

Connect a bot