Skip to content

About

Google Autocomplete API by Autom: Google search suggestions as JSON. Python, TypeScript, cURL, PHP, C#, Go, Java, Ruby examples.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Google Autocomplete API by Autom

Google Autocomplete API

Discord Get API key API docs License: MIT

The Autom Google Autocomplete API returns Google search suggestions for a query as JSON.

  • Google Search Autocomplete API — Get Google Search autocomplete suggestions via API for a given query.

Use it for keyword research, content ideas or search-box suggestions.

Endpoint Request Credits
Google Search Autocomplete API GET /v1/google/search/autocomplete 1

Table of contents

How it works

  1. Create a Autom account and copy your API key from the dashboard.
  2. Call https://api.autom.dev with the header x-api-key: YOUR_API_KEY.
  3. Use the result in your app — no infrastructure to run.
export AUTOM_API_KEY="your-api-key"
pip install requests        # Python
# TypeScript: Node.js 18+ (native fetch), run with `npx tsx file.ts`

Google Search Autocomplete API

Get Google Search autocomplete suggestions via API for a given query.

GET https://api.autom.dev/v1/google/search/autocomplete · 1 credit per request · API reference

Request parameters

Parameter In Type Required Description
query query string ✅ The search query for which you want to get autocomplete suggestions.
cp query number — Cursor position in the search query where you want to get autocomplete suggestions.
gl query string — Country to use for autocomplete (two-letter country code).
hl query string — Language to use for autocomplete (two-letter language code).

Python example

import os

import requests

API_KEY = os.environ["AUTOM_API_KEY"]
HEADERS = {"x-api-key": API_KEY}

response = requests.get(
    "https://api.autom.dev/v1/google/search/autocomplete",
    headers=HEADERS,
    params={
        "query": "coffee",
    },
    timeout=120,
)
response.raise_for_status()

data = response.json()
print(data)

TypeScript example

type GoogleSearchAutocompleteApi = {
  suggestions?: string[];
};

const headers = { "x-api-key": process.env.AUTOM_API_KEY!, "Content-Type": "application/json" };

const params = new URLSearchParams({
  "query": "coffee",
});

const response = await fetch(`https://api.autom.dev/v1/google/search/autocomplete?${params}`, { headers });
if (!response.ok) throw new Error(`HTTP ${response.status}: ${await response.text()}`);

const data = (await response.json()) as GoogleSearchAutocompleteApi;
console.log(data);

Output example

Example response from the API reference, abridged.

{
  "suggestions": [
    "coffee near me",
    "coffee maker"
  ]
}

Response fields

Field Type Description
suggestions string[]

Code examples in other languages

Ready-to-run examples live in examples/; each reads your key from AUTOM_API_KEY.

Language google-search-autocomplete
cURL (Bash) google_search_autocomplete.sh
PHP google_search_autocomplete.php
C# GoogleSearchAutocomplete.cs
Go google_search_autocomplete.go
Java GoogleSearchAutocompleteExample.java
Ruby google_search_autocomplete.rb
Node.js google_search_autocomplete.mjs

Use cases

  • Keyword research — Expand seed keywords with real suggestions.
  • Content ideas — Find what people search around a topic.

Why Autom?

  • Every SERP in one API — Google Search, AI Mode, Maps, News, Shopping, Images, Videos, Jobs, Autocomplete, plus Bing and Brave.
  • Structured JSON — documented fields instead of brittle HTML parsing.
  • Geo & language targeting — search like a user from the country and language you need.
  • One API key, one header — x-api-key on every request.
  • Copy-paste examples — Python and TypeScript in each README, 7 more languages in examples/.

FAQ

How do I authenticate?

Create an account on Autom, copy your API key and send it in the x-api-key header of every request to https://api.autom.dev.

How much does a request cost?

Credits per call: /v1/google/search/autocomplete 1. See Autom pricing.

Which languages are supported?

Any language that can make an HTTP request. This README shows Python and TypeScript; the examples/ folder contains cURL, PHP, C#, Go, Java, Ruby and Node.js.

Related repositories

Support


Autom
Built by Autom. Examples are released under the MIT license.

About

Google Autocomplete API by Autom: Google search suggestions as JSON. Python, TypeScript, cURL, PHP, C#, Go, Java, Ruby examples.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors