Get suggestions
getSuggestions(query, options?): SuggestionsResponse
GET
https://api.ytapi.dev/v1/search/suggestions
Free
Returns autocomplete strings for a partial query. Use this for search-as-you-type UIs. This endpoint is free.
Security
API Key
All requests require a valid API key from the developer dashboard.
Headers: Authorization: Bearer YOUR_API_KEYorX-API-Key: YOUR_API_KEY
See Authentication for headers and rate limits.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
qquery | string | Yes | Partial query string. |
hlquery | string | No | Interface language for the suggestions, for example |
glquery | string | No | Country whose searches the suggestions reflect, as a two-letter code, for example |
Response (HTTP 200)
{
"query": string, // Echoed input query string
"suggestions": string[] // Ranked autocomplete suggestions
}Completely free
Search suggestions consume 0 credits.