Hello, I’m trying to get a list of online Streams in a Community.
I know about this Curl request:
curl -H ‘Accept: application/vnd.twitchtv.v5+json’ \
-H ‘Client-ID: SECRET’ \
-X GET ‘https://api.twitch.tv/kraken/streams/?community_id=COMMUNITYID’
However it returns only 24 Streams. If there are more live I dont receive them. Now I’m wondering if there is a way to get a full list?
Look at this:
You need to make repeated requests in the loop, and in each subsequent request you need to specify the pagination in the after.
Also look at the parameter ‘after’, if you want to get more streamers in one query.
Thanks for your reply, those look promising but what would the request URL look like?
I’ve been trying these:
^This gives me a lot of streams but not the ones in the community and no pagination
^ This is a empty response
^ This gives me the streams in the community but no pagination
I’m not very familiar with the API and just guessing, so maybe you could help me out
? is the start of the querystring, each parameter/value pair is separated with an
?, which is why your first 2 didn’t work as intended.
Also, you’re still using kraken, the new API would be https://api.twitch.tv/helix/streams?first=20&community_id=4d2aef2c-35f5-40b3-8a0e-35a79d7175c5
this returns the first 20 streams with that community ID in a
data array, there’s also a
pagination field which contains a cursor which can be set as the
after querystring parameter to fetch the next set of results (which will contain a cursor for the next page, and so on).
You two are heros. Thanks for saving the day!
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.