Skip to content

Google 自动补全 API 文档与端点目录 自动补全建议 API

prod-global
GET
/api/v1/google/autocomplete
API 健康状态
健康 可用 受限 大多不可用 无数据
正在加载健康状态...

获取Google自动补全建议数据,包括实时建议数据、国家和语言定位以及结构化建议列表,用于关键词扩展和搜索意图研究。

标签: Google

请求参数

名称必填类型默认值说明
querystring要获取自动补全建议的搜索查询。当您输入时,Google会根据热门搜索提供实时预测。
countrystringus设置目标国家代码(例如 'us'、'uk')以本地化结果。请参阅 Google 国家/地区
languagestringen使用其两位字母代码设置结果语言(例如 'en' 表示英语,'fr' 表示法语)。请参阅 Google 语言

复制请求

bash
curl -X GET "https://api.justserpapi.com/api/v1/google/autocomplete?query=coffee" \
  -H "X-API-Key: YOUR_API_KEY"
js
const res = await fetch("https://api.justserpapi.com/api/v1/google/autocomplete?query=coffee", {
  headers: { "X-API-Key": "YOUR_API_KEY" }
});
const data = await res.json();
console.log(data);
python
import requests

url = "https://api.justserpapi.com/api/v1/google/autocomplete"
headers = { "X-API-Key": "YOUR_API_KEY" }
params = {
  "query": "coffee"
}
response = requests.get(url, headers=headers, params=params)
print(response.json())
php
<?php
$url = "https://api.justserpapi.com/api/v1/google/autocomplete?query=coffee";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "X-API-Key: YOUR_API_KEY"
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
go
package main

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

func main() {
	client := &http.Client{}
	req, _ := http.NewRequest("GET", "https://api.justserpapi.com/api/v1/google/autocomplete?query=coffee", nil)
	req.Header.Set("X-API-Key", "YOUR_API_KEY")
	resp, _ := client.Do(req)
	defer resp.Body.Close()
	body, _ := io.ReadAll(resp.Body)
	fmt.Println(string(body))
}

响应

正在加载最新响应示例...