# Google Autocomplete API

Retrieve real-time Google search suggestions (autocomplete results) using the Google Auto Complete API. This endpoint returns keyword suggestions exactly like those shown in the Google search bar while typing a query.<br>

**Pricing**

* We charge 5 credits per Google Autocomplete API request.<br>

{% hint style="danger" %}
Requires authentication
{% endhint %}

<mark style="color:green;">`POST`</mark> `https://api.serphouse.com/google-autocomplete-api`

#### Headers

| Name                                            | Type   | Description              |
| ----------------------------------------------- | ------ | ------------------------ |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer \<YOUR\_API\_KEY> |
| Content-Type<mark style="color:red;">\*</mark>  | String | application/json         |

#### Request Body

<table><thead><tr><th width="115">Name</th><th width="85">Type</th><th>Description</th></tr></thead><tbody><tr><td>q<mark style="color:red;">*</mark></td><td>string</td><td>Search phrase that you want to search</td></tr><tr><td>lang<mark style="color:red;">*</mark></td><td>string</td><td>You can set language for e.g. <code>en</code> for english <code>fr</code> for french.<br>Get the list of available languages by making a separate request to the <a href="../extra-apis/languages-list">List of Language</a></td></tr><tr><td>loc<mark style="color:red;">*</mark></td><td>string</td><td>Specifies the location to retrieve localized autocomplete suggestions.<br>You can receive the list of available locations of search engines with their loc_id by making a separate request to the  <a href="../extra-apis/locations-list">List of Locations</a></td></tr><tr><td>client</td><td>string</td><td><p>Defines the client environment used to fetch Google autocomplete suggestions from different browsers or services.<br></p><ul><li><code>chrome</code> (default) - used for Chrome browser searches.</li><li><code>chrome-omni</code> - used for Chrome address bar.</li><li><code>home_page</code> - used for Chrome Google homepage.</li><li><code>safari</code> - used when Google is opened in Safari browser</li><li><code>firefox</code> - used for Firefox browser searches.</li><li><code>youtube</code> - origin unknown.</li></ul></td></tr></tbody></table>

{% tabs %}
{% tab title="200: OK" %}

```json
{
    "status": "error",
    "msg": "Please try again",
    "error": ""
}
```

{% endtab %}

{% tab title="200: OK" %}

```json
{
    "status": "success",
    "msg": "Completed",
    "results": {
        "search_metadata": {
            "id": 230200211,
            "status": "success",
            "created_at": "2026-03-16T11:52:50.000000Z",
            "processed_at": "2026-03-16 11:52:50"
        },
        "search_parameters": {
            "q": "football",
            "url": "https://www.google.com/complete/search?q=football&client=chrome&dpr=1&hl=en&gl=US",
            "client": "chrome",
            "lang": "en",
            "country": "US",
            "location": "Abernathy,Texas,United States"
        },
        "results": {
            "suggestions": [
                {
                    "value": "football games today",
                    "relevance": 1250,
                    "type": "QUERY",
                    "link": "https://www.google.com/search?q=football+games+today"
                },
                {
                    "value": "football games",
                    "relevance": 701,
                    "type": "QUERY",
                    "link": "https://www.google.com/search?q=football+games"
                },
                {
                    "value": "football today",
                    "relevance": 700,
                    "type": "QUERY",
                    "link": "https://www.google.com/search?q=football+today"
                },
                {
                    "value": "football tonight",
                    "relevance": 601,
                    "type": "QUERY",
                    "link": "https://www.google.com/search?q=football+tonight"
                },
                {
                    "value": "football game tonight",
                    "relevance": 600,
                    "type": "QUERY",
                    "link": "https://www.google.com/search?q=football+game+tonight"
                },
                {
                    "value": "football scores",
                    "relevance": 559,
                    "type": "QUERY",
                    "link": "https://www.google.com/search?q=football+scores"
                },
                {
                    "value": "football games this weekend",
                    "relevance": 558,
                    "type": "QUERY",
                    "link": "https://www.google.com/search?q=football+games+this+weekend"
                },
                {
                    "value": "football games tomorrow",
                    "relevance": 557,
                    "type": "QUERY",
                    "link": "https://www.google.com/search?q=football+games+tomorrow"
                },
                {
                    "value": "football schedule",
                    "relevance": 556,
                    "type": "QUERY",
                    "link": "https://www.google.com/search?q=football+schedule"
                },
                {
                    "value": "football playoffs",
                    "relevance": 555,
                    "type": "QUERY",
                    "link": "https://www.google.com/search?q=football+playoffs"
                },
                {
                    "value": "football on tv today",
                    "relevance": 554,
                    "type": "QUERY",
                    "link": "https://www.google.com/search?q=football+on+tv+today"
                },
                {
                    "value": "football games today on tv",
                    "relevance": 553,
                    "type": "QUERY",
                    "link": "https://www.google.com/search?q=football+games+today+on+tv"
                },
                {
                    "value": "football cleats",
                    "relevance": 552,
                    "type": "QUERY",
                    "link": "https://www.google.com/search?q=football+cleats"
                },
                {
                    "value": "football bros",
                    "relevance": 551,
                    "type": "QUERY",
                    "link": "https://www.google.com/search?q=football+bros"
                },
                {
                    "value": "football tomorrow",
                    "relevance": 550,
                    "type": "QUERY",
                    "link": "https://www.google.com/search?q=football+tomorrow"
                }
            ],
            "verbatim_relevance": 1300
        }
    }
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

```json
{
    "status": "error",
    "msg": "validation_error",
    "error": {
        "q": [
            "The q field is required."
        ]
    }
}
```

{% endtab %}

{% tab title="402: Payment Required" %}

```json
{
    "status": "error",
    "msg": "Your SERPHouse account has either run out of available credits (try upgrading your Plan), or there is a payment problem.",
    "error": ""
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

```json
{
    "status": "error",
    "msg": "Missing required fields.",
    "error": ""
}
```

{% endtab %}

{% tab title="401: Unauthorized" %}

```json
{
    "status": "error",
    "msg": "Unauthenticated"
}
```

{% endtab %}
{% endtabs %}

## Example request:

{% tabs %}
{% tab title="BASH" %}

<pre class="language-bash"><code class="lang-bash">curl --location --request <a data-footnote-ref href="#user-content-fn-1">POST </a>'https://api.serphouse.com/google-autocomplete-api' \
--header 'Authorization: Bearer &#x3C;YOUR_API_KEY>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "data": {
        "q": "football",
        "lang": "en", 
        "loc": "Abernathy,Texas,United States",
        "client": "chrome"
    }
}'
</code></pre>

