API เติมข้อความอัตโนมัติ Google Search - คำแนะนำคำค้นหาแบบเรียลไทม์

ปลดล็อกคำแนะนำการค้นหาของ Google สำหรับการวิจัยคำหลัก การเพิ่มประสิทธิภาพ SEO และกลยุทธ์เนื้อหา รับข้อมูลเติมข้อความอัตโนมัติแบบเรียลไทม์ในกว่า 100 ภาษา

รับ API Key ซื้อเครดิต
คุณสามารถทำอะไรได้บ้าง?
API แนะนำแบบเร็วสุด

Endpoint เดียวกับที่ Chrome ใช้เบื้องหลัง

ใช้ได้ใน 100+ ภาษา

ส่งรหัสภาษา ISO ใดก็ได้ผ่านพารามิเตอร์ "hl"

เหมาะสำหรับวิจัยคำหลัก

ข้อมูลเชิงลึกโดยไม่ต้อง scrape สำหรับ SEO และไอเดียเนื้อหา

99.9 % เวลาทำงาน
164.7ms การตอบกลับ
5 req/s
0.01 เครดิต / คำขอ

Query Suggest


POST https://api.yeb.to/v1/google/search/autocomplete
พารามิเตอร์ประเภทจำเป็นคำอธิบาย
api_key string ใช่ Your API key
q string ใช่ Search phrase
hl string ไม่บังคับ Language/locale (ISO-639-1), default “en”

ตัวอย่าง

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"
}'

ตัวอย่างการตอบกลับ

{
  "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}

รหัสตอบกลับ

รหัสคำอธิบาย
200 Successคำขอดำเนินการสำเร็จ
400 Bad Requestการตรวจสอบข้อมูลนำเข้าล้มเหลว
401 UnauthorizedAPI Key หายไปหรือไม่ถูกต้อง
403 ForbiddenKey ไม่ทำงานหรือไม่ได้รับอนุญาต
429 Rate Limitคำขอมากเกินไป
500 Server Errorข้อผิดพลาดที่ไม่คาดคิด

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

                

API เติมข้อความอัตโนมัติ Google Search - คำแนะนำคำค้นหาแบบเรียลไทม์ — 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.

คำถามที่พบบ่อย

ได้! คุณสามารถขอคำแนะนำในกว่า 100 ภาษาโดยส่งรหัสภาษา ISO ที่เหมาะสมผ่านพารามิเตอร์ "hl" (เช่น "es" สำหรับสเปน "fr" สำหรับฝรั่งเศส)

มาจาก API สาธารณะเดียวกับที่ Chrome และบริการ Google ใช้ ดังนั้นผลลัพธ์จึงเหมือนกัน อาจมีความแตกต่างตามภูมิภาค

การใช้งานยอดนิยมได้แก่ วิจัยคำหลัก SEO, UI เติมข้อความอัตโนมัติ, ไอเดียเนื้อหา, ค้นพบเทรนด์, วิเคราะห์คู่แข่ง และวิจัยตลาด

คำแนะนำดึงแบบเรียลไทม์จากบริการเติมข้อความอัตโนมัติของ Google

ข้อจำกัดอัตรามาตรฐานใช้ตามแผนของคุณ แต่ละคำขอใช้ 0.01 เครดิตและให้คำแนะนำสูงสุด 10 รายการ

ใช่ ทุกคำขอ แม้แต่ที่เกิดข้อผิดพลาด จะใช้เครดิต เครดิตของคุณผูกกับจำนวนคำขอ ไม่ว่าจะสำเร็จหรือล้มเหลว หากข้อผิดพลาดเกิดจากปัญหาของแพลตฟอร์มฝั่งเราอย่างชัดเจน เราจะคืนเครดิตที่ได้รับผลกระทบ (ไม่มีการคืนเงินสด)

ติดต่อเราที่ [email protected] เรารับฟังความคิดเห็นอย่างจริงจัง—หากรายงานข้อบกพร่องหรือคำขอฟีเจอร์ของคุณมีความหมาย เราสามารถแก้ไขหรือปรับปรุง API ได้อย่างรวดเร็วและมอบเครดิตฟรี 50 เครดิตเป็นการขอบคุณ

ขึ้นอยู่กับ API และบางครั้งรวมถึง endpoint ด้วย บาง endpoint ใช้ข้อมูลจากแหล่งภายนอกซึ่งอาจมีขีดจำกัดที่เข้มงวดกว่า เรายังบังคับใช้ขีดจำกัดเพื่อป้องกันการใช้ในทางที่ผิดและรักษาเสถียรภาพของแพลตฟอร์ม ตรวจสอบเอกสารสำหรับขีดจำกัดเฉพาะของแต่ละ endpoint

เราใช้ระบบเครดิต เครดิตเป็นหน่วยจ่ายล่วงหน้าที่ไม่สามารถคืนเงินได้ ใช้สำหรับการเรียก API และเครื่องมือ เครดิตถูกใช้แบบ FIFO (เก่าสุดก่อน) และมีอายุ 12 เดือนนับจากวันที่ซื้อ แดชบอร์ดแสดงวันที่ซื้อแต่ละครั้งและวันหมดอายุ

ใช่ เครดิตที่ซื้อทั้งหมด (รวมถึงยอดคงเหลือเศษส่วน) มีอายุ 12 เดือนนับจากการซื้อ เครดิตที่ไม่ได้ใช้จะหมดอายุโดยอัตโนมัติและถูกลบอย่างถาวรเมื่อสิ้นสุดระยะเวลาที่มีผล เครดิตที่หมดอายุไม่สามารถกู้คืนหรือแปลงเป็นเงินสดหรือมูลค่าอื่นได้ กฎเปลี่ยนผ่าน: เครดิตที่ซื้อก่อน 22 ก.ย. 2025 ถือว่าซื้อเมื่อ 22 ก.ย. 2025 และหมดอายุ 22 ก.ย. 2026 (เว้นแต่ระบุวันหมดอายุที่เร็วกว่าตอนซื้อ)

ใช่—ภายในระยะเวลาที่มีผล เครดิตที่ไม่ได้ใช้ยังคงใช้ได้และยกยอดจากเดือนต่อเดือนจนกว่าจะหมดอายุ 12 เดือนหลังการซื้อ

เครดิตไม่สามารถคืนเงินได้ ซื้อเฉพาะที่คุณต้องการ—คุณสามารถเติมได้ภายหลังเสมอ หากข้อผิดพลาดของแพลตฟอร์มทำให้การเรียกเก็บเงินล้มเหลว เราอาจคืนเครดิตที่ได้รับผลกระทบหลังจากการตรวจสอบ ไม่มีการคืนเงินสด

ราคากำหนดเป็นเครดิต ไม่ใช่ดอลลาร์ แต่ละ endpoint มีราคาของตัวเอง—ดูป้าย "เครดิต / คำขอ" ด้านบน คุณจะรู้ค่าใช้จ่ายที่แน่นอนเสมอ
← กลับไปที่ API