Twitch viewers, follow and title code

Hey, im coding my new website www.andyduden.com, and were woundring how i could set title, viewers and a follow button too my website

Hello there,

All of what you want can be achieved by using Twitch’s API.

You can use GET /streams/:channel/ (:channel is the channel you are trying to get the info from) to get the title and viewers if the channel is live
or you can use GET /channels/:channel/ to get the title if the stream is offline

In order to get a follow button on your website you would need to have the users authenticate with the user_follows_edit scope and then you can use PUT /users/:user/follows/channels/:target (:user is the authenticated user and :target is the channel that you want to be followed)

You can find the full information on the github page: https://github.com/justintv/twitch-api

Let me know if you have any more questions

how will the html code be in my site?

You can’t do it using HTML alone.

You would first need to create a client application and then auth the users on your website. You can use Twitch SDK (It can be found here = https://github.com/justintv/twitch-js-sdk) to do that. Then you can use PHP or Javascript for instance to make all the API calls