Multiple Users Stream Checking

So i’m creating an application in javascript, and it checks whether or not the user is streaming and returns information about the user, if they’re online it returns their status. But generally it needs to grab a) the display name b) the users profile picture and c) their channel link. Currently using 3 API calls to /streams/,/channels/ to fetch the information I need i’m just wondering is their a better way to query the api rather than making 2 api calls? is there a way this can be accomplished with just one, is there a method to navigate through links on the api like "self":"https://api.twitch.tv/kraken/channels/streamerhouse" or is the 2 api calls the only way?

The /streams endpoint should have all the information you need (it also contains a channel object), but it only returns any information for streams that are online. You can check several streams at once by separating them with a comma: https://api.twitch.tv/kraken/streams?channel=joshimuz,torikslv
The returned array only contains those streams that are online, so you would have to request the info you need (display name, profile picture) for the ones not online via a /channels/:channel call. I don’t think you can request several in one call for that, but I might be wrong.

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