# Get user\_ID with username

**URL:** <https://discuss.dev.twitch.com/t/get-user-id-with-username/13598>\
**Category:** API\
**Created:** [January 10, 2018, 12:41am UTC](https://discuss.dev.twitch.com/t/get-user-id-with-username/13598 "2018-01-10T00:41:21Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![AndreMatosDeSousa](https://avatars.discourse-cdn.com/v4/letter/a/e95f7d/32.png) [@AndreMatosDeSousa](https://discuss.dev.twitch.com/u/AndreMatosDeSousa)\
**Post date:** [January 10, 2018, 12:41am UTC](https://discuss.dev.twitch.com/t/get-user-id-with-username/13598/1 "2018-01-10T00:41:21Z")

</div>

I have [twitch.tv/AndreMatosdeSousa](http://twitch.tv/AndreMatosdeSousa), now how can I get the user ID of AndreMatosdeSousa?

---

<div class="post-metadata">

**Author:** ![oantby](https://avatars.discourse-cdn.com/v4/letter/o/7ab992/32.png) [@oantby](https://discuss.dev.twitch.com/u/oantby)\
**Post date:** [January 10, 2018, 4:53am UTC](https://discuss.dev.twitch.com/t/get-user-id-with-username/13598/2 "2018-01-10T04:53:59Z")

</div>

the users API will let you do this.

[https://api.twitch.tv/kraken/users?AndreMatosdeSousa](https://api.twitch.tv/kraken/users?AndreMatosdeSousa)

will return you JSON about the user, including their user id. A valid client id must be included in the headers. See [https://dev.twitch.tv/docs/v5#translating-from-user-names-to-user-ids](https://dev.twitch.tv/docs/v5#translating-from-user-names-to-user-ids) for more info

---

<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:** [January 10, 2018, 4:27pm UTC](https://discuss.dev.twitch.com/t/get-user-id-with-username/13598/3 "2018-01-10T16:27:39Z")

</div>

Under new API:

[https://api.twitch.tv/helix/users?login=AndreMatosdeSousa](https://api.twitch.tv/helix/users?login=AndreMatosdeSousa)

---

<div class="post-metadata">

**Author:** ![swiftyspiffy](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/swiftyspiffy/32/1279_2.png) [@swiftyspiffy](https://discuss.dev.twitch.com/u/swiftyspiffy)\
**Post date:** [January 10, 2018, 11:15pm UTC](https://discuss.dev.twitch.com/t/get-user-id-with-username/13598/5 "2018-01-10T23:15:18Z")

</div>

This endpoint doesn’t work if the channel/stream is offline though, right?

---

<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:** [January 11, 2018, 12:58am UTC](https://discuss.dev.twitch.com/t/get-user-id-with-username/13598/6 "2018-01-11T00:58:30Z")

</div>

_whistles and swaps streams for users_

Totally copied the wrong url from me history

---

<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:** [February 10, 2018, 12:58am UTC](https://discuss.dev.twitch.com/t/get-user-id-with-username/13598/7 "2018-02-10T00:58:38Z")

</div>

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