Google Autocomplete API
Get normalized Google search suggestions by query, Google domain, and language.
Endpoint
GET https://api.goanyapi.com/api/v1/google-autocompleteWith the current configuration, each successful request costs 3 credits.
Authentication
Authorization: Bearer YOUR_API_KEYRequest Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
q | string | Yes | Partial or complete search query, up to 200 characters |
domain | string | No | www.google.com or www.google.com.hk; defaults to www.google.com |
hl | string | No | Response language code, such as en, zh, or ja; defaults to en |
This endpoint does not accept a gl parameter. Use domain to choose between the two supported Google domains and hl to select the response language.
Example
GET /api/v1/google-autocomplete?q=ai%20image&domain=www.google.com&hl=en
Authorization: Bearer YOUR_API_KEYResponse Example
{
"code": "ok",
"message": "ok",
"data": {
"endpoint": "google-autocomplete",
"remainingCredits": 99,
"query": {
"q": "ai image",
"domain": "www.google.com",
"hl": "en"
},
"suggestions": [
"ai image generator",
"ai image generator free",
"ai image detector",
"ai image editor",
"ai image to video"
]
}
}Response Fields
| Field | Description |
|---|---|
data.endpoint | Stable endpoint identifier: google-autocomplete |
data.costCredits | Credits charged for this request; 0 when the result is empty |
data.remainingCredits | Credits remaining after the request |
data.query.q | Normalized query |
data.query.domain | Google domain used by the request |
data.query.hl | Language used by the request |
data.suggestions | Deduplicated array of non-empty suggestion strings |
Validation
qis required and must contain no more than 200 charactersdomainaccepts onlywww.google.comandwww.google.com.hkhlmust be a valid language code- Unknown domain values return
400 invalid_params
Billing
The current request cost follows the API configuration shown on this page.
- Empty suggestion results cost
0 credits - Failed requests do not consume credits