TwitchTV API data = banned users

I’m having trouble getting the banned users from the TwitchTV API data. Is there no such item?

1 Like

What response are you getting?

well, they (twitch) changed api data. It returns “null” for stream now, when it was “undefined” before when users were banned. Now my scripts just show banned users as “offline”. is there another data point for banned users?

"error":"Not Found",
"message":"Channel 'comster404' does not exist"

A 404 is all I’ve ever gotten for Comster, and each time I’ve done this project it’s shown them as not available. I didn’t even think that was a banned account.

I have a list of banned accounts, but they too show up as “offline” only.

I’m getting the same problem. There seems to be no way to distinguish offline or banned accounts easily anymore.

Interesting. This isn’t a thing I’ve thought about before. I found this site that can (or, used to be able to) check whether any given account is banned. It still shows when accounts are valid, but doesn’t seem to indicate when an account is banned or doesn’t exist. The best part about this is that we can take a look at the source code. It just checks the response strings for key phrases, is unavailable likely meaning the account was banned, is not available on Twitch means the account doesn’t exist, and anything else meaning the account is valid.

What I noticed while playing around with this is while the Twitch response has a body with status: 404 in it, the actual HTTP status code is different (422 when I checked comster404). I wish I had more time/energy to sort this out, but it may very well be that Twitch’s API isn’t very consistent in its reporting. Regardless, don’t feel like you must do this project. It’s not going to be required as of the curriculum expansion, and it’s kind of a PITA.

1 Like

I tried so many code snippets from around the interwebs that I was dizzy. I finally gave up on that project challenge after 7 days (12+hrs/day) trying to get that banned api data endpoint working.

I just ran into this same issue. When I use the provided api workaround I am not seeing any difference in the response for an offline stream vs a non-existent stream that I made up.

both are variations on:

  "stream": null,
  "_links": {
    "self": "",
    "channel": ""

Just curious if anyone has a solution for this?

Did you ever manage to resolve this? As I’m struggling to find a way to work out which channels are offline and which don’t exist.

I never tried to figure it out and just moved on to the next challenge. I have heard that you are supposed to make two separate API calls to sort it out, but it has been a while since I looked at the problem. I think I have some time later today to work on it.

Yeah if you make a call to + username

it gives you this

Object {display_name: “ESL_SC2”, _id: 30220059, name: “esl_sc2”, type: “user”, bio: “For standings, schedule, and results, visit”…}
Object {display_name: “RobotCaleb”, _id: 54925078, name: “robotcaleb”, type: “user”, bio: null…}
Object {error: “Not Found”, status: 404, message: “User “brunofin” was not found”}

Thanks for the clarification. It turns out my original attempt at this challenge was using the “/streams/” api call instead of “/channels/”. After switching my API call everything was working just fine :slight_smile:

@tom42s Did you get it figured out?