Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various Helix Endpoints return the users DisPlaYName instead of login #3

Open
BarryCarlyon opened this issue Dec 6, 2019 · 17 comments
Labels
product: api API endpoints in the "helix" namespace ticketed Has been given an internal tracking ticket

Comments

@BarryCarlyon
Copy link
Contributor

BarryCarlyon commented Dec 6, 2019

Brief description

Streams API returns the user_name as the users display_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

@BarryCarlyon BarryCarlyon added the product: api API endpoints in the "helix" namespace label Dec 6, 2019
@BarryCarlyon
Copy link
Contributor Author

The problem also exists with the follows endpoint

For example: https://api.twitch.tv/helix/users/follows?to_id=26610234

{
"from_id": "79645823",
"from_name": "Cochelosf",
"to_id": "26610234",
"to_name": "CohhCarnage",
"followed_at": "2019-12-06T19:44:14Z"
}

Both to_name and from_name contain the users display_name instead of the user login

@BarryCarlyon
Copy link
Contributor Author

Issue also exists on live_activated_channels

{
"channels": [
{
"id": "40118378",
"username": "Chronor007",
"game": "Magic: The Gathering",
"title": "🥴 Trying new Liliana deck from Twitch Prime!🥴 [GER/EN] !sounds !sr ",
"view_count": "9218"
}
]
}

@BarryCarlyon
Copy link
Contributor Author

Issues also exists on "Get Clips"

{
"data": [
{
"id": "EmpathicWildGuanacoKappaClaus",
"url": "https://clips.twitch.tv/EmpathicWildGuanacoKappaClaus",
"embed_url": "https://clips.twitch.tv/embed?clip=EmpathicWildGuanacoKappaClaus",
"broadcaster_id": "26610234",
"broadcaster_name": "CohhCarnage",
"creator_id": "17268377",
"creator_name": "KrunkSplein",
"video_id": "520874596",
"game_id": "494684",
"language": "en",
"title": "Loading Rock",
"view_count": 33,
"created_at": "2019-12-13T15:46:03Z",
"thumbnail_url": "https://clips-media-assets2.twitch.tv/AT-cm%7C583875183-preview-480x272.jpg"
}
],
"pagination": {}
}

@mauerbac mauerbac added the ticketed Has been given an internal tracking ticket label Mar 30, 2020
@mauerbac
Copy link

HLX-1333

@BarryCarlyon
Copy link
Contributor Author

The new

https://dev.twitch.tv/docs/api/reference#get-channel-information

also has this issue, for example

{
  broadcaster_id: '23161357',
  broadcaster_name: 'LIRIK',
  broadcaster_language: 'en',
  game_id: '497440',
  game_name: 'Hell Let Loose',
  title: ':D '
}

@BarryCarlyon
Copy link
Contributor Author

https://dev.twitch.tv/docs/extensions/reference/#get-live-channels-with-extension-activated

Example use case:

https://twitch.extensions.barrycarlyon.co.uk/elitetrack/

To show streamers live with my extension and link to their channel, I have to do two requests, one to live_activated then a second to users to get the login for link/embed purposes

@dilizarov
Copy link

dilizarov commented Sep 13, 2020

@BarryCarlyon so what is the solution for generating URLS via this API: https://dev.twitch.tv/docs/api/reference#get-users?

If I'm reading correctly, display_name is not a reliable parameter (korean characters, etc. possible), so I should leverage the login parameter instead?

That is to say if I got { ..., display_name: "Display Name", login: "loginname", ... }, then I would generate the url https://twitch.tv/loginname, correct?

Essentially my use case is trying to get the URL to the authenticated user's profile.

@BarryCarlyon
Copy link
Contributor Author

If I'm reading correctly, display_name is not a reliable parameter (korean characters, etc. possible), so I should leverage the login parameter instead?

Correct, the users API is the ONLY API that returns the actual login, where the login is used for URLs.

If you called the streams API, you get a list of Display Names then have to do a lookup against the users API to get the logins for construction URLs/links to channel. Two lookups where one should of suffice.

@BarryCarlyon
Copy link
Contributor Author

https://dev.twitch.tv/docs/api/reference/#get-stream-markers

Returns dISPlayNAME instead of user login for the creating user of the marker

@BarryCarlyon
Copy link
Contributor Author

Example use case: https://barrycarlyon.github.io/twitch_misc/examples/browse_following/

I have to do one call to get the streams of the people I follow.
Then a second call to get the usernames of those people to generate a link to that stream.

@BarryCarlyon
Copy link
Contributor Author

EventSub has now contracted the virus for saying "name" and sending dIsPlAy_NaMe instead

@BarryCarlyon
Copy link
Contributor Author

Eventsub fixed it on eventsub \o/

BarryCarlyon added a commit to BarryCarlyon/twitch_misc that referenced this issue Jan 29, 2021
…kuped as the streams API has the login returned as user_name
@BarryCarlyon
Copy link
Contributor Author

BarryCarlyon commented Jan 29, 2021

As per todays documentation and API update noted in the change log

https://dev.twitch.tv/docs/change-log

The following endpoints no longer suffer from GitHub issue 3.

GET	helix/bits/leaderboard
GET	helix/channel_points/custom_rewards
PATCH helix/channel_points/custom_rewards
POST helix/channel_points/custom_rewards
GET	helix/channel_points/custom_rewards/redemptions
PATCH helix/channel_points/custom_rewards/redemptions
GET	helix/extensions/transactions
GET	helix/moderation/banned
GET	helix/moderation/banned/events
GET	helix/moderation/moderators
GET	helix/moderation/moderators/events
GET	helix/search/channels
GET	helix/streams
GET	helix/streams/markers
GET	helix/videos
GET	helix/users/follows

Most notably omitted at this time are the subscription related endpoints and extension live_activated_channels

But not longer for streams do we need to fetch users to get the username to link with! \o/

@BarryCarlyon
Copy link
Contributor Author

Channel editors has the virus!

https://dev.twitch.tv/docs/api/reference#get-channel-editors

@BarryCarlyon
Copy link
Contributor Author

BarryCarlyon commented Mar 4, 2022

And the new Get Extension Live Channels has it too which replaced extension live_activated_channels

https://dev.twitch.tv/docs/api/reference#get-extension-live-channels

@Xemdo
Copy link

Xemdo commented Jul 27, 2023

Get Extension Live Channels and Get Channel Editors currently seem to be correct as per our documentation. broadcaster_name is the display name, not the user's login. The Get Extension Live Channels endpoint simply does not return the user's login, just Display Name and User ID.

Behavior likely wont change as user_name is consistent across all API endpoints. Ideally it would be called display_name instead, but since the field is already in place it would be a breaking change to rename it.
Best course of action from here would be adding the field user_login to these endpoints, but that would be a UserVoice suggestion rather than a bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product: api API endpoints in the "helix" namespace ticketed Has been given an internal tracking ticket
Projects
None yet
Development

No branches or pull requests

4 participants