Skip to main content
POST
/
google-autocomplete
Google Autocomplete
curl --request POST \
  --url https://api.growthmarketing.ai/google-autocomplete \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "keyword": "albert einstein",
  "language_code": "en",
  "location_code": 2840,
  "client": "gws-wiz-serp",
  "device": "desktop",
  "os": "windows"
}
'
import requests

url = "https://api.growthmarketing.ai/google-autocomplete"

payload = {
"keyword": "albert einstein",
"language_code": "en",
"location_code": 2840,
"client": "gws-wiz-serp",
"device": "desktop",
"os": "windows"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
keyword: 'albert einstein',
language_code: 'en',
location_code: 2840,
client: 'gws-wiz-serp',
device: 'desktop',
os: 'windows'
})
};

fetch('https://api.growthmarketing.ai/google-autocomplete', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.growthmarketing.ai/google-autocomplete",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'keyword' => 'albert einstein',
'language_code' => 'en',
'location_code' => 2840,
'client' => 'gws-wiz-serp',
'device' => 'desktop',
'os' => 'windows'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.growthmarketing.ai/google-autocomplete"

payload := strings.NewReader("{\n \"keyword\": \"albert einstein\",\n \"language_code\": \"en\",\n \"location_code\": 2840,\n \"client\": \"gws-wiz-serp\",\n \"device\": \"desktop\",\n \"os\": \"windows\"\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.growthmarketing.ai/google-autocomplete")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"keyword\": \"albert einstein\",\n \"language_code\": \"en\",\n \"location_code\": 2840,\n \"client\": \"gws-wiz-serp\",\n \"device\": \"desktop\",\n \"os\": \"windows\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.growthmarketing.ai/google-autocomplete")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"keyword\": \"albert einstein\",\n \"language_code\": \"en\",\n \"location_code\": 2840,\n \"client\": \"gws-wiz-serp\",\n \"device\": \"desktop\",\n \"os\": \"windows\"\n}"

response = http.request(request)
puts response.read_body
{
  "success": true,
  "data": {
    "data": {
      "api": "serp",
      "function": "live",
      "se": "google",
      "se_type": "autocomplete",
      "keyword": "albert einstein",
      "language_code": "en",
      "location_code": 2840,
      "client": "gws-wiz-serp",
      "device": "desktop",
      "os": "windows"
    },
    "result": [
      {
        "keyword": "albert einstein",
        "type": "autocomplete",
        "se_domain": "google.com",
        "location_code": 2840,
        "language_code": "en",
        "check_url": "https://google.com/search?q=albert+einstein&hl=en&gl=US",
        "items": [
          {
            "type": "autocomplete",
            "rank_group": 1,
            "rank_absolute": 1,
            "suggestion": "albert einstein",
            "search_query_url": "https://www.google.com/search?q=albert+einstein",
            "thumbnail_url": "http://t0.gstatic.com/images?q=...",
            "highlighted": [
              "<string>"
            ]
          }
        ]
      }
    ]
  }
}

Authorizations

X-API-Key
string
header
required

Body

application/json
keyword
string
required

Search term

Example:

"albert einstein"

language_code
string
default:en

Language code

Example:

"en"

location_code
integer
default:2840

Location code (2840 for US)

Example:

2840

client
string
default:gws-wiz-serp

Client type

Example:

"gws-wiz-serp"

device
enum<string>
default:desktop

Device type

Available options:
desktop,
mobile
Example:

"desktop"

os
enum<string>
default:windows

Operating system

Available options:
windows,
macos,
android,
ios
Example:

"windows"

Response

200 - application/json

Successful response

success
boolean
Example:

true

data
object