YouTube Autocomplete API Documentation
The YouTube Autocomplete API returns the suggestions YouTube shows in its search box as you type a query. Pass a suggestion's value as the q of the YouTube Search API, or a channel suggestion's channel.id as the channel_id of the YouTube Channel API.
API Parameters
Search Query
-
- Name
-
q - Required
- Required
- Description
-
This parameter is used for the terms you want YouTube search suggestions for. Queries can be partial, like "mr bea" or "how to". Up to 100 characters. Emoji and some symbols count as more than one.
Localization
-
- Name
-
gl - Required
- Optional
- Description
-
The default parameter
usdefines the country of the search. Check the full list of supported YouTubeglcountries.
-
- Name
-
hl - Required
- Optional
- Description
-
The default parameter
endefines the interface language of the search. Check the full list of supported YouTubehllanguages.
Engine
-
- Name
-
engine - Required
- Required
- Description
-
Parameter defines the engine that will be used to retrieve real-time data. To retrieve YouTube search suggestions, it must be set to
youtube_autocomplete.
API key
-
- Name
-
api_key - Required
- Required
- Description
-
The
api_keyauthenticates your requests. Use it as a query parameter (https://www.searchapi.io/api/v1/search?api_key=YOUR_API_KEY) or in the Authorization header (Bearer YOUR_API_KEY).
Zero Data Retention
-
- Name
-
zero_retention - Enterprise Only
- Enterprise Only
- Required
- Optional
- Description
-
Set this parameter to
trueto disable all logging and persistent storage. No request parameters, HTML, or JSON responses are stored or logged. Suitable for high-compliance use cases. Debugging and support may be limited while enabled.
API Examples
Full Response
Each suggestion has a value and a type. A query YouTube has no suggestions for returns an error.
https://www.searchapi.io/api/v1/search?engine=youtube_autocomplete&q=mr+beast
- Python
- Node
- Ruby
- Java
- Go
- PHP
- Bash
- R
- Kotlin
- Swift
- C#
- C
- C++
- requests
import requests
url = "https://www.searchapi.io/api/v1/search"
params = {
"engine": "youtube_autocomplete",
"q": "mr beast"
}
response = requests.get(url, params=params)
print(response.text)
{
"search_metadata": {
"id": "search_PrEjiAiNrfqVeVt2kbJrjA7r",
"status": "Success",
"created_at": "2026-10-02T16:12:49Z",
"request_time_taken": 1.0,
"parsing_time_taken": 0.02,
"total_time_taken": 1.02,
"request_url": null,
"html_url": "https://www.searchapi.io/api/v1/searches/search_PrEjiAiNrfqVeVt2kbJrjA7r.html",
"json_url": "https://www.searchapi.io/api/v1/searches/search_PrEjiAiNrfqVeVt2kbJrjA7r"
},
"search_parameters": {
"engine": "youtube_autocomplete",
"q": "mr beast",
"gl": "US",
"hl": "en"
},
"suggestions": [
{
"value": "mrbeast",
"type": "channel",
"channel": {
"id": "UCX6OQ3DkcsbYNE6H8uQQuVA",
"title": "MrBeast",
"handle": "@MrBeast",
"link": "https://www.youtube.com/channel/UCX6OQ3DkcsbYNE6H8uQQuVA",
"thumbnail": "https://yt3.googleusercontent.com/nxYrc_1_2f77DoBadyxMTmv7ZpRZapHR5jbuYe7PlPd5cIRJxtNNEYyOC0ZsxaDyJJ..."
},
"kgmid": "/g/11ffmnm29k"
},
{
"value": "mr beast give me some money",
"type": "query"
},
"..."
]
}
Query, Channel and Entity Suggestions
The type of a suggestion tells what YouTube is suggesting:
queryA search term, likemarques brownlee meta glasses.channelA YouTube channel, like Marques Brownlee. It adds achannelobject with the channel'sidandlink, and can include itstitle,handleandthumbnail.entityA topic such as a person, band or show, like Marques Houston. It can include atitle,subtitle,thumbnailandthumbnail_source, the page the thumbnail is taken from.
https://www.searchapi.io/api/v1/search?engine=youtube_autocomplete&q=marques
- Python
- Node
- Ruby
- Java
- Go
- PHP
- Bash
- R
- Kotlin
- Swift
- C#
- C
- C++
- requests
import requests
url = "https://www.searchapi.io/api/v1/search"
params = {
"engine": "youtube_autocomplete",
"q": "marques"
}
response = requests.get(url, params=params)
print(response.text)
{
"search_metadata": {
"id": "search_0KRPSbUhvz9adGh4ucN2sVjW",
"status": "Success",
"created_at": "2026-10-05T14:53:56Z",
"request_time_taken": 0.82,
"parsing_time_taken": 0.0,
"total_time_taken": 0.82,
"request_url": null,
"html_url": "https://www.searchapi.io/api/v1/searches/search_0KRPSbUhvz9adGh4ucN2sVjW.html",
"json_url": "https://www.searchapi.io/api/v1/searches/search_0KRPSbUhvz9adGh4ucN2sVjW"
},
"search_parameters": {
"engine": "youtube_autocomplete",
"q": "marques",
"gl": "US",
"hl": "en"
},
"suggestions": [
{
"value": "marques brownlee",
"type": "channel",
"channel": {
"id": "UCBJycsmduvYEL83R_U4JriQ",
"title": "Marques Brownlee",
"handle": "@mkbhd",
"link": "https://www.youtube.com/channel/UCBJycsmduvYEL83R_U4JriQ",
"thumbnail": "https://yt3.googleusercontent.com/qu4TmIaYUlS41-dJ9gZ7DUR3nilvmB5_11i6OKSdvNnBNiyOusZP1bMN6ICnuxtjFB..."
},
"kgmid": "/m/0zbt_gq"
},
{
"value": "marques houston",
"type": "entity",
"title": "Marques Houston",
"subtitle": "American singer and songwriter",
"thumbnail": "https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcQDOzbkCBblIVRYHOpfIRzCwIkkKCaNSYpL1Ppp_pEJ_l2i...",
"thumbnail_source": "https://www.imdb.com/name/nm0396867/",
"kgmid": "/m/01pl79y"
},
{
"value": "marques brownlee meta glasses",
"type": "query"
},
"..."
]
}
Localization
Use gl and hl to get the suggestions YouTube shows in another country and language.
https://www.searchapi.io/api/v1/search?engine=youtube_autocomplete&gl=GB&hl=en-gb&q=news
- Python
- Node
- Ruby
- Java
- Go
- PHP
- Bash
- R
- Kotlin
- Swift
- C#
- C
- C++
- requests
import requests
url = "https://www.searchapi.io/api/v1/search"
params = {
"engine": "youtube_autocomplete",
"q": "news",
"gl": "GB",
"hl": "en-gb"
}
response = requests.get(url, params=params)
print(response.text)
{
"search_metadata": {
"id": "search_AxARiRkgz3HDWqjijF17JYF4",
"status": "Success",
"created_at": "2026-10-02T16:12:50Z",
"request_time_taken": 1.61,
"parsing_time_taken": 0.0,
"total_time_taken": 1.61,
"request_url": null,
"html_url": "https://www.searchapi.io/api/v1/searches/search_AxARiRkgz3HDWqjijF17JYF4.html",
"json_url": "https://www.searchapi.io/api/v1/searches/search_AxARiRkgz3HDWqjijF17JYF4"
},
"search_parameters": {
"engine": "youtube_autocomplete",
"q": "news",
"gl": "GB",
"hl": "en-gb"
},
"suggestions": [
{
"value": "news",
"type": "query"
},
{
"value": "news today",
"type": "query"
},
"...",
{
"value": "newsround",
"type": "channel",
"channel": {
"id": "UCKlqMc-09XZknXO8jsK-15A",
"title": "Newsround",
"handle": "@BBCNewsroundOfficial",
"link": "https://www.youtube.com/channel/UCKlqMc-09XZknXO8jsK-15A",
"thumbnail": "https://yt3.googleusercontent.com/nX7aNahzyheqv5Y24JsIlaYxZK-FhuYnhwEdT8MQa_6eAjRwIsM-J4nu3O-zVc3dJh..."
},
"kgmid": "/m/0315wk"
},
"...",
{
"value": "the news agents",
"type": "entity",
"title": "The News Agents",
"subtitle": "Daily News podcast",
"thumbnail": "https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcTBojHY9gV2CWAhL_AZ2vJTOfdW7Hpypj7g8acr-LCHEGYy...",
"thumbnail_source": "https://en.wikipedia.org/wiki/The_News_Agents",
"kgmid": "/g/11t9_vqyk2"
},
"..."
]
}