Your URL is wrong
You need to call Get Streams https://api.twitch.tv/helix/streams with the user_login param instead, for online/offline checking.
The search API is for searching, and the correct URL for that would be
As for tokens, since this is an ajax call an implicit token is most appropriate
You will need to prompt the user to login with Twitch to get a token that you can use in the front end.
This example, will call the users API but you can substitute as needed: Twitch Implicit Auth Example