Twitch API Python Client

Extract Twitch data with our Twitch API Python client. Get programmatic access to follower counts, video metrics, channel data, streamer details, live stream information, and more using simple Python code. Start free, no credit card required.

Trusted by industry leaders all over the world

Integrate our Twitch API

The Apify API client for Python is the official library that allows you to use Twitch API in Python, providing convenience functions and automatic retries on errors. Get started with simple pip installation and robust error handling built-in.

Python

Python

JavaScript

JavaScript

HTTP

HTTP

MCP

MCP

1from apify_client import ApifyClient
2
3# Initialize the ApifyClient with your Apify API token
4# Replace '<YOUR_API_TOKEN>' with your token.
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7# Prepare the Actor input
8run_input = {}
9
10# Run the Actor and wait for it to finish
11run = client.actor("easyapi/twitch-channel-scraper").call(run_input=run_input)
12
13# Fetch and print Actor results from the run's dataset (if there are any)
14print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
15for item in client.dataset(run["defaultDatasetId"]).iterate_items():
16 print(item)
17
18# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

Get data with Twitch API Python client

Use our Python API client to extract Twitch channel data by providing search keywords and maximum item limits. The API returns structured data, including channel IDs, display names, descriptions, follower counts, partner status, live stream details, latest videos, top clips, and upcoming schedules.

Input

{
"keywords": [
"war"
],
"maxItems": 30
}

Output

[
{
"login": "warframe",
"stream": null,
"keyword": "war",
"topClip": {
"_fromStrapi": true,
"id": "2763480287",
"title": "Lettie Gemini Emote",
"thumbnailURL": "https://static-cdn.jtvnw.net/twitch-clips-thumbnails-prod/ConcernedObliqueSheepBatChest-fKUyITKdiRCrPDQe/49b8cb3c-cb84-4554-be92-0927ddd8032a/preview.jpg",
"durationSeconds": 59
},
"channelId": "31557216",
"isPartner": true,
"description": "Warframe is available to play for free on PC, PS4, PS5, Xbox One, Xbox Series X/S, Nintendo Switch, and iOS! Join our Community Livestream every Thursday at 6 PM ET for the latest Warframe news, gameplay, prizes, & more! Plus, tune into our monthly Devstreams to hear game updates from the Devs!",
"displayName": "Warframe",
"latestVideo": {
"_fromStrapi": true,
"id": "2285093941",
"title": "Warframe | Devstream 182:1999 Deep Dive, Xaku Prime, Trinity Changes & More!",
"thumbnailURL": "https://static-cdn.jtvnw.net/cf_vods/d2nvs31859zcd8/a0bdf9566cd5ad4bad50_warframe_44957183755_1729879478/thumb/custom-2c8bed24-00c3-4f0f-af91-6f49966a7257-100x56.jpeg",
"lengthSeconds": 6569
},
"nextSchedule": null,
"followersCount": 2237542,
"profileImageURL": "https://static-cdn.jtvnw.net/jtv_user_pictures/e991029b-9265-4375-99fe-25b3bffd25a0-profile_image-150x150.png"
},
{
"login": "wwlivecams",
"stream": {
"game": "Just Chatting",
"tags": [
"English",
"gaza",
"gazastrip",
"Israel",
"Israeli",
"IsraelPalestine",
"IsraelVsPalestina",
"sderot",
"Lebanon",
"Beirut"
],
"type": "live",
"title": "Live cams and news covering the Gaza Israel War",
"viewersCount": 34,
"previewImageURL": "https://static-cdn.jtvnw.net/previews-ttv/live_user_wwlivecams-214x120.jpg"
},
"keyword": "war",
"topClip": {
"_fromStrapi": true,
"id": "1896874696",
"title": "Live cams and news covering the Gaza Israel War",
"thumbnailURL": "https://clips-media-assets2.twitch.tv/8tbXYYnjAnbOWXjhFGn97A/43067652808-offset-18940-preview-260x147.jpg",
"durationSeconds": 30
},
"channelId": "507831740",
"isPartner": false,
"description": "Welcome WWLive CamsThe Palestinian Islamist movement Hamas launched the biggest attack on Israel in years on 07.10.2023 in a surprise assault that combined gunmen crossing the border with a heavy barrage of rockets fired from the Gaza Strip.",
"displayName": "wwlivecams",
"latestVideo": null,
"nextSchedule": null,
"followersCount": 1575,
"profileImageURL": "https://static-cdn.jtvnw.net/jtv_user_pictures/0bb0befb-575c-4196-abf1-fff4c9ad2de0-profile_image-150x150.png"
}
]

How to use Twitch API

Sign up for Apify account01

Creating an account is quick and free — no credit card required. Your account gives you access to more than 5,000 scrapers and APIs.

Get started for free
Install Apify Python client02

Install the Apify Python client using pip: pip install apify-client. This package provides a simple interface to interact with Twitch API from your Python applications.

Get your Apify API token03

Go to settings in the Apify console and navigate to the “API & Integrations” tab. There, create a new token and save it for later.

Integrate Twitch API04

Navigate to the Twitch API page and click on the API dropdown menu in the top right corner. In the dropdown menu, you can see API clients, API endpoints, and more. Use the provided Python code examples to integrate Twitch API into your Python application.

Open Twitch Python API
Get your Twitch data via API05

The Twitch API returns structured JSON data that works perfectly with pandas, NumPy, and other Python data analysis libraries.

Why use Apify?

Never get blocked

Every plan (free included) comes with Apify Proxy, which is great for avoiding blocking and giving you access to geo-specific content.

Customers love us

We truly care about the satisfaction of our users and thanks to that we're one of the best-rated data extraction platforms on both G2 and Capterra.

Monitor your runs

With our latest monitoring features, you always have immediate access to valuable insights on the status of your web scraping tasks.

Export to various formats

Your datasets can be exported to any format that suits your data workflow, including Excel, CSV, JSON, XML, HTML table, JSONL, and RSS.

Integrate Apify to your workflow

You can integrate your Apify runs with platforms such as Zapier, Make, Keboola, Google Drive, or GitHub. Connect with practically any cloud service or web app.

Large developer community

Apify is built by developers, so you'll be in good hands if you have any technical questions. Our Discord server is always here to help!

Frequently asked questions

While Twitch does not provide an official Python API client, this scraper offers a different approach by extracting publicly available channel data through web scraping. It's designed for users who need comprehensive channel information without dealing with API authentication, rate limits, or complex integration requirements.

Yes, you can try the Twitch Python API client for free! Apify offers free usage credits for new users, and this Actor is priced at $19.99/month plus usage costs. You can test it with a small dataset to see if it meets your needs before committing to a paid plan.

The Python Twitch API client extracts comprehensive data including channel ID, display name, login, description, profile image URL, follower count, partner status, live stream information (title, game, viewer count, tags), latest video details, top clip information, and upcoming stream schedules. All data is returned in structured JSON format.

Getting started with our Twitch Python API is easy — simply create a free Apify account, get your API token, and start using the Twitch API in Python, JavaScript, CLI, cURL, OpenAPI, or MCP.

Get started with Twitch API Python client today

Get your first Twitch data in Python in less than 5 minutes. No credit card required. No commitment. Cancel anytime.