Get Games
Gets information about specified categories or games.
You may get up to 100 categories or games by specifying their ID or name. You may specify all IDs, all names, or a combination of IDs and names. If you specify a combination of IDs and names, the total number of IDs and names must not exceed 100. You must specify at least one id, name, or igdb_id query parameter.
Endpoint
GEThttps://api.twitch.tv/helix/games
Authorization
Requires one of the following:
Query Parameters
idStringThe ID of the category or game to get. Include this parameter for each category or game you want to get. For example, '&id=1234&id=5678'. You may specify a maximum of 100 IDs. The endpoint ignores duplicate and invalid IDs or IDs that weren't found.nameStringThe name of the category or game to get. The name must exactly match the category's or game's title. Include this parameter for each category or game you want to get. For example, '&name=foo&name=bar'. You may specify a maximum of 100 names. The endpoint ignores duplicate names and names that weren't found.igdb_idStringThe IGDB ID of the game to get. Include this parameter for each game you want to get. For example, '&igdb_id=1234&igdb_id=5678'. You may specify a maximum of 100 IDs. The endpoint ignores duplicate and invalid IDs or IDs that weren't found.
Response Body
dataObject[]The list of categories and games. The list is empty if the specified categories and games weren't found.Hide child attributesShow child attributes
data.idStringAn ID that identifies the category or game.data.nameStringThe category's or game's name.data.box_art_urlStringA URL to the category's or game's box art. You must replace the '{width}x{height}' placeholder with the size of image you want.data.igdb_idStringThe ID that IGDBuses to identify this game. If the IGDB ID is not available to Twitch, this field is set to an empty string.
Response Codes
- 200OK
- Successfully retrieved the specified games.
- 400Bad Request
- The request must specify the id or name or igdb_id query parameter.
- The combined number of game IDs (id and igdb_id) and game names that you specify in the request must not exceed 100.
- 401Unauthorized
- The Authorization header is required and must specify an app access token or user access token.
- The access token is not valid.
- The ID in the Client-Id header must match the client ID in the access token.
Request Example
example language for Get Games
curl -X GET 'https://api.twitch.tv/helix/games?id=33214' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'Client-Id: YOUR_CLIENT_ID'$headers = @{
"Authorization" = "Bearer YOUR_ACCESS_TOKEN"
"Client-Id" = "YOUR_CLIENT_ID"
}
$response = Invoke-RestMethod -Uri "https://api.twitch.tv/helix/games?id=33214" `
-Method Get -Headers $headersconst response = await fetch("https://api.twitch.tv/helix/games?id=33214", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
},
});
const data = await response.json();import requests
response = requests.get(
"https://api.twitch.tv/helix/games",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
},
params={
"id": "33214",
},
)
data = response.json()req, _ := http.NewRequest("GET", "https://api.twitch.tv/helix/games?id=33214", nil)
req.Header.Set("Authorization", "Bearer YOUR_ACCESS_TOKEN")
req.Header.Set("Client-Id", "YOUR_CLIENT_ID")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)$ch = curl_init("https://api.twitch.tv/helix/games?id=33214");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer YOUR_ACCESS_TOKEN",
"Client-Id: YOUR_CLIENT_ID",
]);
$response = curl_exec($ch);
curl_close($ch);using var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://api.twitch.tv/helix/games?id=33214");
request.Headers.Add("Authorization", "Bearer YOUR_ACCESS_TOKEN");
request.Headers.Add("Client-Id", "YOUR_CLIENT_ID");
var response = await client.SendAsync(request);
var data = await response.Content.ReadAsStringAsync();let client = reqwest::Client::new();
let response = client
.get("https://api.twitch.tv/helix/games?id=33214")
.header("Authorization", "Bearer YOUR_ACCESS_TOKEN")
.header("Client-Id", "YOUR_CLIENT_ID")
.send()
.await?;
let data = response.text().await?;Response Example
{
"data": [
{
"id": "33214",
"name": "Fortnite",
"box_art_url": "https://static-cdn.jtvnw.net/ttv-boxart/33214-{width}x{height}.jpg",
"igdb_id": "1905"
}
]
}Get Top Games
Gets information about the categories and games that have the most viewers on Twitch.
Endpoint
GEThttps://api.twitch.tv/helix/games/top
Authorization
Requires one of the following:
Query Parameters
firstIntegerThe maximum number of items to return per page in the response. The minimum page size is 1 item per page and the maximum is 100 items per page. The default is 20.afterStringThe cursor used to get the next page of results. The Pagination object in the response contains the cursor's value. Read More
Response Body
dataObject[]The list of categories and games. The list is sorted by the number of viewers, with the most popular first. A page may contain fewer than first items even if more pages remain.Hide child attributesShow child attributes
data.idStringAn ID that identifies the category or game.data.nameStringThe category's or game's name.data.box_art_urlStringA URL to the category's or game's box art. You must replace the '{width}x{height}' placeholder with the size of image you want.data.igdb_idStringThe ID that IGDBuses to identify this game. If the IGDB ID is not available to Twitch, this field is set to an empty string.
paginationObjectContains the information used to page through the list of results. The object is empty if there are no more pages left to page through. Read MoreHide child attributesShow child attributes
pagination.cursorStringThe cursor used to get the next page of results. Use the cursor to set the request's after query parameter.
Response Codes
- 200OK
- Successfully retrieved the list of categories and games.
- 400Bad Request
- The value in the first query parameter is not valid.
- The cursor in the after query parameter is not valid.
- 401Unauthorized
- The Authorization header is required and must specify an app access token or user access token.
- The access token is not valid.
- The ID in the Client-Id header must match the client ID in the access token.
- 503Service Unavailable
- The list of games is temporarily unavailable.
Request Example
example language for Get Top Games
curl -X GET 'https://api.twitch.tv/helix/games/top' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'Client-Id: YOUR_CLIENT_ID'$headers = @{
"Authorization" = "Bearer YOUR_ACCESS_TOKEN"
"Client-Id" = "YOUR_CLIENT_ID"
}
$response = Invoke-RestMethod -Uri "https://api.twitch.tv/helix/games/top" `
-Method Get -Headers $headersconst response = await fetch("https://api.twitch.tv/helix/games/top", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
},
});
const data = await response.json();import requests
response = requests.get(
"https://api.twitch.tv/helix/games/top",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
},
)
data = response.json()req, _ := http.NewRequest("GET", "https://api.twitch.tv/helix/games/top", nil)
req.Header.Set("Authorization", "Bearer YOUR_ACCESS_TOKEN")
req.Header.Set("Client-Id", "YOUR_CLIENT_ID")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)$ch = curl_init("https://api.twitch.tv/helix/games/top");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer YOUR_ACCESS_TOKEN",
"Client-Id: YOUR_CLIENT_ID",
]);
$response = curl_exec($ch);
curl_close($ch);using var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://api.twitch.tv/helix/games/top");
request.Headers.Add("Authorization", "Bearer YOUR_ACCESS_TOKEN");
request.Headers.Add("Client-Id", "YOUR_CLIENT_ID");
var response = await client.SendAsync(request);
var data = await response.Content.ReadAsStringAsync();let client = reqwest::Client::new();
let response = client
.get("https://api.twitch.tv/helix/games/top")
.header("Authorization", "Bearer YOUR_ACCESS_TOKEN")
.header("Client-Id", "YOUR_CLIENT_ID")
.send()
.await?;
let data = response.text().await?;Response Example
{
"data": [
{
"id": "493057",
"name": "PUBG: BATTLEGROUNDS",
"box_art_url": "https://static-cdn.jtvnw.net/ttv-boxart/493057-{width}x{height}.jpg",
"igdb_id": "27789"
},
...
],
"pagination":{"cursor":"eyJiIjpudWxsLCJhIjp7Ik9mZnNldCI6MjB9fQ=="}
}