Google Search Autocomplete API - Real-time Keyword Suggestions

Unlock Google's search suggestions for powerful keyword research, SEO optimization, and content strategy. Get real-time autocomplete data in 100+ languages.

What can you do?
Ultra-fast suggest API

Same endpoint Chrome uses behind the scenes.

Works in 100+ languages

Pass any ISO language code via “hl” parameter.

Perfect for keyword research

Scrape-free insights for SEO and content ideation.

Try Live
99.9 % Uptime
172ms Response
5 req/s
0.01 Credits / request

Query Suggest


POST https://api.yeb.to/v1/google/search/autocomplete
ParameterTypeReq.Description
api_key string yes Your API key
q string yes Search phrase
hl string opt Language/locale (ISO-639-1), default “en”

Example

curl -X POST https://api.yeb.to/v1/google/search/autocomplete \
  -H "Content-Type: application/json" \
  -d '{
  "api_key": "YOUR_KEY",
  "q": "best electric cars",
  "hl": "en"
}'

Response Example

{
  "query": "best electric cars",
  "lang": "en",
  "cnt_results": 5,
  "suggestions": [
    "best electric cars 2025",
    "best electric cars range",
    "best electric cars under 40k",
    "best electric cars for families",
    "best electric cars lease deals"
  ]
}
{"error":"Missing \"q\" (query) parameter","code":400}

Response Codes

CodeDescription
200 SuccessRequest processed OK.
400 Bad RequestInput validation failed.
401 UnauthorizedMissing / wrong API key.
403 ForbiddenKey inactive or not allowed.
429 Rate LimitToo many requests.
500 Server ErrorUnexpected failure.

Autocomplete

google/search/autocomplete 0.0100 credits

Parameters

API Key
query · string · required
Query
query · string · required
Language/locale
query · string

Code Samples


                
                
                
            

Response

Status:
Headers

                
Body

                

Google Search Autocomplete API - Real-time Keyword Suggestions — Practical Guide

A hands-on guide to Query Suggest (Google Autocomplete): what the endpoint does, when to use it, the parameters that matter, and how to read responses to power typeahead, SEO ideation, and discovery UX.

#What Query Suggest solves

Autocomplete shows real user search intents as you type. Use it to reduce zero-result queries, guide users to popular paths, and expand content/keyword ideas by language and locale.

#Endpoint & when to use it

#POST /v1/google/search/autocomplete/autocomplete — Query Suggest (Autocomplete)

  • Best for: Search bars, filters, onboarding wizards, SEO ideation, merchandising queries.
  • How it works: You pass a prefix (q) and optional language (hl), we return ranked suggestions.
  • Typical use: Client debounces keystrokes (e.g., 120–200ms), calls backend which proxies this endpoint.

#Quick start

curl -X POST "https://api.yeb.to/v1/google/search/autocomplete/autocomplete" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: <YOUR_API_KEY>" \
  -d '{ "q": "best electric cars", "hl": "en" }'
// JS Fetch example
fetch('https://api.yeb.to/v1/google/search/autocomplete/autocomplete', {
  method: 'POST',
  headers: {
    'X-API-Key': '<YOUR_API_KEY>',
    'Content-Type': 'application/json',
    'Accept': 'application/json'
  },
  body: JSON.stringify({ q: 'best electric cars', hl: 'en' })
})
.then(r => r.json())
.then(console.log)
.catch(console.error);

#Parameters that actually matter

ParamTypeRequiredPractical guidance
api_key string Yes Use a server-side secret or signed edge token; never expose raw keys in the browser.
q string Yes User’s input prefix. Trim whitespace; short prefixes (1–2 chars) often return fewer/no results.
hl string No Locale (ISO-639-1). Default en. Match your UI language for best relevance.

#Reading & acting on responses

