How to 'Get streamtitle & game name or even image' in HTML/jquery

I’ve done some searching and learned that you need a client ID and oauth first inorder to retrieve info from twitch. However how does the command look like if I already have the client id and oauth in HTML/Jquery

With jQuery:

  $.ajax('https://api.twitch.tv/helix/streams?user_id=' + 32218175, // put your channel/user ID here
      {
        headers: {
          "Client-ID":  'myclientIDgoeshere0123456789' // put your Client-ID here
        }
      })
      .then(console.log)

For just HTML:

  fetch('https://api.twitch.tv/helix/streams?user_id=' + 32218175,
  {
    headers: {
      "Client-ID":  'myclientIDgoeshere0123456789'
    }
  })
  .then(result => result.json())
  .then(console.log)
1 Like

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