Google Autocomplete API
按查询词、Google 域名和语言获取标准化 Google 搜索建议。
接口地址
GET https://api.goanyapi.com/api/v1/google-autocomplete当前配置下,每次成功请求消耗 3 积分。
身份认证
Authorization: Bearer YOUR_API_KEY请求参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
q | string | 是 | 部分或完整搜索词,最长 200 个字符 |
domain | string | 否 | www.google.com 或 www.google.com.hk,默认 www.google.com |
hl | string | 否 | 返回语言代码,例如 en、zh 或 ja,默认 en |
此接口没有 gl 参数。使用 domain 在两个受支持的 Google 域名之间选择,使用 hl 指定返回语言。
请求示例
GET /api/v1/google-autocomplete?q=ai%20image&domain=www.google.com&hl=en
Authorization: Bearer YOUR_API_KEY响应示例
{
"code": "ok",
"message": "ok",
"data": {
"endpoint": "google-autocomplete",
"remainingCredits": 99,
"query": {
"q": "ai image",
"domain": "www.google.com",
"hl": "en"
},
"suggestions": [
"ai image generator",
"ai image generator free",
"ai image detector",
"ai image editor",
"ai image to video"
]
}
}响应字段
| 字段 | 说明 |
|---|---|
data.endpoint | 固定接口标识:google-autocomplete |
data.costCredits | 本次扣除积分;空结果时为 0 |
data.remainingCredits | 请求完成后的剩余积分 |
data.query.q | 标准化后的查询词 |
data.query.domain | 本次请求使用的 Google 域名 |
data.query.hl | 本次请求使用的语言 |
data.suggestions | 去重并移除空值后的搜索建议字符串数组 |
参数校验
q必填,最长 200 个字符domain仅接受www.google.com和www.google.com.hkhl必须是有效语言代码- 不支持的域名返回
400 invalid_params
计费
当前请求价格以本页显示的 API 配置为准。
- 搜索建议为空时消耗
0 积分 - 请求失败不扣积分