{% endtab %}

{% tab title="RUBY" %}

```ruby
require "uri"
require "json"
require "net/http"

url = URI("https://api.serphouse.com/google-autocomplete-api")

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

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer <YOUR_API_KEY>"
request.body = JSON.dump({
  "data": {
    "q": "football",
    "lang": "en",
    "loc": "Abernathy,Texas,United States",
    "client": "chrome"
  }
})

response = https.request(request)
puts response.read_body
```

{% endtab %}

{% tab title="PYTHON" %}

```python
import requests
import json

url = "https://api.serphouse.com/google-autocomplete-api"

payload = json.dumps({
  "data": {
    "q": "football",
    "lang": "en", 
    "loc": "Abernathy,Texas,United States",
    "client": "chrome"
  }
})
headers = {
  'Authorization': 'Bearer <YOUR_API_KEY>',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

```

{% endtab %}

{% tab title="NODE.JS" %}

```javascript
var axios = require('axios');
var data = JSON.stringify({
  "data": {
    "q": "football",
    "lang": "en", 
    "loc": "Abernathy,Texas,United States",
    "client":"chrome"
  }
});

var config = {
  method: 'post',
  url: 'https://api.serphouse.com/google-autocomplete-api',
  headers: { 
    'Content-Type': 'application/json', 
    'Authorization': 'Bearer <YOUR_API_KEY>'
  },
  data : data
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});

```

{% endtab %}

{% tab title="JAVA" %}

```java

OkHttpClient client = new OkHttpClient().newBuilder().build();
MediaType mediaType = MediaType.parse("application/json");

JSONObject jsonObject = new JSONObject();
JSONObject dataObject = new JSONObject();
dataObject.put("q", "football");
dataObject.put("lang", "en");
dataObject.put("loc", "Abernathy,Texas,United States");
dataObject.put("client", "chrome");
jsonObject.put("data", dataObject);

String bodyJson = jsonObject.toString();
RequestBody body = RequestBody.create(mediaType,bodyJson);

Request request = new Request.Builder()
        .url("https://api.serphouse.com/google-autocomplete-api")
        .method("POST", body)
        .addHeader("Content-Type", "application/json")
        .addHeader("Authorization", "Bearer <YOUR_API_KEY>")
        .build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());git
```

{% endtab %}

{% tab title="JAVASCRIPT" %}

```javascript
var myHeaders = new Headers();
myHeaders.append("Authorization", "Bearer <YOUR_API_KEY>");
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({
  "data": {
    "q": "football",
    "lang": "en",
    "loc": "Abernathy,Texas,United States",
    "client":"chrome"
  }
});

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https://api.serphouse.com/google-autocomplete-api", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
```

{% endtab %}

{% tab title="GO" %}

```go
package main

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

func main() {

  url := "https://api.serphouse.com/google-autocomplete-api"
  method := "POST"

  payload := strings.NewReader(`{
    "data": {
        "q": "football",
        "lang": "en", 
        "loc": "Abernathy,Texas,United States",
        "client":"chrome"
    }
}`)

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Content-Type", "application/json")
  req.Header.Add("Authorization", "Bearer <YOUR_API_KEY>")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
```

{% endtab %}

{% tab title="C#/.NET" %}

```csharp
var client = new RestClient("https://api.serphouse.com/google-autocomplete-api");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer <YOUR_API_KEY>");
var body = @"{
	""data"": {
	    ""q"": ""football"",
	    ""lang"": ""en"",
	    ""loc"": ""Abernathy,Texas,United States"",
			""client"": ""chrome""
	}
}";
request.AddParameter("application/json", body,  ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
```

{% endtab %}
{% endtabs %}

[^1]:
