# I am so new to this live or not respond using API

**URL:** <https://discuss.dev.twitch.com/t/i-am-so-new-to-this-live-or-not-respond-using-api/24765>\
**Category:** API\
**Created:** [April 3, 2020, 8:09am UTC](https://discuss.dev.twitch.com/t/i-am-so-new-to-this-live-or-not-respond-using-api/24765 "2020-04-03T08:09:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kasper\_glud](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/kasper_glud/32/8246_2.png) [@kasper\_glud](https://discuss.dev.twitch.com/u/kasper_glud)\
**Post date:** [April 3, 2020, 8:09am UTC](https://discuss.dev.twitch.com/t/i-am-so-new-to-this-live-or-not-respond-using-api/24765/1 "2020-04-03T08:09:50Z")

</div>

Hello, how do i get if a person is live in my browser window?

using the twitch api?

i have come to this spot:  
[https://api.twitch.tv/kraken/streams/channel\_name?client\_id=xxxxxx](https://api.twitch.tv/kraken/streams/channel_name?client_id=xxxxxx)

response code:  
{“error”:“Gone”,“status”:410,“message”:“The API version you are looking for is in another castle. See [https://dev.twitch.tv/docs](https://dev.twitch.tv/docs)”}

The Oauth token is the localhost  
[http://localhost](http://localhost)

---

<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:** [April 3, 2020, 11:04am UTC](https://discuss.dev.twitch.com/t/i-am-so-new-to-this-live-or-not-respond-using-api/24765/2 "2020-04-03T11:04:01Z")

</div>

I covered this in this recent post

> [@Viewer Counter - HELP](https://discuss.dev.twitch.com/t/viewer-counter-help/24726/2):
>
> You can use the Get Streams API to periodically poll for the current view count This won’t work client side, due to the upcoming oAuth requirements You will need to generate and use a Server to Server token AKA App Token on a Server cron job.

> [@kasper\_glud](#):
>
> Hello, how do i get if a person is live in my browser window?

Due to upcoming changes to the Twitch API, you don’t due to oAuth requirements (unless using implict auth but you don’t want to authenticate random website visitors)

> [@kasper\_glud](#):
>
> response code:  
> {“error”:“Gone”,“status”:410,“message”:“The API version you are looking for is in another castle. See [https://dev.twitch.tv/docs”](https://dev.twitch.tv/docs%E2%80%9D)}

This indicates you didn’t set the required version header as documented

> [@kasper\_glud](#):
>
> i have come to this spot:  
> [https://api.twitch.tv/kraken/streams/channel\_name?client\_id=xxxxxx](https://api.twitch.tv/kraken/streams/channel_name?client_id=xxxxxx)

This is wrong, you need to use the channel ID and the client\_id _should_ be sent as header

> **[Reference](https://dev.twitch.tv/docs/api/reference/)**
>
> Twitch Developer tools and services to integrate Twitch into your development or create interactive experience on twitch.tv.

> [@kasper\_glud](#):
>
> The Oauth token is the localhost  
> [http://localhost](http://localhost)

So you are potentially leaking your oAuth token in a webpage to other users? Assuming you have not used implicit auth? This is not allowed, an oAuth token is _like_ a Password, and shouldn’t be left in front end code, where others can see other peoples tokens.

---

<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:** [May 3, 2020, 11:04am UTC](https://discuss.dev.twitch.com/t/i-am-so-new-to-this-live-or-not-respond-using-api/24765/3 "2020-05-03T11:04:04Z")

</div>

Closed on May 3, 2020, 11:04am UTC

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