SerpBase

API reference · Search engines

Google Search Autocomplete

Retrieve Google search suggestions for a query prefix. Suggestions are not search-volume measurements.

POSThttps://api.serpbase.dev/google/autocomplete
1 creditOpen in Playground

Example

BASH
curl -X POST 'https://api.serpbase.dev/google/autocomplete' \
  -H "Content-Type: application/json" \
  -H 'X-API-Key: YOUR_API_KEY' \
  --max-time 60 \
  -d '{"query":"weather"}'
Response · real, shortened
{
  "status": 0,
  "credits_charged": 1,
  "request_id": "r-4b27fe8a36d9ac303a5da7dd",
  "product_id": "google_autocomplete",
  "query": "weather",
  "search_type": "autocomplete",
  "suggestions": [
    {
      "rank": 1,
      "relevance": 601,
      "value": "weather tomorrow"
    },
    {
      "rank": 2,
      "relevance": 600,
      "value": "weather rock hill sc"
    }
  ]
}

Parameters

format
"json" | "markdown"
json (default) returns the parsed result.
More

markdown returns the same result as Markdown text (text/markdown) for language models: no envelope, no duplicate alias fields, no inline images. Same credits; failures keep the JSON envelope.

query
string
Example: "weather"

The sample shows example parameters, not the complete request contract. Known fields are validated by the API; additional parameters are allowed.

What comes back

The fields are those in the response above; every endpoint also carries status, credits_charged and request_id.

If it fails

A failed request has a non-zero status and an error, and is not charged. The ones you will see here:

1000A parameter is missing or wrongFix the request
1020No credits leftTop up
1029Over your requests per secondWait Retry-After seconds
1502 · 1504The source could not be read this timeRetry
All status codes →