Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Latest commit

 

History

History
245 lines (203 loc) · 6.14 KB

users.md

File metadata and controls

245 lines (203 loc) · 6.14 KB

Users

These are members of the Twitch community who have a Twitch account. If broadcasting, they can own a stream that they can broadcast on their channel. If mainly viewing, they might follow or subscribe to channels.

Endpoint Description
GET /users/:user Get user object
GET /users/:user/emotes Get list of user's emotes
GET /user Get user object
GET /streams/followed Get list of streams user is following
GET /videos/followed Get list of videos belonging to channels user is following

GET /users/:user

Returns a user object.

Example Request

curl -H 'Accept: application/vnd.twitchtv.v3+json' \
-X GET https://api.twitch.tv/kraken/users/test_user1

Example Response

{
  "type": "user",
  "name": "test_user1",
  "created_at": "2011-03-19T15:42:22Z",
  "updated_at": "2012-06-14T00:14:27Z",
  "_links": {
    "self": "https://api.twitch.tv/kraken/users/test_user1"
  },
  "logo": "http://static-cdn.jtvnw.net/jtv_user_pictures/test_user1-profile_image-6947308654ad603f-300x300.jpeg",
  "_id": 21229404,
  "display_name": "test_user1",
  "bio": "test bio woo I'm a test user"
}

GET /users/:user/emotes

Returns a list of emoticons that the user is authorized to use.

Authenticated, required scope: user_subscriptions

Example Request

curl -H 'Accept: application/vnd.twitchtv.v3+json' -H 'Authorization: OAuth <access_token>' \
-X GET https://api.twitch.tv/kraken/users/test_user1/emotes

Example Response

{
  "emoticon_sets": {
    "0": [
      {
        "id": 25,
        "code": "Kappa"
      },
      {
        "id": 1902,
        "code": "Keepo"
      },
      ...
    ],
    "469": [
      {
        "id": 2412,
        "code": "pipeKoppa"
      },
      {
        "id": 33152,
        "code": "pipeKappa"
      },
      ...
    ]
  }
}

GET /user

Returns a user object.

Authenticated, required scope: user_read

Note: If the user's Twitch registered Email Address is not verified, null will be returned.

Example Request

curl -H 'Accept: application/vnd.twitchtv.v3+json' -H 'Authorization: OAuth <access_token>' \
-X GET https://api.twitch.tv/kraken/user

Example Response

{
  "type": "user",
  "name": "test_user1",
  "created_at": "2011-06-03T17:49:19Z",
  "updated_at": "2012-06-18T17:19:57Z",
  "_links": {
    "self": "https://api.twitch.tv/kraken/users/test_user1"
  },
  "logo": "http://static-cdn.jtvnw.net/jtv_user_pictures/test_user1-profile_image-62e8318af864d6d7-300x300.jpeg",
  "_id": 22761313,
  "display_name": "test_user1",
  "email": "[email protected]",
  "partnered": true,
  "bio": "test bio woo I'm a test user",
  "notifications": {
    "email": true,
    "push": false
  }
}

GET /streams/followed

Returns a list of stream objects that the authenticated user is following.

Authenticated, required scope: user_read

Parameters

Name Required? Type Description
limit optional integer Maximum number of objects in array. Default is 25. Maximum is 100.
offset optional integer Object offset for pagination. Default is 0.
stream_type optional string Only shows streams from a certain type. Permitted values: all, playlist, live

Example Request

curl -H 'Accept: application/vnd.twitchtv.v3+json' -H 'Authorization: OAuth <access_token>' \
-X GET https://api.twitch.tv/kraken/streams/followed

Example Response

{
  "_links": {
    "self": "https://api.twitch.tv/kraken/streams/followed?limit=25&offset=0",
    "next": "https://api.twitch.tv/kraken/streams/followed?limit=25&offset=25"
  },
  "_total": 123,
  "streams": [...]
}

GET /videos/followed

Returns a list of video objects from channels that the authenticated user is following.

Authenticated, required scope: user_read

Parameters

Name Required? Type Description
limit optional integer Maximum number of objects in array. Default is 10. Maximum is 100.
offset optional integer Object offset for pagination. Default is 0.
broadcast_type optional string Only shows videos of a certain type. Supported values: all, archive, highlight. Default: all.

Example Request

curl -H 'Accept: application/vnd.twitchtv.v3+json' -H 'Authorization: OAuth <access_token>' \
-X GET https://api.twitch.tv/kraken/videos/followed

Example Response

{
  "_links": {
    "self": "https://api.twitch.tv/kraken/videos/followed?limit=10&offset=0",
    "next": "https://api.twitch.tv/kraken/videos/followed?limit=10&offset=25"
  },
  "videos": [...]
}