Is there a limit to the amount of channels I can search for with one request?

So I want to make a call with a few hundred channels. It looks like this :

https://api.twitch.tv/kraken/streams?channel=snow_iwnl,gamsu8898,200MoreChannels&client_id=XXXXXXXXXXX

is there an upper limit on how many I can make? I’ve noticed I can add the parameter “&limit=100”. However, It doesn’t seem to effect the returned response.

Thanks in advance!

The documentation

Does not state a limit for the channel parameter.

It feels like you can request as many streams as you want via the channel parameter, set the limit to 100 and then use offset to paginate the results.

Personally, if you need to actually lookup this many streams you probably want to use Webhooks instead as documented here:

1 Like

If you’re requesting several hundred channels at once, you may also run into issues due to URL size. For polling >100 channels, it’ll be best practice to limit yourself to a max of 100 at a time, as while Kraken may allow you to put an unlimited number (up until it breaks URL size limits) and page through the results, that endpoint is deprecated and Helix limits you to 100 ID’s or Logins per request so you’d have to split it up into multiple requests anyway.

As Barry mentioned, Webhooks are also something to consider depending on your use case.

1 Like

Thanks for getting back. I have a question regarding “setting the limit to 100 and then use offset of paginate the results”. What should of the offset be? Secondly, I noticed that I need to be using the new Twitch API to use web hooks however when I try a request it returns an error 401 saying that I need a valid client id or OAuth token. However, I’ve checked and it is the correct client ID of the application.

https://api.twitch.tv/helix/streams?channel=snow_iwnl&client_id=XXXXXXXXXXX

shouldn’t that be okay?

You have to provide your client id as the Client-ID header in Helix, not as a query param.

1 Like

I’m sorry I don’t quite understand, I’m pretty new to this. I have been pasting the url into a browser to quickly see the Json. Can I not do that with the new API? and in my javascript file i’ve been using a fetch API request to get the Json data which uses a string with parameters. What should I be using with the new API ?

If you’re just going direct to the API endpoint in the browser, then in most cases without a browser extension to allow you to edit request headers you wont be able to do that with the new Helix API. For simple testing, a lot of people like Postman https://www.getpostman.com/ it’s a simple tool that’s free and lets you set headers and all that you’ll need.

As for using fetch if you check out the docs for it https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch and scroll to “Supplying request options” you’ll see that when making a fetch request, as well as a URL you can also provide an options object, one of the options you can set is the headers, in this case Client-ID

1 Like

Thanks a lot! I appreciate the help.

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