API data storage

This is basically a question similar to Clarification on data storage restrictions

Ok, so my question is what data are we actually allowed to store from the API?

I’m creating a website and I’d like to store the users bio, logo, their email, twitch id for the case that in the future twitch does decide to allow users to change their username, the total viewer count, follower count, current/last game played (e.g. Mario Cart 64) & current viewer count if the stream is online.

The “user data” portion and “channel metadata” portion feel ambiguous and feel like they were specifically worded to be vague. (https://www.twitch.tv/user/legal?page=api_terms_of_service)

As it is this is how I currently see what data belongs to which and therefore isn’t allowed to be stored.
User Data:

  • Bio
  • Email
  • Account creation date
  • ID
  • Profile picture

Channel Data:

  • Game name
  • Total viewer count
  • Follower count

Stream Data: (allowed)

  • Viewer count

If we are not in fact allowed to store any of the above for periods longer than 24 hours, how can we go about creating sites that require similar data to socialblade/loots/streamhatchet and others?

Specifically, I would like to be able to store some of the data that is returned from http://api.twitch.tv/kraken/channels/twitch and https://api.twitch.tv/kraken/streams?channel=twitch and later expand into more.
Could we get some information as to why the 24hour limit exists? As well as what data specifically is meant? You’ve done such a good job at explaining why/when the auth token must be deleted.

1 Like

Shameful bump.

I would also like to know this. Additionally, is there an ID that never changes? Right now I am using the username as unique identifier, but if Twitch ever decided to allow to change this, it would really screw up my application.

“Twitch user data for users not created by your application may be stored for no more than twenty-four (24) hours.”

Interpreted literally, this means we can not store anything useful from Twitch like emails and usernames. We need more info. If we can’t store the username and other useful info for authentication, this makes the Twitch API nearly useless.

There is _id which is the twitch id of the user, that id never changes.
https://api.twitch.tv/kraken/channels/twitch would be an example of where _id (12826) exists. https://api.twitch.tv/kraken/users/twitch confirms that the _id (12826) is the same and persists.

Yeah, I ended up rewriting to use the _id instead.

function authenticated_user($access_token) {
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, 'https://api.twitch.tv/kraken/user');
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, array(
        'Authorization: OAuth '.$access_token
	curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    $output = curl_exec($ch);
    $response = json_decode($output, true);

    return $response;		

For future searches.

More to come on this soon! Sorry for the delay!

Thank you!
Looking forward to it :slight_smile:

@DallasNChains any updates?

No updates yet! I’ll keep you posted. :slight_smile:

I think that if we understood the motivation behind a time-restricted retention policy, we might be able to make better judgement calls when faced with uncertainty.

What perceptions are we agreeing to protect?

Is there any movement on this?
If no one is able to explain the restriction and no one particularly cares what we store or for how long, then why not remove it from the TOS?

We’re updating our ToS from top-to-bottom. More to come soon.

Here is a thread on the new terms. New Developer Agreement and Terms of Service

1 Like

Well done, thanks for this.

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