qollers qollers - 8 months ago 59
Ajax Question

Twitch API stream search URL get total streams AJAX

I have an ajax function hitting the Twitch API to get up to 100 "runescape" streams.

type: 'GET',
url: 'https://api.twitch.tv/kraken/search/streams?limit=100&offset=0&q=runescape',
headers: {'Client-ID': 'xxx'},
success: function(data) {

This returns the JSON response:
Object {_total: 95, _links: Object, streams: Array[82]}

But in my Twitch API URL, I've set
. I want the URL to return an object with
streams: Array[95]
to match the
_total: 95
. Because
total_: 95
is less than the
, I thought I would be able to get all the streams into one
array, but this isn't the case. Anybody familiar with the Twitch API? How come this isn't the case?

doc: https://dev.twitch.tv/docs/api/v3/streams#get-streams

Jim Jim

You better go with:


Because as of the time of writing this it's a known issue they return less results then expected on the search endpoint