question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Twitch Kraken version update

See original GitHub issue

I received this email, as I’m sure you all did too:

https://blog.twitch.tv/action-required-twitch-api-version-update-f3a21e6c3410

ACTION REQUIRED: Twitch API Version Update

TL;DR: Read all of this. It’s important and will break your integrations. We’re changing how the Twitch API works and old versions of our API will be deprecated and removed.

Today, we’re delivering a change that you’ve requested for quite some time! Twitch API v5 is available now and uses IDs to reference users instead of usernames. This new API version puts us in a better position to add new functionality and features to both the API and the Twitch website.

You can start using v5 and upgrading your integrations today. You simply pass the application/vnd.twitchtv.v5+json header on your requests. We’re working hard to deliver reference documentation on the affected endpoints by mid-December. Here is a quick example:

Retrieving a user in v3 curl -H 'Client-ID: XXXXX' \ -H 'Accept: application/vnd.twitchtv.v3+json' \ https://api.twitch.tv/kraken/users/dallas

Retrieving a user in v5 curl -H 'Client-ID: XXXXX' \ -H 'Accept: application/vnd.twitchtv.v5+json' \ https://api.twitch.tv/kraken/users/44322889

There are other changes to note with this version:

  • The _links object is removed from all responses. As a developer, you will be responsible for handling the paging offsets when polling the API.
  • Added sub-second precision to time fields.
  • Removed /games/featured endpoint.
  • Removed delay, background, and banner from the channels response object.
  • Replaced q and type parameters on the search endpoint. The q parameter is now called query. The type parameter is always set to suggest.
  • Removed paywalled field from the video response object.
  • Removed /kraken/chat, /kraken/chat/emoticons, and /kraken/chat/emoticon_index.

What does this mean for me as a developer? You need to migrate your code to use v5. On February 14, 2017, we will be removing v1 and v2 of the API and transition v3 into a deprecated state. In one year (February 14, 2018), v3 will be removed from the API. We hope that this gives enough transition time for your integrations.

If your integration relies on username now, you can use the /users endpoint to translate from a username to an ID as shown below.

curl -H 'Client-ID: XXXXX' \ -H 'Accept: application/vnd.twitchtv.v3+json' \ https://api.twitch.tv/kraken/users/dallas

For questions regarding this transition, please ask on the developer forum thread. We know this is a big transition and want to help in any way that we can.

Thank you for being a part of the Twitch Developer community!

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
AlcaDesigncommented, Jan 8, 2017

When you receive a message, you get a userstate object. The key “room-id” is the channel ID.

0reactions
AlcaDesigncommented, Jan 8, 2017

I guess everything would need to accept an ID in that case, but they’re using strings for the IDs. If you were to pass a string ID, it’d be indistinguishable from a channel name. Perhaps you should form a Channel class that will store the name and the ID and then it’s clear.

class Channel {
    constructor(data = {}) {
        this.id = data.id || null;
        this.name = data.name || null;
    }
}

module.exports.Channel = Channel;
client.prototype.join = function(channel) {
        let chan = channel;
        if(channel instanceof Channel) {
            chan = channel.name;
        }
        /* ... */
    };
const tmi = require('tmi.js');

let client = new tmi.client({ /* ... */ });

const channels = {
        alca: new tmi.Channel({
                id: '7676884',
                name: 'alca'
            })
    }

client.join(channels.alca);

I don’t hate this, but at least it’s clear-ish. Or just an object. Doesn’t have to be a whole class thing. The class is just a disguise for a pretty plain object.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ACTION REQUIRED: Twitch API Version Update
We're changing how the Twitch API works and old versions of our API will be deprecated and ... https://api.twitch.tv/kraken/users/dallas.
Read more >
Upgrading to v5 of the Twitch kraken API Tutorial - YouTube
I livestreamed updating some of my code to use v5 of the Twitch API and I thought people might find it useful as...
Read more >
Twitch Kraken API Sunset Update... | Scoreboard Assistant
Twitch retired their Kraken API last year. ... Twitch Kraken API Sunset Update. ... If you are still browsing with a cached version...
Read more >
TwitchDev - Twitter
Twitch API v5 endpoints are no longer available. A final farewell to the kraken as we look forward to new functionality in the...
Read more >
New Twitch Helix API supported? - WordPress.org
Heyho, we still run the Version 7.13.10 of your SuperSocializer. At this year Twitch.tv will stop the support for its KRAKEN-API.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found