Twitch user videos API
A channel's videos (up to 100): id, title, views, game, duration and thumbnails.
- Cost
- 1 credit
- Cached repeats
- 0 creditssend max_age_days, results kept 30 days
- Failed requests
- 0 credits
- Status
- Betashape may still gain fields
You send handle.
Request
Send your key in the x-api-key header.
curl -G "https://api.socialscrape.io/v1/twitch/user/videos" \
-H "x-api-key: $SOCIALSCRAPE_API_KEY" \
--data-urlencode 'handle=shroud' \
--data-urlencode 'type=highlight' \
--data-urlencode 'sort=views' \
--data-urlencode 'limit=10'import os
import requests
params = {
"handle": "shroud",
"type": "highlight",
"sort": "views",
"limit": 10,
}
res = requests.get(
"https://api.socialscrape.io/v1/twitch/user/videos",
headers={"x-api-key": os.environ["SOCIALSCRAPE_API_KEY"]},
params=params,
timeout=60,
)
body = res.json()
if body["ok"]:
print(body["data"])
else:
print(body["error"]["code"], body["error"]["message"])const url = new URL("https://api.socialscrape.io/v1/twitch/user/videos");
url.search = new URLSearchParams({
handle: "shroud",
type: "highlight",
sort: "views",
limit: "10",
}).toString();
const res = await fetch(url, {
headers: { "x-api-key": process.env.SOCIALSCRAPE_API_KEY! },
});
const body = await res.json();
if (body.ok) {
console.log(body.data);
} else {
console.error(body.error.code, body.error.message);
}{
"nodes": [
{
"name": "SocialScrape Twitch user videos",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
0,
0
],
"parameters": {
"method": "GET",
"url": "https://api.socialscrape.io/v1/twitch/user/videos",
"sendQuery": true,
"queryParameters": {
"parameters": [
{
"name": "handle",
"value": "shroud"
},
{
"name": "type",
"value": "highlight"
},
{
"name": "sort",
"value": "views"
},
{
"name": "limit",
"value": "10"
}
]
},
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "x-api-key",
"value": "={{ $env.SOCIALSCRAPE_API_KEY }}"
}
]
}
}
}
],
"connections": {}
}Parameters
| Name | Type | Required | Description |
|---|---|---|---|
handle | string | yes | Username, with or without the leading @. Also accepted as username. |
type | string | Kind of video. Also accepted as filter_by, filter. | |
sort | string | Order of results. Changing it restarts the cursor chain. Also accepted as sort_by, sortBy, order. | |
limit | integer | How many videos to return, up to 100 (Twitch allows no paging past the first 100 without a browser session, so the response has no cursor). | |
cursor | string | Opaque cursor from the previous page; pass it back unchanged. Also accepted as continuationToken, continuation_token, next_max_id, max_id, max_cursor, min_time, after, page_token, pageToken, paginationToken, next_page_id, page. |
Every request also accepts trim, raw and max_age_days.
Response
Sample from a recorded response, shortened. Values are public data, not yours.
{
"ok": true,
"credits_charged": 1,
"credits_remaining": 4999,
"cached": false,
"cached_at": null,
"request_id": "req_d60acf6cd59f9e464094749b",
"data": {
"object": "list",
"items": [
{
"object": "post",
"platform": "twitch",
"id": "1526143078",
"url": "https://www.twitch.tv/videos/1526143078",
"type": "video",
"author": {
"id": "37402112",
"handle": "shroud",
"name": "shroud",
"url": "https://www.twitch.tv/shroud",
"avatar_url": "https://static-cdn.jtvnw.net/jtv_user_pictures/c754eebf-745b-4e0a-814a-10bcaecaabbc-profile_image-300x300.png",
"verified": null
},
"title": "Highlight: the grind continues......?",
"text": null,
"published_at": "2022-07-08T19:28:43Z",
"duration_seconds": 2616,
"language": "en",
"hashtags": null,
"mentions": null,
"stats": {
"views": 37725,
"likes": null,
"comments": null,
"shares": null,
"saves": null,
"dislikes": null
},
"media": {
"thumbnail_url": "https://static-cdn.jtvnw.net/cf_vods/d2nvs31859zcd8/a79dbbd4e2da30dfc62a_shroud_14459702619_3278251629//thumb/thumb1526143078-320x180.jpg",
"video_url": null,
"audio_url": null,
"image_urls": null,
"width": null,
"height": null
},
"song": null,
"location": null,
"is_pinned": null,
"is_sponsored": null,
"extra": {
"animated_preview_url": "https://d2nvs31859zcd8.cloudfront.net/a79dbbd4e2da30dfc62a_shroud_14459702619_3278251629/storyboards/1526143078-strip-0.jpg",
"broadcast_type": "highlight",
"created_at": "2022-07-08T19:28:43Z",
"game": "VALORANT",
"game_id": "516575",
"status": "recorded"
}
},
{
"object": "post",
"platform": "twitch",
"id": "1995417333",
"url": "https://www.twitch.tv/videos/1995417333",
"type": "video",
"author": {
"id": "37402112",
"handle": "shroud",
"name": "shroud",
"url": "https://www.twitch.tv/shroud",
"avatar_url": "https://static-cdn.jtvnw.net/jtv_user_pictures/c754eebf-745b-4e0a-814a-10bcaecaabbc-profile_image-300x300.png",
"verified": null
},
"title": "GTA 6 Trailer",
"text": null,
"published_at": "2023-12-04T23:40:23Z",
"duration_seconds": 806,
"language": "en",
"hashtags": null,
"mentions": null,
"stats": {
"views": 19254,
"likes": null,
"comments": null,
"shares": null,
"saves": null,
"dislikes": null
},
"media": {
"thumbnail_url": "https://static-cdn.jtvnw.net/cf_vods/d2nvs31859zcd8/aa4d47db4f3d6723dd36_shroud_72253881914_5037481556/thumb/custom-c67b8f7c-dff9-4184-a710-dcb008063a72-320x...",
"video_url": null,
"audio_url": null,
"image_urls": null,
"width": null,
"height": null
},
"song": null,
"location": null,
"is_pinned": null,
"is_sponsored": null,
"extra": {
"animated_preview_url": "https://d2nvs31859zcd8.cloudfront.net/aa4d47db4f3d6723dd36_shroud_72253881914_5037481556/storyboards/1995417333-strip-0.jpg",
"broadcast_type": "highlight",
"created_at": "2023-12-04T23:40:23Z",
"game": "World of Warcraft",
"game_id": "18122",
"status": "recorded"
}
}
],
"cursor": null,
"has_more": false,
"parent": {
"object": "profile",
"platform": "twitch",
"id": "37402112",
"handle": "shroud",
"name": "shroud",
"headline": null,
"url": "https://www.twitch.tv/shroud",
"kind": "channel",
"bio": null,
"avatar_url": "https://static-cdn.jtvnw.net/jtv_user_pictures/c754eebf-745b-4e0a-814a-10bcaecaabbc-profile_image-300x300.png",
"banner_url": null,
"verified": null,
"is_private": null,
"external_url": null,
"links": null,
"location": null,
"category": null,
"created_at": null,
"stats": {
"followers": null,
"following": null,
"posts": null,
"likes": null,
"views": null
},
"extra": null
}
},
"cursor": null,
"has_more": false
}Fields
A page of results. Each entry in items is a Post. cursor and has_more page through the rest.
A field the platform does not give is null, never made up. Extra platform details are in extra.
| Field | Type | Always | Notes |
|---|---|---|---|
object | "post" | ||
platform | Platform | yes | |
id | string | yes | |
url | string or null | ||
type | "video" or "short" or "reel" or "image" or "carousel" or "story" or "live" or "clip" or "text" or "link" or "tweet" or "pin" or "community_post" or "episode" or "unknown" | ||
author | Author or null | ||
title | string or null | ||
text | string or null | ||
published_at | string (ISO 8601 date-time) or null | ||
duration_seconds | number or null | ||
language | string or null | ||
hashtags | string[] or null | ||
mentions | string[] or null | ||
stats | Stats |
Show the other 6 fields
Full field list in the reference for this endpoint and the data models. Errors are listed under Errors.
Questions
Which errors can it return?
invalid_params (do not retry), not_found (do not retry). Account and platform errors from the errors list can also happen. A failure always costs 0 credits.
How do I get more than one page?
Send the same request with cursor set to the cursor you received, until has_more is false. Each page costs its own price. See pagination.
Is there an SDK call for it?
The preview Python client has client.twitch.user_videos(...) and the TypeScript client client.twitch.userVideos(). Both return the same envelope as the HTTP API. The packages are not published yet; plain HTTP works today in any language.
Can an AI agent call it?
Yes. The MCP server reaches every built endpoint, with the same prices.