# Is it possible to get user\_ID without login?

**URL:** <https://discuss.dev.twitch.com/t/is-it-possible-to-get-user-id-without-login/20340>\
**Category:** API\
**Created:** [March 3, 2019, 11:34pm UTC](https://discuss.dev.twitch.com/t/is-it-possible-to-get-user-id-without-login/20340 "2019-03-03T23:34:59Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheKill\_996](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/thekill_996/32/6901_2.png) [@TheKill\_996](https://discuss.dev.twitch.com/u/TheKill_996)\
**Post date:** [March 3, 2019, 11:34pm UTC](https://discuss.dev.twitch.com/t/is-it-possible-to-get-user-id-without-login/20340/1 "2019-03-03T23:34:59Z")

</div>

I’m trying to get the **user\_ID** of a famous streamer on twitch cause I’m creating a bot on Telegram that should notify to the group chat when his streaming goes live. I’ve created an app from [glass.twitch.tv](http://glass.twitch.tv) and now I’m wondering what to do.

I’ve tried to use a chrome extension called [Twitch Username and User ID Translator](https://chrome.google.com/webstore/detail/twitch-username-and-user/laonpoebfalkjijglbjbnkfndibbcoon) that gave me an **user\_ID** , but then using the query founded on the [official twitch dev docs](https://dev.twitch.tv/docs/api/webhooks-reference/#topic-stream-changed).

`https://api.twitch.tv/helix/streams?user_id=5678`

but doing this the loaded page said

`{"error":"Unauthorized","status":401,"message":"Must provide a valid Client-ID or OAuth token"}`

I’ve tried more times: the first time I didn’t insert mine _Client\_ID_ into the _Header_, then the second one I’ve filled the header sain `Client_ID = myclientid` but both times I’ve received that error.

---

<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:** [March 3, 2019, 11:50pm UTC](https://discuss.dev.twitch.com/t/is-it-possible-to-get-user-id-without-login/20340/2 "2019-03-03T23:50:39Z")

</div>

See

> **[Twitch API](https://dev.twitch.tv/docs/api/)**
>
> Twitch API

For an example. You are not sending a header correctly, and can’t tell you how to fix that since you didn’t provide what language you are using or sample code.

See also

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

```auto
curl -H 'Client-ID: uo6dggojyb8d6soh92zknwmi5ej1q2' \
-X GET 'https://api.twitch.tv/helix/streams?first=20'

```

---

<div class="post-metadata">

**Author:** ![TheKill\_996](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/thekill_996/32/6901_2.png) [@TheKill\_996](https://discuss.dev.twitch.com/u/TheKill_996)\
**Post date:** [March 4, 2019, 12:41am UTC](https://discuss.dev.twitch.com/t/is-it-possible-to-get-user-id-without-login/20340/3 "2019-03-04T00:41:44Z")

</div>

I’m currently using a website called [API Tester](https://apitester.com/) to apply these request to the twitch servers, that’s why I didn’t post any code. Did you understand that I’m doing it without the streamer login infos and also without any information of his twitch account apart of the nome of his channel? Cause I don’t know why but I feel that you didn’t.

Any thoughts?

![image](https://d2opxh93rbxzdn.cloudfront.net/original/2X/7/7288753e44c045c552a7ff596ef01bfcc35ee3ae.png)  
In this picture where you see

```
`-X GET https://api.twitch.tv/kraken/users?login=dallas,dallasnchains`

```

what this “dallas,dallasnchains” means? Like if I want to check the **xxx** user\_ID do I have to write _ **xxx** _ instead of **_dallas,dallasnchains_**?

---

<div class="post-metadata">

**Author:** ![Blood\_Wolf89](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/blood_wolf89/32/6786_2.png) [@Blood\_Wolf89](https://discuss.dev.twitch.com/u/Blood_Wolf89)\
**Post date:** [March 4, 2019, 12:57am UTC](https://discuss.dev.twitch.com/t/is-it-possible-to-get-user-id-without-login/20340/4 "2019-03-04T00:57:47Z")

</div>

Are you trying to GET for 2 users?

You can’t seperate the users by a coma. they each need to have ‘login=’ or ‘id=’

A request can include a mixture of login names and user ID. If specifying multiple values (any combination of `id` and/or `login` values), separate them with ampersands; e.g.,  
`GET https://api.twitch.tv/helix/users?login=<login name>&id=<user ID>...`  
`GET https://api.twitch.tv/helix/users?id=<user ID>&id=<user ID>...GET https://api.twitch.tv/helix/users?login=<login name>&login=<login name>...`

Source: [https://dev.twitch.tv/docs/api/reference/#get-users](https://dev.twitch.tv/docs/api/reference/#get-users)

so instead of  
`-X GET https://api.twitch.tv/kraken/users?login=dallas,dallasnchains`

try this  
`-X GET https://api.twitch.tv/kraken/users?login=dallas&login=dallasnchains`

**UPDATE** : I was thinking you were using Helix, not Kraken. Going to leave this for a reference in case anyone needs it in the future.

---

<div class="post-metadata">

**Author:** ![TheKill\_996](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/thekill_996/32/6901_2.png) [@TheKill\_996](https://discuss.dev.twitch.com/u/TheKill_996)\
**Post date:** [March 4, 2019, 1:07am UTC](https://discuss.dev.twitch.com/t/is-it-possible-to-get-user-id-without-login/20340/5 "2019-03-04T01:07:36Z")

</div>

Thanks to the replies I finally got the streamer user\_ID using this code

```auto
-H 'Accept: application/vnd.twitchtv.v5+json' \
-H 'Client-ID: uo6dggojyb8d6soh92zknwmi5ej1q2' \
-X GET https://api.twitch.tv/kraken/users?streamer_name

```

Ok, now I’m wondering which is the correct link to see when he goes on live? Cause I’ve searched into the link that BarryCarlyon has sent (the second one) and there are only ways to get lists of most watched streamer.

So now I’m searching for the request to see when he’s in live.

---

<div class="post-metadata">

**Author:** ![Blood\_Wolf89](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/blood_wolf89/32/6786_2.png) [@Blood\_Wolf89](https://discuss.dev.twitch.com/u/Blood_Wolf89)\
**Post date:** [March 4, 2019, 1:14am UTC](https://discuss.dev.twitch.com/t/is-it-possible-to-get-user-id-without-login/20340/6 "2019-03-04T01:14:47Z")

</div>

To get Stream data you need to use the /streams/ endpoint as the /users/ endpoint does not pull stream data.

Change:  
`https://api.twitch.tv/kraken/users?streamer_name`  
to:  
`https://api.twitch.tv/kraken/streams/<channel ID>` where = username

According to the [Get Stream by User](https://dev.twitch.tv/docs/v5/reference/streams/#get-stream-by-user) Endpoint

### Example Response if the Channel is Live Broadcasting

```auto
{
   "stream": {
      "_id": 23932774784,
      "game": "BATMAN - The Telltale Series",
      "viewers": 7254,
      "video_height": 720,
      "average_fps": 60,
      "delay": 0,
      "created_at": "2016-12-14T22:49:56Z",
      "is_playlist": false,
      "preview": {
         "small": "https://static-cdn.jtvnw.net/previews-ttv/live_user_dansgaming-80x45.jpg",
         "medium": "https://static-cdn.jtvnw.net/previews-ttv/live_user_dansgaming-320x180.jpg",
         "large": "https://static-cdn.jtvnw.net/previews-ttv/live_user_dansgaming-640x360.jpg",
         "template": "https://static-cdn.jtvnw.net/previews-ttv/live_user_dansgaming-{width}x{height}.jpg"
      },
      "channel": {
         "mature": false,
         "status": "Dan is Batman? - Telltale's Batman",
         "broadcaster_language": "en",
         "display_name": "DansGaming",
         "game": "BATMAN - The Telltale Series",
         "language": "en",
         "_id": 7236692,
         "name": "dansgaming",
         "created_at": "2009-07-15T03:02:41Z",
         "updated_at": "2016-12-15T01:33:58Z",
         "partner": true,
         "logo": "https://static-cdn.jtvnw.net/jtv_user_pictures/dansgaming-profile_image-76e4a4ab9388bc9c-300x300.png",
         "video_banner": "https://static-cdn.jtvnw.net/jtv_user_pictures/dansgaming-channel_offline_image-d3551503c24c08ad-1920x1080.png",
         "profile_banner": "https://static-cdn.jtvnw.net/jtv_user_pictures/dansgaming-profile_banner-4c2b8ece8cd010b4-480.jpeg",
         "profile_banner_background_color": null,
         "url": "https://www.twitch.tv/dansgaming",
         "views": 63906830,
         "followers": 538598
      }
   }
}

```

### Example Response if the Channel is Offline

```auto
{
   "stream":null
}

```

---

<div class="post-metadata">

**Author:** ![TheKill\_996](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/thekill_996/32/6901_2.png) [@TheKill\_996](https://discuss.dev.twitch.com/u/TheKill_996)\
**Post date:** [March 4, 2019, 1:22am UTC](https://discuss.dev.twitch.com/t/is-it-possible-to-get-user-id-without-login/20340/7 "2019-03-04T01:22:10Z")

</div>

That’s perfect thanks.

---

<div class="post-metadata">

**Author:** ![Blood\_Wolf89](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/blood_wolf89/32/6786_2.png) [@Blood\_Wolf89](https://discuss.dev.twitch.com/u/Blood_Wolf89)\
**Post date:** [March 4, 2019, 1:25am UTC](https://discuss.dev.twitch.com/t/is-it-possible-to-get-user-id-without-login/20340/8 "2019-03-04T01:25:49Z")

</div>

I’m glad we could help. Any other questions, just ask! 🙂

---

<div class="post-metadata">

**Author:** ![TheKill\_996](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/thekill_996/32/6901_2.png) [@TheKill\_996](https://discuss.dev.twitch.com/u/TheKill_996)\
**Post date:** [March 4, 2019, 1:44am UTC](https://discuss.dev.twitch.com/t/is-it-possible-to-get-user-id-without-login/20340/9 "2019-03-04T01:44:38Z")

</div>

I’m building a script that send the GET request every **_x_** minutes, does Twitch have a cooldown time?  
What the best range of time to wait between one request and the next one?

---

<div class="post-metadata">

**Author:** ![Blood\_Wolf89](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/blood_wolf89/32/6786_2.png) [@Blood\_Wolf89](https://discuss.dev.twitch.com/u/Blood_Wolf89)\
**Post date:** [March 4, 2019, 1:55am UTC](https://discuss.dev.twitch.com/t/is-it-possible-to-get-user-id-without-login/20340/10 "2019-03-04T01:55:59Z")

</div>

I am not aware of the cool down times for the API, However, you should not have any issues hitting the limit. There are projects that hit it up to once every second and still don’t hit the limit.

---

<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:** [March 4, 2019, 9:19am UTC](https://discuss.dev.twitch.com/t/is-it-possible-to-get-user-id-without-login/20340/11 "2019-03-04T09:19:30Z")

</div>

Twitch API has a Rate Limit for the number of Requests you can do in a certain time

Helix:

> **[Twitch API Concepts](https://dev.twitch.tv/docs/api/guide/#rate-limits)**
>
> Twitch API Concepts

Kraken:

No more than once per second (honors system, wheatons law applies)

The Streams end point has a 3/5 minute delay to ensure the data is accurate and to have passed thru caching.

You may want to consider webhooks instead of long polling

[https://dev.twitch.tv/docs/api/webhooks-guide/](https://dev.twitch.tv/docs/api/webhooks-guide/)

---

<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:** [April 3, 2019, 9:19am UTC](https://discuss.dev.twitch.com/t/is-it-possible-to-get-user-id-without-login/20340/12 "2019-04-03T09:19:36Z")

</div>

Closed on April 3, 2019, 9:19am UTC

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