YouTube Search Suggestions API
YouTube Search Suggestions. HTTPS resource URLs are preferred where supported. Empty results and failures are free.
YouTube Search Suggestions. HTTPS resource URLs are preferred where supported. Empty results and failures are free.
Open product page and API TesterEndpoint and authentication
POST https://api.goanyapi.com/api/v1/youtube/search/suggestionsSynchronous response, without tasks or polling. Use an API Key or supported OAuth Bearer credential. No Path or Query parameters.
Input parameters
| Parameter | Location | Type | Required | Default | Constraints and meaning |
|---|---|---|---|---|---|
| Authorization | Header | string | Yes | — | Bearer YOUR_API_KEY |
| Content-Type | Header | string | Yes | application/json | application/json |
| query | JSON body | string | Yes | — | Search keywords. minLength: 1 |
| language | JSON body | string | No | en | Result language; defaults to en. pattern: ^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$ |
| country | JSON body | string | No | US | Two-letter uppercase country code; defaults to US. pattern: ^[A-Z]{2}$ |
Output fields
| Field | Type | Meaning |
|---|---|---|
| code | string | ok on success; public error code on failure |
| message | string | Status message |
| data.result | object / null | Public result; null, empty and absent values are preserved |
| data.creditsUsed | integer | Actual configured charge; zero for empty results |
| data.remainingCredits | number | Balance after settlement |
| data.result.query | string | Actual business field; may be empty or absent; formatted counts are not exact integers |
| data.result.suggestions | array | Actual business field; may be empty or absent; formatted counts are not exact integers |
This endpoint does not accept a cursor or support pagination. List length is the number returned by this request, not a total.
Request example
curl -X POST 'https://api.goanyapi.com/api/v1/youtube/search/suggestions' -H 'Authorization: Bearer YOUR_API_KEY' -H 'Content-Type: application/json' --data '{"query":"NVIDIA"}'Real response example
Captured from a real request. Only live data.creditsUsed and data.remainingCredits are omitted. Media and caption URLs may have expired.
{
"code": "ok",
"message": "ok",
"data": {
"result": {
"query": "NVIDIA",
"suggestions": [
"nvidia",
"nvidia earnings",
"nvidia earnings call",
"nvidia stock",
"nvidia earnings live",
"nvidia earnings call live",
"nvidia news",
"nvidia live",
"nvidia earnings report",
"nvidia conference call"
]
}
}
}Billing and status codes
…
Each endpoint uses its own database-configured price. Only nonempty successful results are charged; empty results and failures are free. Pages are billed separately. Missing optional titles or descriptions do not invalidate a record. Media results are empty when both video and captions are empty.
| HTTP | Meaning |
|---|---|
| 200 | Query completed; may be empty |
| 400 | Invalid JSON or parameters |
| 401 | Authentication failed |
| 402 | Insufficient credits |
| 429 | Rate limited; honor Retry-After |
| 502 | Data request failed |
| 503 | API or pricing not configured |