Async Python client for the Chaturbate Events API.
Provides event polling, typed models, retries, and routing.
Python 3.11+
pip install cb-eventsWith uv:
uv add cb-eventsimport asyncio
from cb_events import Event, EventClient, EventType, Router
router = Router()
events_url = "https://eventsapi.chaturbate.com/events/your_username/your_api_token/"
@router.on(EventType.TIP)
async def handle_tip(event: Event) -> None:
if event.user and event.tip:
print(f"{event.user.username} tipped {event.tip.tokens} tokens")
async def main() -> None:
async with EventClient(events_url) as client:
async for event in client:
await router.dispatch(event)
asyncio.run(main())Note
Create an API token at https://chaturbate.com/statsapi/authtoken/ with Events API scope.
- Async iterator client for long-polling events.
- Typed event models for tips, chat/messages, follows, broadcasts, and other event types.
- Router handlers are registered by event type.
- Retry and rate-limiting support.
- Client configuration for timeouts, strict validation, and retries.
MIT
Not affiliated with Chaturbate.