Google Autocomplete is a search engine functionality based on users' periodic search trends. When combined with search data lookups, autocomplete recommendations become an incredibly powerful tool for any SEO strategy as they provide insights about users search habits.
1 token/credit per autocomplete row returned
- Google typically returns 10
rows for every request made.
Minimum cost per execution is capped at 1 token/credit per request
.
> POST https://api.jsonrepo.com/v1/seo/autocomplete
Field | Description |
---|---|
X-API-Key | Required Your API Key |
Field | Type | Description |
---|---|---|
input | String | Required Min Length: 3 |
language | String | Optional Accepts: en-us , en-gb , en-au , fr-fr , fr-ca , de-de , zh-cn , ja-jp or es-es .default: us-en |
Input precision:
The starting spaces are always trimmed from the input. Trailing spaces are however important and change the outcome significantly.
Example: If you provide the word
water
as input, autocomplete may return values such aswaterfall
. Ifwater
is provided however (with a trailing space), Google will return the most applicable recommendations based on that exact starting string match such aswater wheel
.
Request Repetition:
Google autocomplete is based on search trends. It is therefore not recommended to issue multiple requests using the same
input
as the response values won't change in between requests. It takes a long time for Google to change its autocomplete recommendations.When querying the autocomplete API, try varying your input slightly for every request in order to have a higher chance of non-repeat outcomes.
// Get Google autocomplete results for the word `pizza`
// language set to en-gb
curl -X POST https://api.jsonrepo.com/v1/seo/autocomplete \
-H "X-API-Key: {YOUR_API_KEY_HERE}" \
--data-urlencode "input=pizza" \
--data-urlencode "language=en-gb"
// Server response
{
"http_code": 200,
"http_message": "Ok",
"timestamp": 1733188567,
"message": "Successful execution.",
"payload": {
"autocomplete": {
"input": {
"input": "pizza ",
"language": "en-gb"
},
"output": [
{
"id": 3384,
"keyword": "pizza hut",
"volume": 20400000,
"competition": 16,
"cpc": "$ 0.22",
"trend": [
{
"year": 2023,
"month": "December",
"value": 16600000
},
// 12 months data
...
{
"year": 2024,
"month": "November",
"value": 20400000
}
],
"last_updated": "02 December 2024",
"region": "global",
"length": 9,
"difficulty_score": 4,
"volume_score": 5,
"ad_score": 5,
"origin": "cache"
},
// 10 total objects
...
{
"id": 3405,
"keyword": "pizza pilgrims",
"volume": 90500,
"competition": 6,
"cpc": "$ 0.01",
"trend": [...],
"last_updated": "03 December 2024",
"region": "global",
"length": 14,
"difficulty_score": 3,
"volume_score": 5,
"ad_score": 5,
"origin": "remote"
}
]
}
}
}
A failed request will result in an error output as detailed in Error Rules. If the endpoint validation fails due to missing, badly formatted or invalid parameters, the endpoint will return HTTP code 400
along with a message
detailing the error.
// Request without `input` parameter
{
"http_code": 400,
"http_message": "Bad Request",
"timestamp": 1733188685,
"message": "'input' parameter must be provided with at least 3 characters.",
"payload": []
}