YouTube Autocomplete API
Get localized YouTube search suggestions for a query.
Endpoint
GET https://api.goanyapi.com/api/v1/youtube-autocompleteWith the current configuration, each successful request costs 3 credits.
Request parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
q | string | Yes | — | Non-blank query, up to 200 characters |
hl | string | No | en | Suggestion language, for example en or zh-CN |
gl | string | No | US | Two-letter country code, for example US or CN |
GET /api/v1/youtube-autocomplete?q=ai&hl=zh-CN&gl=US
Authorization: Bearer YOUR_API_KEYResponse
{
"code": "ok",
"message": "ok",
"data": {
"endpoint": "youtube-autocomplete",
"remainingCredits": 996,
"query": { "q": "ai", "hl": "zh-cn", "gl": "US" },
"suggestions": ["ai engineer", "ai shorts", "ai video"]
}
}data.costCredits is the credits consumed by this request. Empty results and failed or invalid requests cost 0 credits. Suggestions remain in returned order.