{
  "query": "best electric cars",
  "lang": "en",
  "cnt_results": 5,
  "suggestions": [
    "best electric cars 2025",
    "best electric cars range",
    "best electric cars under 40k",
    "best electric cars for families",
    "best electric cars lease deals"
  ]
}
  • query — the normalized input we processed (useful for debugging/caching).
  • lang — effective language used; verify it matches your UI.
  • cnt_results — fast guard for empty states and rate-limiting logic.
  • suggestions[] — ordered phrases you can render directly in your typeahead.

#Recommended actions

  • Debounce & cache: 120–200ms debounce per user; cache last 20 prefixes per session (and server-side LRU for hot prefixes).
  • Empty state UX: If cnt_results = 0, show recent searches or curated shortcuts.
  • Locale-aware: Tie hl to user’s language selector; don’t infer from IP unless UI also changes.

#Practical recipes

  • Typeahead: On keypress, call with q, render the top 5 suggestions; accept arrow/enter to complete.
  • SEO ideation: Precompute common stems (e.g., “best <category>”), store suggestions for content planning.
  • Facet helpers: In complex search, merge suggestions with your own filters to guide users to valid queries.
  • Localize: Switch hl with the app locale to keep suggestions culturally relevant.

#Troubleshooting & field notes

  1. “Missing q” (400): Ensure you send q as a non-empty string; trim before sending.
  2. Unauthorized (401): Invalid/expired key or wrong header (X-API-Key required).
  3. Few/zero results: Try a longer prefix or switch hl to match your audience language.
  4. Rate limits: Implement client debounce + server-side caching. Backoff on repeated requests for the same prefix.

#API Changelog

2025-10-20
Stabilized cnt_results and lang fields; tightened normalization of q (trim/whitespace collapse).
2025-10-12
Improved suggestion ranking consistency across locales; minor fixes for edge Unicode cases in hl.
2025-10-01
Initial release of /google/search/autocomplete with q and optional hl.

Frequently Asked Questions

Yes! You can request suggestions in 100+ languages by passing the appropriate ISO language code via the "hl" parameter (e.g. "es" for Spanish, "fr" for French).

They are sourced from the same public API used by Chrome and Google properties, so results are typically identical to those on google.com. Some regional/country differences may apply.

Popular uses include keyword research for SEO, autocomplete UI for search boxes, content ideation, trend discovery, competitor analysis, and market research.

Suggestions are pulled in real-time from Google's live autocomplete service, ensuring you get the most current and trending search queries.

Standard rate limits apply based on your plan. Each request costs 0.01 credits and provides up to 10 suggestions per query.

Yes. Every request, even those resulting in errors, consumes credits. This is because your credits are tied to the number of requests, regardless of success or failure. If the error is clearly due to a platform problem on our end, we will restore the affected credits (no cash refunds).

Contact us at [email protected]. We take feedback seriously—if your bug report or feature request is meaningful, we can fix or improve the API quickly and grant you 50 free credits as a thank you.

It depends on the API and sometimes even on the endpoint. Some endpoints use data from external sources, which may have stricter limits. We also enforce limits to prevent abuse and keep our platform stable. Check the docs for the specific rate limit for each endpoint.

We operate on a credit system. Credits are prepaid, non-refundable units you spend on API calls and tools. Credits are consumed FIFO (oldest first) and are valid for 12 months from the purchase date. The dashboard shows each purchase date and its expiry.

Yes. All purchased credits (including fractional balances) are valid for 12 months from purchase. Unused credits automatically expire and are permanently deleted at the end of the validity period. Expired credits cannot be restored or converted to cash or other value. Transitional rule: credits bought before 22 Sep 2025 are treated as purchased on 22 Sep 2025 and expire on 22 Sep 2026 (unless an earlier expiry was stated at purchase).

Yes—within their validity window. Unused credits remain available and roll over month-to-month until they expire 12 months after purchase.

Credits are non-refundable. Only buy what you need—you can always top up later. If a platform-side error causes a failed charge, we may restore the affected credits after investigation. No cash refunds.

Prices are set in credits, not dollars. Each endpoint lists its own cost—see the “Credits / request” badge above. You’ll always know exactly what you’re spending.
← Back to APIs