TwitchTV API data = banned users

TwitchTV API data = banned users
0.0 0

#1

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


#2

What response are you getting?


#3

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?


#4
({
"error":"Not Found",
"status":404,
"message":"Channel 'comster404' does not exist"
});

#5

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.


#6

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


#7

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


#8

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.


#9

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.


#10

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": "https://api.twitch.tv/kraken/streams/test_channel",
    "channel": "https://api.twitch.tv/kraken/channels/test_channel"
  }
}

Just curious if anyone has a solution for this?


#12

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.


#13

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.


#14

Yeah if you make a call to

https://wind-bow.gomix.me/twitch-api/users/ + username

it gives you this

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


#16

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?