# Web html script followers count

**URL:** <https://discuss.dev.twitch.com/t/web-html-script-followers-count/39497>\
**Category:** API\
**Created:** [July 14, 2022, 7:32pm UTC](https://discuss.dev.twitch.com/t/web-html-script-followers-count/39497 "2022-07-14T19:32:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![filipvysin](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/filipvysin/32/18974_2.png) [@filipvysin](https://discuss.dev.twitch.com/u/filipvysin)\
**Post date:** [July 14, 2022, 7:32pm UTC](https://discuss.dev.twitch.com/t/web-html-script-followers-count/39497/1 "2022-07-14T19:32:25Z")

</div>

hi, how can i make my twitch followers display on my html site? I already managed it on youtube, I managed to find a html script from the internet, but I can’t find anything on twitch, on youtube I used this: [YouTube subs counter - Pastebin.com](https://pastebin.com/Jq67TNpC)

My website: [https://www.difrox.eu](https://www.difrox.eu)

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [July 14, 2022, 8:11pm UTC](https://discuss.dev.twitch.com/t/web-html-script-followers-count/39497/2 "2022-07-14T20:11:11Z")

</div>

You need a backend server or script.  
That then uses an app access token to go and fetch your value and store the value into a database or something  
Your website then loads your count from the database or something.

There isn’t something _like_ the script for YouTube since the authentication requirements are different.

This covers WHAT YOU DO ON THE BACKEND OR IN A SCRIPT _NOT_ IN THE FRONT END as if you do it in the front end you would leak your client secret

1. Generate an app access token [Getting OAuth Access Tokens | Twitch Developers](https://dev.twitch.tv/docs/authentication/getting-tokens-oauth#client-credentials-grant-flow)
2. Call Get Follows API With `first` 1 and your user ID in the `to_id` [Reference | Twitch Developers](https://dev.twitch.tv/docs/api/reference#get-users-follows)
3. Extract the `total` key from the response and store that somewhere
4. Your website then loads from the somewhere and displays it on your site

---

<div class="post-metadata">

**Author:** ![system](https://d2opxh93rbxzdn.cloudfront.net/original/2X/0/05909729875cce3b53e59d5561c4d23bb14948fc.png) [@system](https://discuss.dev.twitch.com/u/system)\
**Post date:** [August 13, 2022, 8:11pm UTC](https://discuss.dev.twitch.com/t/web-html-script-followers-count/39497/3 "2022-08-13T20:11:33Z")

</div>

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