100 free credits. No credit card required. Get a key

YouTube autocomplete API

What YouTube’s search box suggests for a partial query, localised by region and language.

GET /v1/youtube/search/suggestionsBeta1 credit per callRefunded on failure
import os, requests

res = requests.get(
    "https://api.groundsocial.dev/v1/youtube/search/suggestions?q=how%20to%20make",
    headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"},
)
res.raise_for_status()
data = res.json()
Response
200 · 1 credit
{
"kind": "youtube#suggestions",
"query": "how to make",
"suggestions": [
"how to make a paper airplane",
"how to make slime",
"… 12 more"
]
}

Parameters

NameTypeDescription
qquery · requiredstringThe partial query. Example: how to make.
regionquerystringISO 3166-1 alpha-2 country: the results a visitor there sees. Example: US.
languagequerystringISO 639-1 language code (en, es, pt-BR). Example: en.
Response fields

200 with a YouTubeSuggestions, in the shape of YouTube Data API v3 resources.

FieldTypeDescription
kind"youtube#suggestions"
querystring
suggestionsstring[]
Status codes
StatusMeaning
200The suggestions.
400Invalid input. Nothing was charged.
401Missing or invalid API key.
402Not enough credits, a spend cap was reached, or payment is required.
403The target is private, or the account is suspended.
404The video, channel, playlist or post does not exist, was removed, or has nothing there.
429Too many requests. Wait for Retry-After seconds.
503YouTube is temporarily unavailable. Retryable; nothing was charged.

Every error has code, message, hint and retryable. All error codes

Questions

How many?

About 14 per query.

YouTube is a trademark of Google LLC. We are not affiliated with or endorsed by Google or YouTube.