justintv / Twitch-API

A home for details about our API
www.twitch.tv
1.72k stars 381 forks source link

How could I get a list of broadcasters' streams? #655

Closed skyline-123 closed 7 years ago

skyline-123 commented 7 years ago

Excuse me. I wanna get information of many broadcasters. What should I do for getting the JSON file that including all the streams by only one request?

jwmalara commented 7 years ago

See: https://github.com/justintv/Twitch-API/blob/master/v3_resources/streams.md#parameters

You can feed the 'channel' parameter a comma separated list of channel names

Example: https://api.twitch.tv/kraken/streams?channel=lirik,richard_hammer

Before using this, however, I'd make sure this is available in V5. I personally haven't looked into it yet. I assume it works the same way but with ids instead of names.

Also, keep in mind that your results are still paged if they exceed 100 channels.

skyline-123 commented 7 years ago

@jwmalara The method is available, however, adding "client_id" query string variable breaks "/stream" requests if I feed the 'channel' parameter. I changed it from '?client_id' to '&client_id' and finally made it. So, the twitch api really confused me a lot. Anyway, thank u so much.