Skip to content

Latest commit

 

History

History
186 lines (152 loc) · 4.69 KB

users.md

File metadata and controls

186 lines (152 loc) · 4.69 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 /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 /user

Returns a user object.

Authenticated, required scope: user_read

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.

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.

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": [...]
}