Issues with Twitch Account Status Validator Tool

My Twitch account status checker stopped working properly and I need help figuring out what went wrong.

I built this tool several months back that lets users input their username to check if their Twitch account has been suspended or not. It was working fine before but now it’s broken and I can’t figure out why.

Here’s the code I’m using:

var validateAccount = function (username) {
    $(".info-text").fadeOut(30)
    
    $.getJSON('https://api.twitch.tv/kraken/users/' + encodeURIComponent(username) + '?callback=?').done(function (response) {
        if (/.+is unavailable$/.test(response.message)) {
            var msg = 'Your account appears to be suspended from Twitch. Please contact '
            msg += '<a target="_blank" href="https://help.twitch.tv/customer/portal/emails/new?interaction[name]=' + username + '">Twitch support</a> '
            msg += 'to understand the reason for suspension.<br />'
            msg += '<span>This tool cannot assist with appeals</span>'
            displayResult('error', msg)
        } else if (/.+is not available on Twitch$/.test(response.message) || /.+does not exist$/.test(response.message)) {
            var msg = 'This username either doesn\'t exist or isn\'t a valid Twitch account.'
            displayResult('warning', msg)
        } else {
            var msg = 'This account appears to be active and not suspended. '
            msg += 'If you\'re still having access issues, try disabling VPN or proxy services.<br/><br/>'
            msg += 'Remember that Twitch may apply IP-based restrictions, so check other accounts too.<br/><br/>'
            msg += 'If problems persist, your IP might be flagged. '
            msg += '<a style="color: #fff" href="https://help.twitch.tv/customer/portal/emails/new" target="_blank"><strong>Contact support</strong></a> for assistance.'
            displayResult('ok', msg)
        }
    }).fail(function () {
        displayResult('warning', 'API request failed. Twitch services might be down.')
    })
}

var displayResult = function (status, text) {
    var heading = status === 'ok' ? "Account looks good!" : 
                 status === 'warning' ? "Something seems off!" : "Problem detected!"
    
    $('.output').attr('class', 'output')
    $('.output').html('<h3>' + heading + '</h3>' + text)
    $('.output').addClass(status)
    $(".output").fadeIn()
}

$(document).ready(function () {
    $('#username-form').submit(function (event) {
        event.preventDefault()
    })
    
    $('#username-form').keyup(function (event) {
        if (event.keyCode !== 13) return
        
        event.preventDefault()
        var inputUser = $('#username-form input').val()
        window.location.hash = '#' + inputUser
        validateAccount(inputUser)
    })
    
    if (location.hash) {
        var hashUser = location.hash.substr(1)
        $('#username-form input').val(hashUser)
        validateAccount(hashUser)
    }
})

Any ideas what might be causing the malfunction? The API calls seem to be the same but maybe something changed on Twitch’s end?

The Kraken API’s been dead for ages - that’s your issue. I switched to Helix but it’s annoying since you can’t make client-side calls anymore. You need a server backend for OAuth. Plus the response format’s completely different, so you’ll have to rewrite your suspension detection code.

Yeah, this is definitely the Twitch API deprecation issue. That Kraken endpoint (https://api.twitch.tv/kraken/users/) got shut down in February 2022 - that’s why your tool broke. I dealt with the same thing on one of my projects.

You’ll have to switch to the new Helix API, but it’s not a simple swap. The new one needs proper auth with client credentials and doesn’t support JSONP callbacks. Plus the endpoint structure changed (https://api.twitch.tv/helix/users).

Worst part? You can’t make direct browser calls to Helix because of CORS restrictions. You’ll need a backend service to handle the requests or find a different approach. Some devs are using unofficial workarounds, but those won’t last.

Had this exact problem last year with my checker tool. Twitch killed their entire Kraken API system - that’s what your code’s using. The /kraken/users/ endpoint is gone, so your requests just fail.

What’s really annoying is the new Helix API won’t work client-side. It needs OAuth tokens and has CORS restrictions, so you can’t just swap the URL like before.

I rebuilt mine as a Node.js backend that handles auth and proxies requests to Helix. The whole API structure changed too - you can’t get suspension info from error messages anymore. You have to check user data through different response patterns. It’s basically a full rewrite, not a quick fix.

Your code’s hitting the deprecated Kraken API - Twitch killed it in 2022. Same thing happened to my monitoring scripts when they randomly started erroring out. Migrating isn’t simple though. Helix needs server-side setup since you can’t handle the auth client-side anymore. Every request needs a client ID and bearer token. Detecting suspensions got way harder too. Kraken gave you clear error messages to parse, but Helix doesn’t have those suspension flags. Now you’ve got to guess from response patterns and HTTP codes. I built a basic Express.js proxy to handle OAuth and forward requests to Helix. Takes about a day if you know backend stuff, but it’s really the only solid option now.

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