Older users returning undefined in v5 USERS

Example translating user named Nice to v5 ID:
https://api.twitch.tv/kraken/users?login=nice
You get:

{
  "_total": 1,
  "users": [
    {
      "display_name": "Nice",
      "_id": "204416",
      "name": "nice",
      "type": "user",
      "bio": "ChubzyKik: ScaredPsn: Xur \/ Scared",
      "created_at": "2007-12-17T21:45:33.839812Z",
      "updated_at": "2016-12-09T01:45:44.344078Z",
      "logo": "https:\/\/static-cdn.jtvnw.net\/jtv_user_pictures\/nice-profile_image-9e639b1dc2ede357-300x300.jpeg"
    }
  ]
}

But from USERS endpoint you get:

    {
      "error": "Unprocessable Entity",
      "status": 422,
      "message": "User \"204416\" is unavailable"
    }

So it’s a bit inconsistent and also allows to get users which are banned (?).

Also unrelated but funny, the user Undefined actually exists and it’s chat is just like you would expect.

Are you sure you’re requesting a user using v5 and not v3? I’d check the parameters you’re sending with the request.

It’s a suspended account and the /users/?login= shouldn’t be returning its data.

This happens when a user has had a name change. Twitch rewrites the username, but to keep the old username reserved for a while it assigns it to a brand new user account, with a brand new user id, which happens to be automatically suspended and return the above result (422 status code).

Did not know that. Makes sense though. Thanks for the info.

This seems to be fixed now. https://api.twitch.tv/kraken/users?login=nice (for any username that no longer exists) returns no results now.

1 Like

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