Twitch user videos API
  1. Docs
  2. Twitch
  3. Twitch user videos API

Twitch user videos API

A channel's videos (up to 100): id, title, views, game, duration and thumbnails.

GET /v1/twitch/user/videos

GET /v1/twitch/user/videos

A channel's videos (up to 100): id, title, views, game, duration and thumbnails.

  • Cost: 1 credit
  • Cache: Results are kept up to 30 days; send max_age_days to reuse them for free.
  • Timeout: A request still running after about 25 seconds answers 202 with a job to poll (Batch and jobs).

Parameters#

NameTypeRequiredDescription
handlestringyesUsername, with or without the leading @. Also accepted as username.
typestringnoKind of video. One of highlight, archive, upload. Also accepted as filter_by, filter. Also accepted values: HIGHLIGHT for highlight, ARCHIVE for archive, UPLOAD for upload.
sortstringnoOrder of results. Changing it restarts the cursor chain. One of time, views. Also accepted as sort_by, sortBy, order. Also accepted values: TIME for time, VIEWS for views.
limitintegernoHow 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). Range 1 to 100.

Every request also accepts:

  • cursor: the cursor from the previous page (Pagination).
  • trim: true for a smaller response without null fields and extra.
  • raw: true to also get the platform's original object as raw.
  • max_age_days: accept a cached result up to this many days old, for 0 credits (Caching).

Example request#

Set your key in the environment first (see Authentication).

1curl -G "https://api.socialscrape.dev/v1/twitch/user/videos" \2  -H "x-api-key: $SOCIALSCRAPE_API_KEY" \3  --data-urlencode "handle=shroud" \4  --data-urlencode "type=highlight" \5  --data-urlencode "sort=views" \6  --data-urlencode "limit=10"

Example response#

This is a sample from a recorded response, lists and long text are shortened. Status 200.

200 OKSample response
1{2  "ok": true,3  "credits_charged": 1,4  "credits_remaining": 4999,5  "cached": false,6  "cached_at": null,7  "request_id": "req_d60acf6cd59f9e464094749b",8  "data": {9    "object": "list",10    "items": [11      {12        "object": "post",13        "platform": "twitch",14        "id": "1526143078",15        "url": "https://www.twitch.tv/videos/1526143078",16        "type": "video",17        "author": {18          "id": "37402112",19          "handle": "shroud",20          "name": "shroud",21          "url": "https://www.twitch.tv/shroud",22          "avatar_url": "https://static-cdn.jtvnw.net/jtv_user_pictures/c754eebf-745b-4e0a-814a-10bcaecaabbc-profile_image-300x300.png",23          "verified": null24        },25        "title": "Highlight: the grind continues......?",26        "text": null,27        "published_at": "2022-07-08T19:28:43Z",28        "duration_seconds": 2616.0,29        "language": "en",30        "hashtags": null,31        "mentions": null,32        "stats": {33          "views": 37725,34          "likes": null,35          "comments": null,36          "shares": null,37          "saves": null,38          "dislikes": null39        },40        "media": {41          "thumbnail_url": "https://static-cdn.jtvnw.net/cf_vods/d2nvs31859zcd8/a79dbbd4e2da30dfc62a_shroud_14459702619_3278251629//thumb/thumb1526143078-320x180.jpg",42          "video_url": null,43          "audio_url": null,44          "image_urls": null,45          "width": null,46          "height": null47        },48        "song": null,49        "location": null,50        "is_pinned": null,51        "is_sponsored": null,52        "extra": {53          "animated_preview_url": "https://d2nvs31859zcd8.cloudfront.net/a79dbbd4e2da30dfc62a_shroud_14459702619_3278251629/storyboards/1526143078-strip-0.jpg",54          "broadcast_type": "highlight",55          "created_at": "2022-07-08T19:28:43Z",56          "game": "VALORANT",57          "game_id": "516575",58          "status": "recorded"59        }60      },61      {62        "object": "post",63        "platform": "twitch",64        "id": "1995417333",65        "url": "https://www.twitch.tv/videos/1995417333",66        "type": "video",67        "author": {68          "id": "37402112",69          "handle": "shroud",70          "name": "shroud",71          "url": "https://www.twitch.tv/shroud",72          "avatar_url": "https://static-cdn.jtvnw.net/jtv_user_pictures/c754eebf-745b-4e0a-814a-10bcaecaabbc-profile_image-300x300.png",73          "verified": null74        },75        "title": "GTA 6 Trailer",76        "text": null,77        "published_at": "2023-12-04T23:40:23Z",78        "duration_seconds": 806.0,79        "language": "en",80        "hashtags": null,81        "mentions": null,82        "stats": {83          "views": 19254,84          "likes": null,85          "comments": null,86          "shares": null,87          "saves": null,88          "dislikes": null89        },90        "media": {91          "thumbnail_url": "https://static-cdn.jtvnw.net/cf_vods/d2nvs31859zcd8/aa4d47db4f3d6723dd36_shroud_72253881914_5037481556/thumb/custom-c67b8f7c-dff9-4184-a710-dcb008063a72-320x180.png",92          "video_url": null,93          "audio_url": null,94          "image_urls": null,95          "width": null,96          "height": null97        },98        "song": null,99        "location": null,100        "is_pinned": null,101        "is_sponsored": null,102        "extra": {103          "animated_preview_url": "https://d2nvs31859zcd8.cloudfront.net/aa4d47db4f3d6723dd36_shroud_72253881914_5037481556/storyboards/1995417333-strip-0.jpg",104          "broadcast_type": "highlight",105          "created_at": "2023-12-04T23:40:23Z",106          "game": "World of Warcraft",107          "game_id": "18122",108          "status": "recorded"109        }110      }111    ],112    "cursor": null,113    "has_more": false,114    "parent": {115      "object": "profile",116      "platform": "twitch",117      "id": "37402112",118      "handle": "shroud",119      "name": "shroud",120      "headline": null,121      "url": "https://www.twitch.tv/shroud",122      "kind": "channel",123      "bio": null,124      "avatar_url": "https://static-cdn.jtvnw.net/jtv_user_pictures/c754eebf-745b-4e0a-814a-10bcaecaabbc-profile_image-300x300.png",125      "banner_url": null,126      "verified": null,127      "is_private": null,128      "external_url": null,129      "links": null,130      "location": null,131      "category": null,132      "created_at": null,133      "stats": {134        "followers": null,135        "following": null,136        "posts": null,137        "likes": null,138        "views": null139      },140      "extra": null141    }142  },143  "cursor": null,144  "has_more": false145}

Response#

A list of Post objects in data.items, with data.cursor and data.has_more.

See Data models for every field. The envelope around data is described in Responses.

Errors#

Failures are free: credits_charged is 0. Branch on error.code, never on the message.

CodeHTTPRetryMeaning
invalid_params400noA parameter is missing, unknown or has the wrong type.
not_found404noThe platform says this profile, post or item does not exist.

Every request can also fail with the account and platform errors listed on the Errors page.