Hello.
I’ll try and keep it short.
I need to add “limit” as a header to “GET https://api.twitch.tv/kraken/streams/followed”, but if I do, it’s still limited to the default 25. The “offset” header has no effect either…
I’m not sure what I’m doing wrong ![]()
I’ve used multiple languages, but get the same result…
Any and all help is appreciated. New to the forums, so excuse the messy post.
Python code:
address = ‘https://api.twitch.tv/kraken/streams/followed’
headers = {
‘Cache-Control’: ‘no-cache’,
‘Accept’: ‘application/vnd.twitchtv.v5+json’,
‘Client-ID’: ‘xxxxxxx’,
‘Authorization’: ‘OAuth xxxxxxx’,
‘offset’: “50”,
‘stream_type’: ‘live’
}
get = requests.get(address, headers=headers)
file = open(“jsincoming.txt”, “w”, encoding=“utf-8”)
file.write(get.text)
file.close()
It returns only 25 live streamers, even though at the top of the json response, it says ’ {“_total”:39 ’
I get the same result in C#
var httpWebRequest = (HttpWebRequest)WebRequest.Create(“https://api.twitch.tv/kraken/streams/followed”);
httpWebRequest.Accept = “application/vnd.twitchtv.v5+json”;
httpWebRequest.Method = “GET”;
httpWebRequest.Headers.Add(“Client-ID”, “xxxxxxx”);
httpWebRequest.Headers.Add(“Authorization”, “OAuth xxxxxxx”);
httpWebRequest.Headers.Add(“limit”, “50”);
httpWebRequest.Headers.Add(“stream_type”, “live”);var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse();
using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
{
var answer = JsonConvert.DeserializeObject(streamReader.ReadToEnd());
Console.Write(answer);
}