I don’t understand why, when using the example for the Twitch API (Get Clip), I receive a 200 OK response, but there is no data:
{
“data”: ,
“pagination”: {}
}
I’ve attempted various approaches, including changing the game ID, etc., but I’m unable to comprehend the reason behind this.
The clip in the example AwkwardHelplessSalamanderSwiftRage
no longer exists (or didn’t exist at all)
barrycarlyon@Robyn ~ % twitch api get 'clips?broadcaster_id=26610234&first=1'
{
"data": [
{
"broadcaster_id": "26610234",
"broadcaster_name": "CohhCarnage",
"created_at": "2020-10-29T12:50:24Z",
"creator_id": "82959868",
"creator_name": "Kokonut678",
"duration": 60,
"embed_url": "https://clips.twitch.tv/embed?clip=ManlySmokyMagpieBatChest",
"game_id": "512895",
"id": "ManlySmokyMagpieBatChest",
"is_featured": false,
"language": "en",
"thumbnail_url": "https://clips-media-assets2.twitch.tv/AT-cm%7C912028987-preview-480x272.jpg",
"title": "Ubisoft back at it again with the greed!",
"url": "https://clips.twitch.tv/ManlySmokyMagpieBatChest",
"video_id": "",
"view_count": 242639,
"vod_offset": null
}
],
"pagination": {
"cursor": "eyJiIjpudWxsLCJhIjp7IkN1cnNvciI6Ik1RPT0ifX0"
}
}
The API is functioning as expected for me. Test example fetching 1 clip for cohhcarnage channel via the Twitch CLI
So what is the actual call you are making?
I didn’t do the right thing I wanted to retrieve the 5 most viewed clips by game id but I left Broadcast_id I solved my problem sorry for the inconvenience it was a silly mistake
Which if anyone else comes across this post looking for an answer is:
Use Get Games to convert a game name to and ID then use that ID with the Get Clips API with a game_id
paramter and a first
of 5
barrycarlyon@Robyn ~ % twitch api get 'games?name=once human'
{
"data": [
{
"box_art_url": "https://static-cdn.jtvnw.net/ttv-boxart/1441208453_IGDB-{width}x{height}.jpg",
"id": "1441208453",
"igdb_id": "204538",
"name": "Once Human"
}
]
}
barrycarlyon@Robyn ~ % twitch api get 'clips?game_id=1441208453&first=5'
{
"data": [
{
"broadcaster_id": "23161357",
"broadcaster_name": "LIRIK",
"created_at": "2023-12-11T21:44:27Z",
"creator_id": "40819468",
"creator_name": "phrozenwarrior",
"duration": 13.1,
"embed_url": "https://clips.twitch.tv/embed?clip=BraveTolerantTitanCorgiDerp-H6LMugCw12dVBInM",
"game_id": "1441208453",
"id": "BraveTolerantTitanCorgiDerp-H6LMugCw12dVBInM",
"is_featured": false,
"language": "en",
"thumbnail_url": "https://clips-media-assets2.twitch.tv/5v6-pR-izLoAsNdnVQSJzA/AT-cm%7C5v6-pR-izLoAsNdnVQSJzA-preview-480x272.jpg",
"title": "Lirik uses a new type of grenade",
"url": "https://clips.twitch.tv/BraveTolerantTitanCorgiDerp-H6LMugCw12dVBInM",
"video_id": "",
"view_count": 6109,
"vod_offset": null
},
{
"broadcaster_id": "189850266",
"broadcaster_name": "BIGRUSSIANMUM",
"created_at": "2023-12-14T04:05:33Z",
SNIP
1 Like
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.