Getting All Streamers for Game

Is it possible to get a list of all League of Legends streams? I currently am able to get the top 100, but I want to get a list of all of the streamers. Is this possible or will the API always limit me to the top 100 streamers?

Oh…im guessing the offset parameter will help me here. Will update and close after successful test.

You should use the next link in the response, if possible.

Yeah I actually just saw that. I’m guessing I can just keep requesting until the JSON returns less than 100 streamers or does the next link not exist if the list is exhausted?

Keep looping until the next offset returns nothing in “streams”.

my usual breaker is something like the below. It doesn’t have a “cursor”, so just use the next link and iterate until the stream object returns no values or null. Just make sure this is the first thing the new data of the iteration hits. Otherwise you’ll get unexpected results.

if(streams.value == null) 
    //handle your breaker 
   break; //or return whatever suits your needs. Important 
//Handle your stream object

It’s a pretty basic view on it, but yeah, it works.

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