# How can get a stream url by Id or streams urls of a game with new API

**URL:** <https://discuss.dev.twitch.com/t/how-can-get-a-stream-url-by-id-or-streams-urls-of-a-game-with-new-api/24668>\
**Category:** API\
**Created:** [March 30, 2020, 7:02am UTC](https://discuss.dev.twitch.com/t/how-can-get-a-stream-url-by-id-or-streams-urls-of-a-game-with-new-api/24668 "2020-03-30T07:02:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jimmyDim](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/jimmydim/32/8208_2.png) [@jimmyDim](https://discuss.dev.twitch.com/u/jimmyDim)\
**Post date:** [March 30, 2020, 7:02am UTC](https://discuss.dev.twitch.com/t/how-can-get-a-stream-url-by-id-or-streams-urls-of-a-game-with-new-api/24668/1 "2020-03-30T07:02:27Z")

</div>

Hello everyone,  
I have an API and I would like to call the **new twitch API.** Basically I want to get a URL of a stream, for example I want a streaming URL for the userId 1234 or URL streams for the game cs:go.

I found in the old version(v5) the endpoints [Get Stream by User](https://dev.twitch.tv/docs/v5/reference/streams#get-stream-by-user) and [Get Live Streams](https://dev.twitch.tv/docs/v5/reference/streams#get-live-streams) returns a URL and when I click I have a video streaming.

But in the new API that I want to call, the endpoint [Get Streams](https://dev.twitch.tv/docs/api/reference#get-streams) has no URL in response, and there isn’t the endpoint get stream By User.

Finally how I get a streaming video URL in the new API?

---

<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 30, 2020, 9:19am UTC](https://discuss.dev.twitch.com/t/how-can-get-a-stream-url-by-id-or-streams-urls-of-a-game-with-new-api/24668/2 "2020-03-30T09:19:17Z")

</div>

Add the user\_name to the end of the URL

> var url = ‘[http://twitch.tv/](http://twitch.tv/)’ + (resp.data[0].user\_name).toLowerCase()

see also

> <https://github.com/twitchdev/issues/issues/3>
>
> \*\*Brief description\*\*
> 
> Streams API returns the \`user\_name\` as the users \`displ…ay\_name\` instead.
> 
> Meaning for people building a embed from an API lookup either parse the thumbnail URL for the username, or call the users API to get the correct login name for the embed.
> 
> This is particularly a problem for "Korean" Streamers
> 
> For example
> 
> https://api.twitch.tv/helix/streams?user\_id=139470326
> 
> Which returns the user\_name as \`한동숙\` which is not valid for building a embed or channel URL
> 
> \*\*How to reproduce\*\*
> 
> Call https://api.twitch.tv/helix/streams?user\_login=cohhcarnage
> 
> \*\*Expected behavior\*\*
> 
> Return "cohhcarnage" as the user\_name instead of "CohhCarnage"
> 
> And/or extend the endpoint to return both

and for a “fix” when the user\_name != login

> [@Wrong Username from API](https://discuss.dev.twitch.com/t/wrong-username-from-api/23925/2):
>
> This is a often reported issue! Did you search the forums first? See also: [https://github.com/twitchdev/issues/issues/3](https://github.com/twitchdev/issues/issues/3) You can obtain the correct “login” by parsing the “thumbnail\_url” or making an additional call to the users API with the user id from the streams endpoint

---

<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 29, 2020, 9:19am UTC](https://discuss.dev.twitch.com/t/how-can-get-a-stream-url-by-id-or-streams-urls-of-a-game-with-new-api/24668/3 "2020-04-29T09:19:18Z")

</div>

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