Google Web Search — API 参考文档
/google/search搜索
通过 q、语言 hl、国家 gl 和支持的设备搜索 Google 网页。结果区块取决于查询和上游响应。
通过 q、语言 hl、国家 gl 和支持的设备搜索 Google 网页。结果区块取决于查询和上游响应。
qstring必填
搜索查询字符串。
hlstring可选
语言代码,默认 en。
glstring可选
国家代码,默认 us。
pagenumber可选
从 1 开始的页码,默认 1。
device"default" | "pc" | "mobile"可选
仅适用于 Google Search。default 表示自动路由,pc 使用桌面会话,mobile 使用移动端会话。
{
"device": "mobile",
"gl": "us",
"hl": "en",
"q": "coffee shops"
}querystring必填
请求中的标准化 query。
pagenumber必填
当前页码,从 1 开始。
organicOrganicResult[]解析到自然结果时返回。
自然搜索结果。
featured_snippetFeaturedSnippetGoogle 出现精选摘要时返回。
精选摘要答案卡片,独立于自然结果返回。
top_storiesTopStory[]SERP 包含 Top Stories 时返回。
Top Stories 模块。
people_also_askPAA[]存在 People Also Ask 时返回。
问题、答案和来源链接。
knowledge_graphKnowledgeGraph解析到知识面板时返回。
实体面板数据。
related_searchesstring[]找到相关搜索时返回。
相关搜索词。
ranknumber必填
当前响应里的 1-based 排名。
positionnumber可用时作为 rank 的别名。
给客户端使用的标准化排名别名。
titlestring必填
结果标题。
linkstring必填
parser 返回的主链接。
urlstring结果链接可归一化时返回。
规范化目标 URL,通常和 link 相同。
source_urlstring只有观测到 Google 跳转/来源 URL 时返回。
保留的原始 Google URL,用于调试和溯源。
display_urlstring当 Google 展示文本或域名可解析时返回。
展示 URL 或来源域名。
display_linkstringGoogle 展示文本存在时返回。
Google 原始展示链接文本。
snippetstring解析到摘要时返回。
自然结果摘要。
datestringGoogle 摘要中带日期时返回。
从摘要中提取的原始日期文本。
published_atstring解析到日期时作为日期别名返回。
标准化日期别名。
iconstring解析到图标或图片时返回。
结果图标 URL。
sitelinks{ title, link, url, source_url?, display_url? }[]存在站内链接时返回。
自然结果下的站内链接。
curl -X POST 'https://api.serpbase.dev/google/search' \
-H "Content-Type: application/json" \
-H 'X-API-Key: YOUR_API_KEY' \
-d '{"device":"mobile","gl":"us","hl":"en","q":"coffee shops"}'现有 Google 请求示例
curl -X POST https://api.serpbase.dev/google/search \
-H "Content-Type: application/json" \
-H "X-API-Key: your_api_key" \
-d '{
"q": "python asyncio",
"hl": "en",
"gl": "us",
"page": 1,
"device": "default"
}'搜索 grounding、SEO 检查、答案提取。
Search 还可能返回 ai_overview、weather、finance、flight、result_stats,取决于 SERP 是否出现这些模块。