How to create a proper ajax-request using API?

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.

https://api.twitch.tv/helix/streams?user_login=esl_sc2

The search API is for searching, and the correct URL for that would be

https://api.twitch.tv/helix/search/categories?query=esl_sc2

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