Skip to content

Latest commit

 

History

History
238 lines (207 loc) · 6.73 KB

videos.md

File metadata and controls

238 lines (207 loc) · 6.73 KB

Videos

Videos are broadcasts or chapters owned by a channel. Broadcasts are unedited videos that are saved after a streaming session. Chapters are videos edited from broadcasts by the channel's owner.

Endpoint Description
GET /videos/:id Get video object
GET /videos/top Get top videos by number of views
GET /channels/:channel/videos Get list of video objects belonging to channel
GET /videos/followed Get list of videos belonging to channels user is following

GET /videos/:id

Returns a video object.

Example Request

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

Example Response

{
  "title": "Twitch Weekly - February 6, 2015",
  "description": "Twitch Weekly LIVE on February 6, 2015!",
  "broadcast_id": 13019796368,
  "status": "recorded",
  "_id": "c6055863",
  "tag_list": "",
  "recorded_at": "2015-02-06T21:01:09Z",
  "game": null,
  "length": 4015,
  "preview": "http://static-cdn.jtvnw.net/jtv.thumbs/archive-621292653-320x240.jpg",
  "url": "http://www.twitch.tv/twitch/c/6055863",
  "views": 318,
  "broadcast_type": "highlight",
  "_links": {
    "self": "https://api.twitch.tv/kraken/videos/c6055863",
    "channel": "https://api.twitch.tv/kraken/channels/twitch"
  },
  "channel": {
    "name": "twitch",
    "display_name": "Twitch"
  }
}

GET /videos/top

Returns a list of videos created in a given time period sorted by number of views, most popular first.

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.
game optional string Returns only videos from game.
period optional string Returns only videos created in time period. Valid values are week, month, or all. Default is week.

Example Request

curl -H 'Accept: application/vnd.twitchtv.v3+json' \
-X GET https://api.twitch.tv/kraken/videos/top?game=Gaming+Talk+Shows&period=month

Example Response

{
  "_links": {
    "next": "https://api.twitch.tv/kraken/videos/top?game=Gaming+Talk+Shows&limit=10&offset=10&period=month",
    "self": "https://api.twitch.tv/kraken/videos/top?game=Gaming+Talk+Shows&limit=10&offset=0&period=month"
  },
  "videos": [
    {
      "title": "Twitch Weekly - February 6, 2015",
      "description": "Twitch Weekly LIVE on February 6, 2015!",
      "broadcast_id": 13019796368,
      "status": "recorded",
      "tag_list": "",
      "_id": "c6055863",
      "recorded_at": "2015-02-06T21:01:09Z",
      "game": "Gaming Talk Shows",
      "length": 4015,
      "preview": "http://static-cdn.jtvnw.net/jtv.thumbs/archive-621292653-320x240.jpg",
      "url": "http://www.twitch.tv/twitch/c/6055863",
      "views": 318,
      "broadcast_type": "highlight",
      "_links": {
        "self": "https://api.twitch.tv/kraken/videos/c6055863",
        "channel": "https://api.twitch.tv/kraken/channels/twitch"
      },
      "channel": {
        "name": "twitch",
        "display_name": "Twitch"
      }
    }
    ...
  ]
}

GET /channels/:channel/videos

Returns a list of videos ordered by time of creation, starting with the most recent from :channel.

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.
broadcasts optional bool Returns only broadcasts when true. Otherwise only highlights are returned. Default is false.
hls optional bool Returns only HLS VoDs when true. Otherwise only non-HLS VoDs are returned. Default is false.

Example Request

curl -H 'Accept: application/vnd.twitchtv.v3+json' \
-X GET https://api.twitch.tv/kraken/channels/twitch/videos?limit=10

Example Response

{
  "_total": 179,
  "videos": [
    {
      "title": "Twitch Weekly - February 6, 2015",
      "description": "Twitch Weekly LIVE on February 6, 2015!",
      "broadcast_id": 13019796368,
      "status": "recorded",
      "tag_list": "",
      "_id": "c6055863",
      "recorded_at": "2015-02-06T21:01:09Z",
      "game": null,
      "length": 4015,
      "preview": "http://static-cdn.jtvnw.net/jtv.thumbs/archive-621292653-320x240.jpg",
      "url": "http://www.twitch.tv/twitch/c/6055863",
      "views": 318,
      "broadcast_type": "highlight",
      "_links": {
        "self": "https://api.twitch.tv/kraken/videos/c6055863",
        "channel": "https://api.twitch.tv/kraken/channels/twitch"
      },
      "channel": {
        "name": "twitch",
        "display_name": "Twitch"
      }
    },
    ...
  ],
  "_links": {
    "self": "https://api.twitch.tv/kraken/channels/twitch/videos?limit=10&offset=0",
    "next": "https://api.twitch.tv/kraken/channels/twitch/videos?limit=10&offset=10"
  }
}

GET /videos/followed

See the Users resource

Embedding

See here for embedding.