SerpBase

接口参考 · 通用搜索

Google AI Mode

Google's AI Mode answer to a question, as plain text and as Markdown with its headings, lists and tables, plus the pages it cites with their real URLs.

POSThttps://api.serpbase.dev/google/ai_mode
3 积分在 Playground 中调用

示例

BASH
curl -X POST 'https://api.serpbase.dev/google/ai_mode' \
  -H "Content-Type: application/json" \
  -H 'X-API-Key: YOUR_API_KEY' \
  --max-time 60 \
  -d '{"gl":"us","hl":"en","q":"how does a heat pump work"}'

这个接口暂未发布真实返回示例。可以在 Playground 运行上面的请求查看实时结果。

参数

format
"json" | "markdown"
json(默认)返回解析后的结果。
更多

markdown 以 Markdown 文本(text/markdown)返回同样的结果,便于大模型直接读取:不含外层信封、重复的别名字段和内嵌图片。扣费相同;失败时仍返回 JSON 错误信封。

gl
string
示例值: "us"
hl
string
示例值: "en"
q
string
示例值: "how does a heat pump work"

示例展示请求参数用法,不代表完整契约。接口会校验已知字段,并允许额外参数。

返回字段

字段见上面的返回示例;每个接口都包含 status、credits_charged 和 request_id。

失败时

失败的请求 status 不为 0 并带有 error,不扣费。这个接口常见的有:

1000参数缺失或有误修改请求
1020积分不足充值
1029超过每秒请求数等待 Retry-After 秒
1502 · 1504这次没能读取到目标网站重试
全部状态码 →