A Python 3.7+ implementation of the Twitch Helix API, EventSub and Chat. This library provides async and sync interfaces for Twitch API endpoints, including authentication, events, and chat bots. Current version 4.5.0 is stable but has significant breaking changes from v3. The project is actively maintained with regular releases.
pip install twitchapiNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Initialize Twitch client with app credentials and fetch a user
Migrate to new class hierarchy: use Twitch from twitchAPI.twitch, TwitchClientCredentials from twitchAPI.oauth, etc.
Use Twitch and EventSub classes instead. For PubSub, use twitchAPI.pubsub.TwitchPubSub (still available but deprecated).
Store TwitchClientCredentials and Twitch instance as singletons.
Use TwitchClientCredentials which handles token refresh automatically via the Twitch instance.
Upgrade to v4: pip install --upgrade twitchapi. Then import from twitchAPI.twitch import Twitch
Use: from twitchAPI.twitch import Twitch
Use async Twitch class: from twitchAPI.twitch import Twitch. Replace TwitchClient with Twitch.