接口参考 · 通用搜索
搜索
通过 q、语言 hl、国家 gl 和支持的设备搜索 Google 网页。结果区块取决于查询和上游响应。
示例
curl -X POST 'https://api.serpbase.dev/google/search' \
-H "Content-Type: application/json" \
-H 'X-API-Key: YOUR_API_KEY' \
--max-time 60 \
-d '{"device":"mobile","gl":"us","hl":"en","q":"coffee shops"}'{
"status": 0,
"credits_charged": 1,
"request_id": "r-4b27fe8a36d9ac303a5da7dd",
"product_id": "google_web_search",
"query": "coffee shops",
"local_results": [
{
"address": "Denver, CO",
"category": "Coffee shop",
"hours": "Open",
"position": 1,
"rank": 1,
"rating": "4.9",
"reviews_count": "455",
"title": "Coffeegraph"
},
{
"address": "Sioux Falls, SD",
"category": "Coffee shop",
"hours": "Open",
"position": 1,
"rank": 2,
"rating": "4.9",
"reviews_count": "295",
"title": "The Breaks Coffee Roasting Co."
}
],
"organic": [
{
"date": "Sep 17, 2026",
"display_link": "www.discovertheburgh.com",
"display_url": "www.discovertheburgh.com",
"link": "https://www.discovertheburgh.com/pittsburgh-coffee-shops/",
"position": 3,
"published_at": "Sep 17, 2026",
"rank": 1,
"snippet": "🏨 Book Avenue in Garfield. Redhawk Coffee. Ghost Coffee Collab at Trace Brewing. Kaibur Coffee Kaibu…",
"source_url": "https://www.google.com/goto?url=CAESdAHrOzAVQPT8-1-RxOq_G62WuAgUAmaFDk4SD6YsadPoLMH5lbvuR0WPu8BR2EKN…",
"title": "48 Pittsburgh Coffee Shops to Grab a Delicious Brew",
"url": "https://www.discovertheburgh.com/pittsburgh-coffee-shops/"
}
],
"page": 1,
"people_also_ask": [
{
"position": 2,
"question": "What are the top 10 coffee chains?"
},
{
"position": 2,
"question": "What are the main coffee shop chains?"
}
],
"people_also_search_for": [
"Best coffee shops",
"Coffee shops Orlando"
],
"related_searches": [
"Best coffee shops in Pittsburgh to study",
"Coffee Shops near Monroeville PA"
],
"search_type": "search"
}参数
q必填url更多
会读取其中的 q、gl、hl、start、uule、tbs、filter、nfpr、pws、complete、ie。浏览器附带的记录参数(oq、sourceid、ei、ved、sxsrf、num 等)会被忽略;其他参数(tbm、safe 等)会以 status 1000 拒绝并指出参数名,网址里的内容不会被悄悄丢掉。传 url 时不要再传 q、gl、hl、page、location 或下面这些参数;device、format、timeout 照常一起传。接受任意 Google 国家域名,搜索在 www.google.com 上按网址里的 gl、hl 进行。
hlgllocation更多
可用 GET /google/locations 查询。大小写和逗号后的空格会被忽略。不在列表中的名称不会发给 Google,搜索按未传 location 处理。建议与同一市场的 gl、hl 一起使用。仅在手机端(默认设备)生效;电脑端(pc)谷歌按出口 IP 定位,会忽略 location。可选,扣费不变。
uule更多
用于 location 无法表达的坐标或区域;不要和 location 同时传。用坐标时,我们实测手机端和电脑端(pc)的本地商家结果都会跟着坐标变(电脑端两个城市的坐标返回的商家完全不同)。手机端整次搜索都按这个地点进行;电脑端的自然结果可能仍偏向出口 IP 所在地,建议用你自己的查询核对。可选,扣费不变。
pagedevice更多
mobile 返回手机版页面,desktop(或 pc)返回电脑版页面;default 或不传等同于 mobile。页面来自对应设备的真实会话,知识面板等模块在两种设备上会有差异。
format更多
markdown 以 Markdown 文本(text/markdown)返回同样的结果,便于大模型直接读取:不含外层信封、重复的别名字段和内嵌图片。raw 以 text/html 返回 Google 页面本身,已去除平台会话标识、Google 脚本和跟踪信标,结果链接在 Google 允许时已还原为真实网址(仍显示为 google.com/goto 的链接可交给免费的 Google 链接还原接口);指定 raw 时带操作符的查询也由签名路线服务,因此 raw 始终是真实的电脑版或手机版页面。各格式扣费相同;失败时仍返回 JSON 错误信封。
timeout更多
可选;不传时平台最多用 30 秒。传了以后,换线路重试会更早开始,让结果尽量在你的预算内返回;预算用完时请求以 status 1504 结束且不扣费,而不是被你的 HTTP 客户端掐断。客户端自身的超时请设得比这个值大。
tbs更多
qdr:h、qdr:d、qdr:w、qdr:m、qdr:y 分别限定最近一小时、一天、一周、一个月、一年(后面可以跟数字:qdr:m6 是最近六个月)。cdr:1,cd_min:1/1/2026,cd_max:3/31/2026 是自定义日期段(月/日/年)。sbd:1 按日期排序;li:1 是逐字搜索。多个用逗号连接。不是“名称:值”形式的内容会以 status 1000 拒绝。可选,扣费不变。
filter更多
0 表示同时显示 Google 认为与其他结果相似而省略的结果;1 是 Google 默认值。可选,扣费不变。
nfpr更多
1 表示按原样搜索查询词,不做 Google 的拼写纠正;0 是 Google 默认值。可选,扣费不变。
pws更多
0 表示要求 Google 不做个性化结果;1 是 Google 默认值。可选,扣费不变。
complete更多
0 表示本次请求关闭自动补全;1 是 Google 默认值。可选,扣费不变。
ie更多
只接受 UTF-8,所有查询本来就按 UTF-8 发送;接受它是为了让网址参数可以原样传入。可选。
Search 还可能返回 ai_overview、weather、finance、flight、result_stats,取决于 SERP 是否出现这些模块。
返回字段
某次请求页面上没有的内容,对应字段会直接省略,而不是返回空值。
querystring必填
请求中的标准化 query。
pagenumber必填
当前页码,从 1 开始。
search_urlstring线路报告了实际抓取的页面时返回。
实际应答这次搜索的 Google 网址(经过跳转后的最终网址),已去掉抓取会话的标识(ei、sei、psi、sxsrf)。format 为 raw 时没有 JSON 正文,同一网址放在响应头 X-Search-URL 里。
organicOrganicResult[]解析到自然结果时返回。
自然搜索结果。
featured_snippetFeaturedSnippetGoogle 出现精选摘要时返回。
精选摘要答案卡片,独立于自然结果返回。
top_storiesTopStory[]SERP 包含 Top Stories 时返回。
来自 Top stories、News、Also in the news 的新闻卡片:title、link、source、time、thumbnail_url。
people_also_askPAA[]存在 People Also Ask 时返回。
问题、答案和来源链接。
knowledge_graphKnowledgeGraph解析到知识面板时返回。
实体面板数据。
related_searchesstring[]找到相关搜索时返回。
相关搜索词。
ai_overview{ summary, truncated?, sources[] }Google 页面显示 AI 概览时返回。
AI 概览正文(小标题和列表按行保留)及引用来源:title(网站名)、link,页面显示来源卡片时还有 page_title 和 snippet。Google 只在页面上放了长回答的开头时,truncated 为 true。
local_resultsLocalResult[]页面显示地点卡片时返回。
本地地点:title、rating、reviews_count、category、address、hours。
inline_videosInlineVideo[]页面显示视频模块时返回。
视频卡片:title、link、source(站点)、channel、duration、date、thumbnail_url。
short_videosInlineVideo[]页面显示短视频轮播时返回。
短视频,结构与 inline_videos 相同。
discussionsDiscussion[]页面显示讨论区和论坛时返回。
论坛帖子:title、link、source(如 Reddit)、forum、comments、date。
recipesRecipe[]页面显示菜谱卡片时返回。
菜谱卡片:title、link、source、rating、reviews_count、total_time、ingredients。
inline_imagesInlineImage[]页面显示图片条(如知识面板旁)时返回。
图片:title、来源页面 link、source(署名)、thumbnail_url。thumbnail_url 优先给网站上的原图,其次是 Google 的 https 缩略图,最后才是内联 data: 图片。
weather{ location, temperature, condition, precipitation, humidity, wind, source? }页面显示天气卡片时返回。
页面显示的当前天气:location、temperature(电脑端带单位)、condition、precipitation、humidity、wind。
finance{ title, exchange, price, change, after_hours_price?, open?, day_range?, year_range?, market_cap?, pe_ratio?, previous_close?, as_of? }页面显示股票卡片时返回。
页面显示的股价,如 price "210.96 USD"、change "−1.25 (−0.59%)",以及盘后价和主要指标。
social_postsSocialPost[]页面显示“大家在说什么”时返回。
社交网站和论坛的帖子(最多 10 条):title(帖子内容)、link、source(如 X、Reddit)、author、author_description、engagement(如 "370+ likes")、date、duration、thumbnail_url。
latest_postsSocialPost[]页面显示“最新动态”时返回(品牌、人物类搜索)。
该实体自己发布的最新帖子(最多 8 条),结构与 social_posts 相同。
social_profilesSocialProfile[]页面显示“社交账号”时返回。
该实体的社交账号:title(平台名)、link、followers(如 "36M",Google 显示时才有,经常没有)。
shopping_resultsProduct[]页面显示商品卡片(热门商品等)时返回。
商品:title、product_id(Google 商品目录 ID)、price、original_price、merchant、delivery、rating、reviews_count、badge(如 "LOW PRICE")、thumbnail_url。卡片点开的是 Google 商品浮层,因此没有 link。
sports_results{ title, ranking, games[] }页面显示球队或联赛卡片时返回。Google 只对部分球队、联赛查询显示,可能不出现。
球队或联赛及排名,每场比赛的 status、date、start_time(RFC 3339)、stage、teams(队名和比分)、集锦链接。
flight_search{ title, origin, destination, departure_date?, return_date?, options[] }页面显示“搜索航班”卡片时返回(航线类搜索)。
航线(手机端还有日期)及各航空公司最低票价:airline、duration、stops(电脑端)、price、Google Flights 链接。
people_also_search_forstring[]页面显示“用户还搜索了”时返回。
相关实体搜索词,与 related_searches 不同。
OrganicResult 结果项字段
ranknumber必填
该条在所属模块内的排名,从 1 开始(第 3 条自然结果的 rank 是 3)。
positionnumber (integer)Google 网页搜索的每个模块、每一条都有(纯文字列表 related_searches 和 people_also_search_for 除外);其他产品可用时返回。
该条所属模块在结果页上的位置:从上往下数第几块(1 表示最上面)。每条自然结果单独算一块,其他每个模块算一块,同一模块的各条 position 相同。模块内的先后看 rank。只有单一列表的产品,position 与 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? }[]存在站内链接时返回。
自然结果下的站内链接。
失败时
失败的请求 status 不为 0 并带有 error,不扣费。这个接口常见的有:
1000参数缺失或有误修改请求1020积分不足充值1029超过每秒请求数等待 Retry-After 秒1502 · 1504这次没能读取到目标网站重试