谷歌搜索接口
实时获取 Google 搜索结果页的结构化数据,支持按国家、语言、设备与结果条数精确定位,返回自然结果的排名、标题、链接、摘要与评分。
2
积分 / 每次
GET
/v1/google/search待开放该接口正在准备中,暂未开放调用,敬请期待。
请求参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| q | string | 必填 | 搜索关键词,最长 700 字符e.g. wireless earbuds |
| gl | string | 可选 | 国家/地区代码,默认 use.g. us |
| hl | string | 可选 | 语言代码,默认 ene.g. en |
| num | integer | 可选 | 返回结果条数,1-20,默认 10(每次调用固定 2 积分)e.g. 10 |
| device | string | 可选 | 设备类型:desktop / mobilee.g. desktop |
请求示例
bash
curl --location 'https://api.xdatafly.com/v1/google/search?q=wireless%20earbuds&gl=us&hl=en&num=10&device=desktop' \
--header 'Accept: application/json' \
--max-time 120 \
--header 'secret-key: sk_live_xxxxxxxxxxxxxxxx'返回示例
json
{
"code": 0,
"message": "ok",
"request_id": "req_7f3a9c21",
"data": {
"query": "wireless earbuds",
"location_code": 2840,
"language_code": "en",
"total_results": 1280000000,
"pages_count": 1,
"feature_types": [
"organic",
"people_also_ask"
],
"items": [
{
"position": 1,
"position_group": 1,
"title": "The 5 Best Wireless Earbuds of 2026",
"url": "https://example.com/best-wireless-earbuds",
"display_url": "example.com › best-wireless-earbuds",
"domain": "example.com",
"snippet": "Our experts tested 40 pairs to find the best...",
"website_name": "Example",
"rating": {
"value": 4.8,
"votes": 1240
}
}
],
"parser_version": "google.serp:2026.09.1"
},
"usage": {
"credits": 2,
"balance": 998
},
"duration_ms": 2140
}- 只返回自然搜索结果,广告、站点链接与知识面板已被过滤。
- position 是页面上的绝对排名(对应上游 rank_absolute),有富媒体结果时依然稳定。
- 无论返回多少条,谷歌搜索每次调用固定 2 积分。
- 包含 site:、inurl:、filetype: 等操作符的查询会被拒绝,返回 40003。
- device=mobile 返回移动端 SERP 版式,排名可能与桌面端不同。