Skip to content

New Official SDKs for TypeScript, Python and Go

SerpKite
Get API key
Docs menu / Google Autocomplete

Google Autocomplete

Query suggestions as the user types. Useful for keyword research and query expansion.

POST https://api.serpkite.com/v1/autocomplete Credits: 0.5 Try in playground
View as Markdown

Google's query suggestions for a prefix. Half a credit per call, which makes it cheap for keyword research and query expansion before a search.

Request body

Send a JSON object with Content-Type: application/json. The same parameters also work as a query string on GET /v1/autocomplete. JSON arrays are rejected: to run many queries at once, use POST /v1/batches at half price. Unknown parameters return 400 invalid_request with a message that names the replacement; see strict validation.

ParameterTypeDefaultDescription
q requiredstringThe search query. Required. Up to 2,048 characters.
countrystringusCountry to search from, as a two-letter ISO code (us, gb, de, in…).
languagestringenInterface language, as a language code (en, de, fr, pt-BR…).
formatstringjsonResponse format. markdown is LLM-ready prose; compact is JSON with only the fields agents need. One of: json, compact, markdown.

Example request

Authenticate with Authorization: Bearer $SERPKITE_API_KEY (GET requests may pass ?api_key= instead). The official SDKs read SERPKITE_API_KEY for you. See Authentication.

curl https://api.serpkite.com/v1/autocomplete \
  -H "Authorization: Bearer $SERPKITE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"q":"how to learn","country":"us"}'

Response fields

FieldTypeDescription
requestobjectThe normalised request, with defaults filled in: endpoint, engine, q, country, language, location, num, page, device, autocorrect…
results[]arrayvalue: the suggested query.
metaobjectrequest_id, credits_used, cached, cached_at, engine (the provider that answered), route (provider attempts, see Search providers), latency_ms, parse_quality (ok, partial, empty), resolved_urls.

Every billed response also carries credit and latency headers (X-Credits-Used, X-Credits-Remaining, X-Request-Id…).

Example response

200 OK · illustrative
{
  "request": {
    "endpoint": "autocomplete",
    "engine": "google",
    "q": "how to learn",
    "country": "us",
    "language": "en"
  },
  "results": [
    {
      "value": "how to learn python"
    },
    {
      "value": "how to learn spanish"
    },
    {
      "value": "how to learn guitar"
    },
    {
      "value": "how to learn to code"
    }
  ],
  "meta": {
    "request_id": "req_01J8ZK4M6Q2V7",
    "credits_used": 0.5,
    "cached": false,
    "engine": "google",
    "latency_ms": 1034,
    "parse_quality": "ok",
    "resolved_urls": true
  }
}

Errors

Errors use one shape: {"error":{"code","message","request_id"}}. Errors are never billed. Full list in Errors.

StatusCodeMeaning
400invalid_requestA parameter is missing or invalid.
401unauthorizedThe API key is missing, invalid or revoked.
402insufficient_creditsYour balance is too low. Buy a pack or wait for the monthly free grant.
429rate_limitedToo many requests per second for your plan. Retry after the Retry-After header.
503upstream_errorGoogle could not be fetched or parsed. Not billed; retry after Retry-After.

Notes

  • format: "markdown" is not available for this endpoint; the JSON is already small.