YouTube Autocomplete
Learn how to get YouTube search term suggestions using the Web Scraper API. Find out more about its parameters and see an example request.
With the youtube_autocomplete source, users can get related keyword suggestions for any search term of their choice. These suggestions can be used with the youtube_search source to discover more relevant videos and expand your YouTube data workflows.
Request samples
The following examples demonstrate how to retrieve search term suggestions for a given query.
curl 'https://realtime.oxylabs.io/v1/queries' \
--user 'USERNAME:PASSWORD' \
-H 'Content-Type: application/json' \
-d '{
"source": "youtube_autocomplete",
"query": "what is",
"language": "en",
"location": "US"
}'import requests
from pprint import pprint
# Structure payload.
payload = {
"source": "youtube_autocomplete",
"query": "what is",
"language": "en",
"location": "US"
}
# Get response.
response = requests.request(
"POST",
"https://realtime.oxylabs.io/v1/queries",
auth=("USERNAME", "PASSWORD"),
json=payload,
)
# Print the JSON response with the result.
pprint(response.json())Our examples use synchronous Realtime integration method. If you would like to use Proxy Endpoint, or asynchronous Push-Pull integration, refer to the Integration Methods section.
Output sample
{
"results": [
{
"content": "window.google.ac.h([\"what is\",[[\"what is love\",0,[512,433]],[\"what is this feeling wicked\",0,[512,433,131]],[\"what is love baby dont hurt me no\",0,[512,433]],[\"what is 67\",0,[512,433,131]],[\"what is\",0,[512]],[\"what is you nba youngboy\",0,[512,433,131]],[\"what is love haddaway\",0,[512,433]],[\"what is this feeling wicked karaoke\",0,[512,433]],[\"what is love twice\",0,[512,433,131]],[\"what is you\",0,[512,433,131,650]],[\"what is sounds like\",0,[512,433]],[\"what is scientology\",0,[512]],[\"what is the big beautiful bill\",0,[512]],[\"what is a woman\",0,[512,433]]],{\"j\":\"5\",\"k\":1,\"q\":\"fxuDygqjaW7TVwu4-jEjTrWp6b8\"}])",
"type": "raw",
...
}Request parameter values
source
Sets the scraper.
youtube_autocomplete
query
The search term for which keyword suggestions should be returned.
–
location
Search location (2-letter country code).
US
language
Search language code.
en
– mandatory parameter
Localization
For available location and language parameter values, consult the tables below.
Last updated
Was this helpful?

