Helix API / Get Videos returns 404 if 1 id doesn't exist

The New Twitch API has a “Get Videos” endpoint (https://dev.twitch.tv/docs/api/reference/#get-videos) that you can specify up to 100 ids for to return information on those videos. However, if even 1 of those ids no longer exists, or isn’t a valid vod, the entire response is:
{“error”:“Not Found”,“status”:404,“message”:“vods not found”}

A better output would be to return just the valid videos, like the Get Users endpoint does.

Flagging to Twitch

Cheers, is this not the intended output?

You are right in that it should behave like Get Users does

If that’s not the intended behavior then boy do I have a nice bug dump for you lol.

But in reality, it’s enough of a split that from a user’s perspective either way could be viewed as “correct”. I can gather all the endpoint behavior data I’ve collected when I get home and post them if everything should act like the /users endpoint.

It’s the logical response when specifying multiple IDs, because the alternative is to call the API 100 times which they’re trying to avoid as far as I can tell.

I see valuable things from both perspectives. From Twitch’s point of view, anything to help prevent people from hitting the API hard is a win for them. On the other hand, returning 200 - OK when there still could have been an error somewhere in the mix is a bit counter-intuitive, and an annoyance to the developer. A compromise that I could see would be to return an 4XX error, and then in the content put all of the malformed/erroneous data you provided. That way you can just filter out everything that was wrong, update your caches, you only need to make one more request as opposed to individual requests, and you were directly notified that there was in fact an error.

But in the end, it’s up to Twitch to decide what they want. I’d just like some form of uniformity across the API, which there is surprisingly little of.

Is there any ETA on when the response will be “fixed”/changed?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.