Seeing All of my Followers

Hi,
So I recently created a point system within my bot that adds access to my database once a user has followed. I use the code below to get a list of follows however it is only the most recent 25 followers. I was wondering how i would modify it to get the entire list.
$.ajax({
url: 'https://api.twitch.tv/kraken/channels/ ‘Actual Channel ID Number ’ /follows’,
type: ‘GET’,
contentType: ‘application/json’,
headers: {
‘Accept’ : ‘application/vnd.twitchtv.v5+json’,
‘Client-ID’ : ‘Actual id’,

   	},
	success: function(data) {
		console.log(JSON.stringify(data));
	}
});

The max number of results you can get in a single request is 100, which could you get by adding ?limit=100 to the end of that url.

If you have more than 100 followers you have to make multiple requests and either increase the offset querystring parameter by the same amount as the limit, or by taking the _cursor value from one set of results, and using that as the cursor querystring parameter which will get the next page of results, and repeat the process until all followers are obtained.

You may also want to consider checking out the New Twitch API endpoint for this functionality https://dev.twitch.tv/docs/api/reference#get-users-follows :slight_smile:

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