Streams API. Several users streaming-status in a single request

Hello everyone.
This is my 1st post, so there can be an answer, if so - you can just give me the link.

The problem is:
I have several (about 100) accounts I’m tracking in my application. And I want to get status on that accounts for every user that uses my app.
Currently to get if any of those 100 users is streaming I have to make 1 request per user to twitch api like this: https://api.twitch.tv/kraken/streams/{username} after that I’m looking for “stream” node in response and get information from it (stream-screenshot, viewers number etc)

Important thing: I’m not making any of those request on my backend server all is implemented at client side (no caching for now)

I wonder if there any single request for that purpose that I can pass list of ids or screen-names
Something like this maybe: /kraken/streams?users=username1,username2,…

Thanks in advance

UPDATE 1: /search/streams didn’t work well for me
I tried this one: https://github.com/justintv/Twitch-API/blob/master/v2_resources/search.md#get-searchstreams
passing q parameter as username1 OR username2 OR username3 … but it doesn’t give me the same result as 100 separate requests. Also tried different portions of accounts (15, 25, 50 in a single request) combining with limit parameter. Didn’t work

/streams/ will take a channels parameter, like this:

https://api.twitch.tv/kraken/streams?channel=trick2g,beyondthesummit2,starladder1

It returns one stream object for each active stream. There was someone experiencing some issues when requesting a high number of channels, I believe there is a cap to how many you can put in at once(50, 100 maybe?). To take care of that, you could split up the list into multiple requests.

1 Like

Thank you so much. It looks like it’s working!

I think that the number of streams you can include depends on the URL length. Some servers cannot handle URLs beyond a certain number of characters.