Search Categories
Gets the games or categories that match the specified query.
A category matches if its name or one of its alternative names begins with the query string, if any word in its name begins with the query string, or if each word in the query string matches the beginning of a word in its name. For example, if the query string is love computer, the response includes any category whose name contains words that begin with love and computer. The comparison is case insensitive, and close misspellings can also match.
Endpoint
GEThttps://api.twitch.tv/helix/search/categories
Authorization
Requires one of the following:
Query Parameters
queryStringRequiredThe URI-encoded search string. For example, encode #archery as '%23archery' and search strings like angel of death as 'angel%20of%20death'.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 games or categories that match the query. The list is empty if there are no matches.Hide child attributesShow child attributes
data.box_art_urlStringA URL to an image of the game's box art or streaming category.data.nameStringThe name of the game or category.data.idStringAn ID that uniquely identifies the game or category.
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 More.Hide 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 category names that matched the specified query string.
- 400Bad Request
- The query query parameter is required.
- 401Unauthorized
- The Authorization header is required and must contain an app access token or user access token.
- The access token is not valid.
- The client ID specified in the Client-Id header does not match the client ID specified in the access token.
curl -X GET 'https://api.twitch.tv/helix/search/categories?query=fort' \
-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/search/categories?query=fort" `
-Method Get -Headers $headersconst response = await fetch("https://api.twitch.tv/helix/search/categories?query=fort", {
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/search/categories",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
},
params={
"query": "fort",
},
)
data = response.json()req, _ := http.NewRequest("GET", "https://api.twitch.tv/helix/search/categories?query=fort", 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/search/categories?query=fort");
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/search/categories?query=fort");
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/search/categories?query=fort")
.header("Authorization", "Bearer YOUR_ACCESS_TOKEN")
.header("Client-Id", "YOUR_CLIENT_ID")
.send()
.await?;
let data = response.text().await?;{
"data": [
{
"id": "33214",
"name": "Fortnite",
"box_art_url": "https://static-cdn.jtvnw.net/ttv-boxart/33214-52x72.jpg"
},
...
],
"pagination": {
"cursor": "eyJiIjpudWxsLCJhIjp7IkN"
}
}Search Channels
Gets the channels that match the specified query.
The fields that the API uses for comparison depends on the value that the live_only query parameter is set to. If live_only is false, the API matches on the broadcaster's login name and display name. However, if live_only is true, the API matches on the broadcaster's login name, display name, and the name of the category they're streaming.
If live_only is false, the broadcaster's login name or display name must begin with the query string. If live_only is true, the query string can also match the beginning of any word in those names or in the category name, and a phrase matches if each of its words does. The comparison is case insensitive, and close misspellings can also match. For example, the query string angel of death can match names that begin with angelofdeath or angel_of_death.
By default, the results include both live and offline channels. To get only live channels set the live_only query parameter to true.
Endpoint
GEThttps://api.twitch.tv/helix/search/channels
Authorization
Requires one of the following:
Query Parameters
queryStringRequiredThe URI-encoded search string. For example, encode search strings like angel of death as 'angel%20of%20death'.live_onlyBooleanA Boolean value that determines whether the response includes only channels that are currently streaming live. Set to true to get only channels that are streaming live; otherwise, false to get live and offline channels. The default is false.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 channels that match the query. The list is empty if there are no matches.Hide child attributesShow child attributes
data.broadcaster_languageStringThe ISO 639-1 two-letter language code of the language used by the broadcaster. For example, en for English. If the broadcaster uses a language not in the list of supported stream languages, the value is other.data.broadcaster_loginStringThe broadcaster's login name.data.display_nameStringThe broadcaster's display name.data.game_idStringThe ID of the game that the broadcaster is playing or last played.data.game_nameStringThe name of the game that the broadcaster is playing or last played.data.idStringAn ID that uniquely identifies the channel (this is the broadcaster's ID).data.is_liveBooleanA Boolean value that determines whether the broadcaster is streaming live. Is true if the broadcaster is streaming live; otherwise, false.data.tag_idsString[]IMPORTANT As of February 28, 2023, this field is deprecated and returns only an empty array. If you use this field, please update your code to use the 'tags' field.
The list of tags that apply to the stream. The list contains IDs only when the channel is steaming live. For a list of possible tags, see List of All Tags. The list doesn't include Category Tags.
data.tagsString[]The tags applied to the channel.data.thumbnail_urlStringA URL to a thumbnail of the broadcaster's profile image.data.titleStringThe stream's title. Is an empty string if the broadcaster didn't set it.data.started_atStringThe UTC date and time (in RFC3339 format) of when the broadcaster started streaming. The string is empty if the broadcaster is not streaming live.
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 More.Hide 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 channels that matched the specified query string.
- 400Bad Request
- The query query parameter is required.
- 401Unauthorized
- The Authorization header is required and must contain an app access token or user access token.
- The access token is not valid.
- The client ID specified in the Client-Id header does not match the client ID specified in the access token.
- 503Service Unavailable
- The API couldn't get the details of the matching channels. Try the request again.
curl -X GET 'https://api.twitch.tv/helix/search/channels?query=twitchdev' \
-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/search/channels?query=twitchdev" `
-Method Get -Headers $headersconst response = await fetch("https://api.twitch.tv/helix/search/channels?query=twitchdev", {
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/search/channels",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
},
params={
"query": "twitchdev",
},
)
data = response.json()req, _ := http.NewRequest("GET", "https://api.twitch.tv/helix/search/channels?query=twitchdev", 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/search/channels?query=twitchdev");
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/search/channels?query=twitchdev");
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/search/channels?query=twitchdev")
.header("Authorization", "Bearer YOUR_ACCESS_TOKEN")
.header("Client-Id", "YOUR_CLIENT_ID")
.send()
.await?;
let data = response.text().await?;{
"data": [
{
"broadcaster_language": "en",
"broadcaster_login": "twitchdev",
"display_name": "TwitchDev",
"game_id": "1469308723",
"game_name": "Software and Game Development",
"id": "141981764",
"is_live": false,
"tag_ids": [],
"tags": [
"WebDevelopment",
"GameDevelopment",
"SoftwareDevelopment",
"English"
],
"thumbnail_url": "https://static-cdn.jtvnw.net/jtv_user_pictures/8a6381c7-d0c0-4576-b179-38bd5ce1d6af-profile_image-300x300.png",
"title": "Standard Output",
"started_at": ""
},
...
],
"pagination": {
"cursor": "Mg=="
}
}