skillfed

twitchAPI

A Python 3.7+ implementation of the Twitch Helix API, EventSub and Chat

twitchapi v4.5.0 99.3K downloads/30d#13,030 on PyPI293
Permissive license MIT Active released

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 twitchapi

uv

uv add twitchapi

poetry

poetry add twitchapi

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: CommunicationsTopic :: Software Development :: LibrariesTopic :: Software Development :: Libraries :: Application FrameworksTopic :: Software Development :: Libraries :: Python Modules

Tags

twitch api client pythontwitch helix api wrappertwitch chat bot librarytwitch eventsub listenerasync twitch integrationtwitch authentication pythontwitch bot framework
twitch-integrationasync-http-clientchat-bot

More Libraries packages