API Documentation

Google Autocomplete API

Get normalized Google search suggestions by query, Google domain, and language.

Test API

Endpoint

GET https://api.goanyapi.com/api/v1/google-autocomplete

With the current configuration, each successful request costs 3 credits.

Authentication

Authorization: Bearer YOUR_API_KEY

Request Parameters

ParameterTypeRequiredDescription
qstringYesPartial or complete search query, up to 200 characters
domainstringNowww.google.com or www.google.com.hk; defaults to www.google.com
hlstringNoResponse 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_KEY

Response 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

FieldDescription
data.endpointStable endpoint identifier: google-autocomplete
data.costCreditsCredits charged for this request; 0 when the result is empty
data.remainingCreditsCredits remaining after the request
data.query.qNormalized query
data.query.domainGoogle domain used by the request
data.query.hlLanguage used by the request
data.suggestionsDeduplicated array of non-empty suggestion strings

Validation

  • q is required and must contain no more than 200 characters
  • domain accepts only www.google.com and www.google.com.hk
  • hl must 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