YepAPI
SERP

Google Autocomplete

Real-time Google Autocomplete suggestions — search predictions and query completions.

POST/v1/serp/google-autocomplete
$0.01/call

Usage

const res = await fetch('https://api.yepapi.com/v1/serp/google-autocomplete', {
  method: 'POST',
  headers: {
    'x-api-key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ query: 'how to build a', depth: 10 }),
});
const { data } = await res.json();
console.log(data);
curl -X POST https://api.yepapi.com/v1/serp/google-autocomplete \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query": "how to build a", "depth": 10}'

Request Body

ParameterTypeRequiredDescriptionDefault
querystringYesPartial search query to get autocomplete suggestions for
depthnumberNoNumber of suggestions to return10
location_codenumberNoTarget country code (e.g., 2840 for US). See Location Codes.2840
languagestringNoISO language code (e.g., en, es)"en"

Response

{
  "ok": true,
  "data": {
    "query": "how to build a",
    "totalResults": 0,
    "results": [
      {
        "position": 1,
        "type": "autocomplete",
        "title": "",
        "url": "",
        "description": "",
        "domain": ""
      },
      {
        "position": 2,
        "type": "autocomplete",
        "title": "",
        "url": "",
        "description": "",
        "domain": ""
      },
      {
        "position": 3,
        "type": "autocomplete",
        "title": "",
        "url": "",
        "description": "",
        "domain": ""
      }
    ]
  }
}

Response Fields

FieldTypeDescription
okbooleanWhether the request succeeded
data.querystringThe partial query that was sent for autocomplete
data.totalResultsnumberTotal number of suggestions returned (typically 0 as autocomplete does not report totals)
data.resultsobject[]Array of autocomplete suggestion items
data.results[].positionnumberPosition of the suggestion (1-indexed)
data.results[].typestringResult type (typically autocomplete)
data.results[].titlestringThe suggested search query completion
data.results[].urlstringURL for the suggestion (typically empty)
data.results[].descriptionstringAdditional context for the suggestion (typically empty)
data.results[].domainstringAssociated domain (typically empty for autocomplete)
Under the Hood

Under the hood, this queries our SERP engine. We normalize the response format and flatten nested structures for consistency.

On this page