twitchAPI
A Python 3.7+ implementation of the Twitch Helix API, EventSub and Chat
What it is and what it does
twitchAPI is a complete async Python client for Twitch's Helix API, EventSub webhooks, and IRC-based chat. It handles both app-level and user-level OAuth authentication, automatically managing token refresh via callbacks. The library exposes the full Helix API surface through async generators and coroutines, supports real-time event subscriptions through EventSub (with pluggable transports), and includes a chat bot framework for joining channels, listening to messages, and responding to commands and subscription events.
The package is built on aiohttp for HTTP operations and python-dateutil for timestamp handling, making it suitable for long-running bots and event-driven applications. It targets Python 3.7+ and is classified as Production/Stable. Authentication setup is straightforward for app credentials, while user authentication can leverage a built-in browser-based OAuth flow or manual token management.
Use it for:
- Build a Twitch chat bot that joins channels, listens for messages, and responds to commands or subscription events.
- Monitor Twitch streams and channels in real-time using EventSub to trigger actions on stream goes live, follows, or subscriptions.
- Retrieve user data, stream metadata, and analytics from the Twitch Helix API for dashboards or reporting tools.
- Automate moderation or engagement tasks by listening to chat events and calling Helix API endpoints to manage channels.
- Create a multi-channel monitoring service that aggregates events from multiple Twitch channels into a single async application.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A Python client library for the Twitch Helix API, EventSub, and Chat, supporting app and user authentication with async/await patterns.
Yes. The package is actively maintained, has no known vulnerabilities, low install friction, and a permissive license. It provides a complete, production-ready implementation of Twitch's modern APIs with good async/await ergonomics. Install it if you need to integrate Twitch API, EventSub, or chat functionality into a Python application.
Install
twitchapi on PyPI
pip
pip install twitchapiuv
uv add twitchapipoetry
poetry add twitchapiInstalling twitchAPI
Before you install
Low friction install with a pure-Python wheel and four common async-friendly dependencies (aiohttp, python-dateutil, typing_extensions, enum-tools). Actively maintained as of 2026-02-15 with 293 repository stars.
License in practice
MIT license permits commercial and private use with minimal restrictions; you must include a copy of the license and copyright notice in distributions.
Quickstart
pip install twitchAPI
from twitchAPI.twitch import Twitch
import asyncio
async def example():
twitch = await Twitch('app_id', 'app_secret')
# Make API calls here
await twitch.close()
asyncio.run(example())
Requires Python 3.7 or later; all operations are async and must run within an asyncio event loop.
Verify before relying
- Rate limit behavior and quotas for different authentication types beyond 'better for authenticated calls'
- EventSub transport options and their specific use-case trade-offs
- Chat command parsing and event filtering capabilities
- Token refresh callback error handling and retry semantics
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 4 — aiohttp, python-dateutil, typing_extensions, enum-tools |
| Maintenance | actively maintained — 448 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 99,284/month — #13,030 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: twitchapi-4.5.0-py3-none-any.whl
Keywords: twitch, twitch.tv, chat, bot, event sub, EventSub, helix, api
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
pyTelegramBotAPIA Python library that wraps the Telegram Bot…
copyleft · top 5,000 on PyPI
twythonTwython is a Python wrapper for the Twitter API…
permissive · top 15,000 on PyPI
pywaPyWa is a fully-typed Python framework for…
permissive · top 15,000 on PyPI
python-telegram-botProvides a pure Python asynchronous interface…
copyleft · top 1,000 on PyPI
redditwarpRedditWarp is a Python wrapper for the Reddit…
permissive · top 15,000 on PyPI
slackclientProvides Python interfaces to Slack's Web API…
permissive · top 5,000 on PyPI
ablyAbly is a Python client library for connecting…
permissive · top 5,000 on PyPI
ircProvides a low-level, event-driven IRC protocol…
permissive · top 15,000 on PyPI
pusherPusher is a Python client library for the…
permissive · top 5,000 on PyPI
stream-chatPython SDK for server-side integration with…
unclear · top 15,000 on PyPI