Skip to content

Latest commit

 

History

History
90 lines (77 loc) · 2.75 KB

games.md

File metadata and controls

90 lines (77 loc) · 2.75 KB

Games

Games are categories (e.g. League of Legends, Diablo 3) used by streams and channels. Games can be searched for by query.

Endpoint Description
GET /games/top Get games by number of viewers

GET /games/top

Returns a list of games objects sorted by number of current viewers on Twitch, 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.

Example Request

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

Example Response

{
  "_links": {
    "self": "https://api.twitch.tv/kraken/games/top?limit=10&offset=0",
    "next": "https://api.twitch.tv/kraken/games/top?limit=10&offset=10"
  },
  "_total": 322,
  "top": [
    {
      "game": {
        "name": "Counter-Strike: Global Offensive",
        "box": {
          "large": "http://static-cdn.jtvnw.net/ttv-boxart/Counter-Strike:%20Global%20Offensive-272x380.jpg",
          "medium": "http://static-cdn.jtvnw.net/ttv-boxart/Counter-Strike:%20Global%20Offensive-136x190.jpg",
          "small": "http://static-cdn.jtvnw.net/ttv-boxart/Counter-Strike:%20Global%20Offensive-52x72.jpg",
          "template": "http://static-cdn.jtvnw.net/ttv-boxart/Counter-Strike:%20Global%20Offensive-{width}x{height}.jpg"
        },
        "logo": {
          "large": "http://static-cdn.jtvnw.net/ttv-logoart/Counter-Strike:%20Global%20Offensive-240x144.jpg",
          "medium": "http://static-cdn.jtvnw.net/ttv-logoart/Counter-Strike:%20Global%20Offensive-120x72.jpg",
          "small": "http://static-cdn.jtvnw.net/ttv-logoart/Counter-Strike:%20Global%20Offensive-60x36.jpg",
          "template": "http://static-cdn.jtvnw.net/ttv-logoart/Counter-Strike:%20Global%20Offensive-{width}x{height}.jpg"
        },
        "_links": {},
        "_id": 32399,
        "giantbomb_id": 36113
      },
      "viewers": 23873,
      "channels": 305
    },
    ...
  ]
}

Errors

503 Service Unvailable if error retrieving games status.