Channels serve as the home location for a user's content. Channels have a stream, can run commercials, store videos, display information and status, and have a customized page including banners and backgrounds.
Endpoint | Description |
---|---|
GET /channels/:channel | Get channel object |
GET /channel | Get channel object |
GET /channels/:channel/videos | Get channel's list of videos |
GET /channels/:channel/follows | Get channel's list of following users |
GET /channels/:channel/editors | Get channel's list of editors |
PUT /channels/:channel | Update channel object |
DELETE /channels/:channel/stream_key | Reset channel's stream key |
POST /channels/:channel/commercial | Start a commercial on channel |
GET /channels/:channel/teams | Get list of teams channel belongs to |
Returns a channel object.
curl -H 'Accept: application/vnd.twitchtv.v3+json' \
-X GET https://api.twitch.tv/kraken/channels/test_channel
{
"mature": false,
"status": "test status",
"broadcaster_language": "en",
"display_name": "test_channel",
"game": "Gaming Talk Shows",
"delay": 0,
"language": "en",
"_id": 12345,
"name": "test_channel",
"created_at": "2007-05-22T10:39:54Z",
"updated_at": "2015-02-12T04:15:49Z",
"logo": "http://static-cdn.jtvnw.net/jtv_user_pictures/test_channel-profile_image-94a42b3a13c31c02-300x300.jpeg",
"banner": "http://static-cdn.jtvnw.net/jtv_user_pictures/test_channel-channel_header_image-08dd874c17f39837-640x125.png",
"video_banner": "http://static-cdn.jtvnw.net/jtv_user_pictures/test_channel-channel_offline_image-b314c834d210dc1a-640x360.png",
"background": null,
"profile_banner": "http://static-cdn.jtvnw.net/jtv_user_pictures/test_channel-profile_banner-6936c61353e4aeed-480.png",
"profile_banner_background_color": "null",
"partner": true,
"url": "http://www.twitch.tv/test_channel",
"views": 49144894,
"followers": 215780,
"_links": {
"self": "https://api.twitch.tv/kraken/channels/test_channel",
"follows": "https://api.twitch.tv/kraken/channels/test_channel/follows",
"commercial": "https://api.twitch.tv/kraken/channels/test_channel/commercial",
"stream_key": "https://api.twitch.tv/kraken/channels/test_channel/stream_key",
"chat": "https://api.twitch.tv/kraken/chat/test_channel",
"features": "https://api.twitch.tv/kraken/channels/test_channel/features",
"subscriptions": "https://api.twitch.tv/kraken/channels/test_channel/subscriptions",
"editors": "https://api.twitch.tv/kraken/channels/test_channel/editors",
"teams": "https://api.twitch.tv/kraken/channels/test_channel/teams",
"videos": "https://api.twitch.tv/kraken/channels/test_channel/videos"
}
}
Returns a channel object of authenticated user. Channel object includes stream key.
Authenticated, required scope: channel_read
curl -H 'Accept: application/vnd.twitchtv.v3+json' -H 'Authorization: OAuth <access_token>' \
-X GET https://api.twitch.tv/kraken/channel
{
"mature": false,
"status": "test status",
"broadcaster_language": "en",
"display_name": "test_channel",
"game": "Gaming Talk Shows",
"delay": 0,
"language": "en",
"_id": 12345,
"name": "test_channel",
"created_at": "2007-05-22T10:39:54Z",
"updated_at": "2015-02-12T04:15:49Z",
"logo": "http://static-cdn.jtvnw.net/jtv_user_pictures/test_channel-profile_image-94a42b3a13c31c02-300x300.jpeg",
"banner": "http://static-cdn.jtvnw.net/jtv_user_pictures/test_channel-channel_header_image-08dd874c17f39837-640x125.png",
"video_banner": "http://static-cdn.jtvnw.net/jtv_user_pictures/test_channel-channel_offline_image-b314c834d210dc1a-640x360.png",
"background": null,
"profile_banner": "http://static-cdn.jtvnw.net/jtv_user_pictures/test_channel-profile_banner-6936c61353e4aeed-480.png",
"profile_banner_background_color": "null",
"partner": true,
"url": "http://www.twitch.tv/test_channel",
"views": 49144894,
"followers": 215780,
"_links": {
"self": "https://api.twitch.tv/kraken/channels/test_channel",
"follows": "https://api.twitch.tv/kraken/channels/test_channel/follows",
"commercial": "https://api.twitch.tv/kraken/channels/test_channel/commercial",
"stream_key": "https://api.twitch.tv/kraken/channels/test_channel/stream_key",
"chat": "https://api.twitch.tv/kraken/chat/test_channel",
"features": "https://api.twitch.tv/kraken/channels/test_channel/features",
"subscriptions": "https://api.twitch.tv/kraken/channels/test_channel/subscriptions",
"editors": "https://api.twitch.tv/kraken/channels/test_channel/editors",
"teams": "https://api.twitch.tv/kraken/channels/test_channel/teams",
"videos": "https://api.twitch.tv/kraken/channels/test_channel/videos"
},
"email": "[email protected]",
"stream_key": "live_5439587_s8df7s9d7g6dsfggsdfg"
}
See the Videos resource.
See the Follows resource.
Returns a list of user objects who are editors of :channel
.
Authenticated, required scope: channel_read
curl -H 'Accept: application/vnd.twitchtv.v3+json' -H 'Authorization: OAuth <access_token>' \
-X GET https://api.twitch.tv/kraken/channels/test_channel/editors
{
"_links": {
"self": "http://api.twitch.tv/kraken/channels/test_channel/editors"
},
"users": [
{
"_links": {
"self": "http://staging.twitch.tv/kraken/users/test_channel_editor"
},
"created_at": "2013-02-06T21:21:57Z",
"name": "test_channel_editor",
"updated_at": "2013-02-13T20:59:42Z",
"_id": 40091581,
"display_name": "test_channel_editor",
"logo": null,
"type": "user",
"bio": "I am a test editor"
},
...
]
}
Update channel's status or game.
Authenticated, required scope: channel_editor
Name | Required? | Type | Description |
---|---|---|---|
status |
optional | string | Channel's title. |
game |
optional | string | Game category to be classified as. |
delay |
optional | string | Channel delay in seconds. Requires the channel owner's OAuth token. |
Form-encoded or JSON parameters specifying the properties to change. These should be under a channel
object:
{
"channel": {
"status": "Playing cool new game!",
"game": "Diablo",
"delay": 60
}
}
curl -H 'Accept: application/vnd.twitchtv.v3+json' -H 'Authorization: OAuth <access_token>' \
-d "channel[status]=Playing+cool+new+game!&channel[game]=Diablo&channel[delay]=0" \
-X PUT https://api.twitch.tv/kraken/channels/test_channel
{
"mature": false,
"status": "Playing cool new game!",
"broadcaster_language": "en",
"display_name": "test_channel",
"game": "Diablo",
"delay": 0,
"language": "en",
"_id": 12345,
"name": "test_channel",
"created_at": "2007-05-22T10:39:54Z",
"updated_at": "2015-02-12T04:15:49Z",
"logo": "http://static-cdn.jtvnw.net/jtv_user_pictures/test_channel-profile_image-94a42b3a13c31c02-300x300.jpeg",
"banner": "http://static-cdn.jtvnw.net/jtv_user_pictures/test_channel-channel_header_image-08dd874c17f39837-640x125.png",
"video_banner": "http://static-cdn.jtvnw.net/jtv_user_pictures/test_channel-channel_offline_image-b314c834d210dc1a-640x360.png",
"background": null,
"profile_banner": "http://static-cdn.jtvnw.net/jtv_user_pictures/test_channel-profile_banner-6936c61353e4aeed-480.png",
"profile_banner_background_color": "null",
"partner": true,
"url": "http://www.twitch.tv/test_channel",
"views": 49144894,
"followers": 215780,
"_links": {
"self": "https://api.twitch.tv/kraken/channels/test_channel",
"follows": "https://api.twitch.tv/kraken/channels/test_channel/follows",
"commercial": "https://api.twitch.tv/kraken/channels/test_channel/commercial",
"stream_key": "https://api.twitch.tv/kraken/channels/test_channel/stream_key",
"chat": "https://api.twitch.tv/kraken/chat/test_channel",
"features": "https://api.twitch.tv/kraken/channels/test_channel/features",
"subscriptions": "https://api.twitch.tv/kraken/channels/test_channel/subscriptions",
"editors": "https://api.twitch.tv/kraken/channels/test_channel/editors",
"teams": "https://api.twitch.tv/kraken/channels/test_channel/teams",
"videos": "https://api.twitch.tv/kraken/channels/test_channel/videos"
}
}
422 Unprocessable Entity
if trying to set delay
for a channel that is not partnered.
Resets channel's stream key.
Authenticated, required scope: channel_stream
curl -H 'Accept: application/vnd.twitchtv.v3+json' -H 'Authorization: OAuth <access_token>' \
-X DELETE https://api.twitch.tv/kraken/channels/test_channel/stream_key
{
"mature": false,
"status": "test status",
"broadcaster_language": "en",
"display_name": "test_channel",
"game": "Gaming Talk Shows",
"delay": 0,
"language": "en",
"_id": 12345,
"name": "test_channel",
"created_at": "2007-05-22T10:39:54Z",
"updated_at": "2015-02-12T04:15:49Z",
"logo": "http://static-cdn.jtvnw.net/jtv_user_pictures/test_channel-profile_image-94a42b3a13c31c02-300x300.jpeg",
"banner": "http://static-cdn.jtvnw.net/jtv_user_pictures/test_channel-channel_header_image-08dd874c17f39837-640x125.png",
"video_banner": "http://static-cdn.jtvnw.net/jtv_user_pictures/test_channel-channel_offline_image-b314c834d210dc1a-640x360.png",
"background": null,
"profile_banner": "http://static-cdn.jtvnw.net/jtv_user_pictures/test_channel-profile_banner-6936c61353e4aeed-480.png",
"profile_banner_background_color": "null",
"partner": true,
"url": "http://www.twitch.tv/test_channel",
"views": 49144894,
"followers": 215780,
"_links": {
"self": "https://api.twitch.tv/kraken/channels/test_channel",
"follows": "https://api.twitch.tv/kraken/channels/test_channel/follows",
"commercial": "https://api.twitch.tv/kraken/channels/test_channel/commercial",
"stream_key": "https://api.twitch.tv/kraken/channels/test_channel/stream_key",
"chat": "https://api.twitch.tv/kraken/chat/test_channel",
"features": "https://api.twitch.tv/kraken/channels/test_channel/features",
"subscriptions": "https://api.twitch.tv/kraken/channels/test_channel/subscriptions",
"editors": "https://api.twitch.tv/kraken/channels/test_channel/editors",
"teams": "https://api.twitch.tv/kraken/channels/test_channel/teams",
"videos": "https://api.twitch.tv/kraken/channels/test_channel/videos"
},
"email": "[email protected]",
"stream_key": "live_5439587_s8df7s9d7g6dsfggsdfg"
}
Start commercial on channel.
Authenticated, required scope: channel_commercial
Name | Required? | Type | Description |
---|---|---|---|
length |
optional | integer | Length of commercial break in seconds. Default value is 30. Valid values are 30, 60, 90, 120, 150, and 180. You can only trigger a commercial once every 8 minutes. |
curl -H 'Accept: application/vnd.twitchtv.v3+json' -H 'Authorization: OAuth <access_token>' \
-d "length=30" -X POST https://api.twitch.tv/kraken/channels/test_channel/commercial
204 No Content
if successful.
422 Unprocessable Entity
if commercial length not allowed, a commercial was ran less than 8 minutes ago, or the channel is not partnered.
Returns a list of team objects :channel
belongs to.
curl -H 'Accept: application/vnd.twitchtv.v3+json' \
-X GET https://api.twitch.tv/kraken/channels/test_channel/teams
{
"_links": {
"self": "http://api.twitch.tv/kraken/channels/test_channel/teams"
},
"teams": [
{
"_links": {
"self": "https://api.twitch.tv/kraken/teams/staff"
},
"_id": 10,
"name": "staff",
"info": "We save the world..\n\n\n",
"display_name": "Twitch Staff",
"created_at": "2011-10-25T23:55:47Z",
"updated_at": "2013-05-24T00:17:12Z",
"logo": "http://static-cdn.jtvnw.net/jtv_user_pictures/team-staff-team_logo_image-e26f89ac4f424216-300x300.png",
"banner": "http://static-cdn.jtvnw.net/jtv_user_pictures/team-staff-banner_image-c81e25b281c06e8f-640x125.png",
"background": null
},
...
]
}