Google AI Mode Scraper API
AI Mode 回答、引用、追问和完整响应字段说明。
获取 Google AI Mode 回答、引用链接和追问结果。提交问题后等待本次请求完成,直接取得结构化响应。
测试 Google AI Mode Scraper API →接口与鉴权
POST https://api.goanyapi.com/api/v1/google-ai-modeAuthorization: Bearer YOUR_API_KEY
Content-Type: application/json当前配置下,每次成功请求消耗 3 积分。
每次完成的成功请求按当前配置计费,包括空结果、回答暂不可用及有效追问;参数、鉴权和运行失败不扣费。这是同步接口,不返回任务 ID,无需轮询或回调。
JSON 正文参数
| 参数 | 类型 | 必填 | 说明与约束 |
|---|---|---|---|
query | string | 是 | 问题,必填,最多 8192 UTF-8 字节。 最大字符数:8192 What is x.com |
country | string | 否 | 两位国家代码,例如 us、gb;省略使用搜索默认值。 最大字符数:2 ^[a-zA-Z]{2}$us |
language | string | 否 | 语言代码,例如 en、zh-CN;省略使用搜索默认值。 最大字符数:20 ^[A-Za-z]{2,3}(?:-[A-Za-z]{2,4})?$en |
device | string | 否 | 设备:desktop、mobile、tablet。 desktop / mobile / tablet 最大字符数:8192 |
location | string | 否 | 地点,例如 Austin, TX;不能与 uule 同传。 最大字符数:512 Austin, TX |
coordinates | object | 否 | 经纬度对象;不能与 uule 同传。{"latitude":30.2672,"longitude":-97.7431} |
uule | string | 否 | Google 编码位置,以 w+ 或 a+ 开头并接 Base64;与 location、coordinates 互斥。 最大字符数:4096 ^[wa]\+[A-Za-z0-9+/_-]+=*$ |
image_url | string | 否 | 首次或追问使用的公开 HTTPS 图片地址。 最大字符数:8192 ^https://[^\s]+$ |
continuable | boolean | 否 | 开启追问会话,须使用 JSON 输出(省略 output 或设为 json;html 省略或为 false);令牌从首次请求起最多有效 15 分钟,会话可能提前失效。 默认值: false |
subsequent_request_token | string | 否 | 使用 result.content.subsequent_request_token 的原始令牌,仅当前账户可用;须使用 JSON 输出,省略 output 或设为 json,html 省略或设 false;发送新问题并保持原国家、语言、设备及位置条件,可同时传 continuable;追问成功单独计费。 最大字符数:65536 ^gam1\.[A-Za-z0-9_-]+$ |
output | string | 否 | 响应格式:json(默认)、md(Markdown)、html(Brotli 压缩后 Base64 原文);HTML 不能使用 json_restrictor。 json / md / html 默认值: json最大字符数:8192 |
html | boolean | 否 | output=html 的别名;不能与 output=json/md 或 json_restrictor 同传。 默认值: false |
json_restrictor | string | 否 | 选择 content 字段:逗号分隔路径、索引、半开切片 [0:3]、[]、.{嵌套,字段};最多 128 项、16 层;缺失字段省略;追问须保留 subsequent_request_token,不支持 HTML。 最大字符数:8192 results[].{title,text,links},subsequent_request_token |
zero_trace | boolean | 否 | 不保存问题和响应正文,仍保留计费及运行元数据;默认 false。 默认值: false |
no_cache | boolean | 否 | 兼容选项,无论取值均实时查询,使用正常计费规则。 默认值: false |
仅 query 必填。不使用的参数请省略;未知字段、null、类型错误和互斥组合在扣费前拒绝。coordinates 必须包含数字 latitude(−90 至 90)和 longitude(−180 至 180)。uule 不能与 location、coordinates 同传。output=html 或 html=true 不能搭配 json_restrictor;html=true 不能搭配 output=json/md。字段筛选只改变响应展示,不改变计费。
请求示例
curl "$GOANYAPI_API_ORIGIN/api/v1/google-ai-mode" \
-X POST -H "Authorization: Bearer $GOANYAPI_API_KEY" \
-H "Content-Type: application/json" \
--data '{"query":"What is x.com","country":"us","language":"en"}'继续追问
追问须使用 JSON 输出(省略 output 或设为 json,html 省略或设 false)。首次传 continuable=true,从 result.content.subsequent_request_token(或 search_parameters.subsequent_request_token)读取令牌;下一次 POST 携带令牌和新 query,可同时传 continuable。保持最初的 country/language/device/location/coordinates/uule,省略的条件从令牌恢复,改变条件会拒绝。令牌仅当前账户可用,从首次请求起最多有效 15 分钟,会话可能提前失效;失效后重新传 continuable=true 开始会话。每次完成的追问独立计费;不可使用 next_page_token 代替追问令牌,使用 json_restrictor 时须保留追问令牌字段。
响应字段
| 字段 | 说明 |
|---|---|
data.endpoint | google-ai-mode |
data.query | 提交的条件,不回显会话凭证。 |
data.costCredits | 按当前数据库配置实际扣除的积分。 |
data.remainingCredits | 剩余积分。 |
data.result.format | json / md / html+br+base64 |
data.result.content | JSON 对象、Markdown 字符串或 Brotli 压缩的 Base64 原文字符串。 |
data.result.content.results[].address | 实际返回的 address 业务值,可能为空、null 或缺失。 |
data.result.content.results[].category | 实际返回的 category 业务值,可能为空、null 或缺失。 |
data.result.content.results[].coordinates | 经纬度,零值原样保留。 |
data.result.content.results[].description | 实际返回的 description 业务值,可能为空、null 或缺失。 |
data.result.content.results[].id | 实际返回的 id 业务值,可能为空、null 或缺失。 |
data.result.content.results[].latitude | 实际返回的 latitude 业务值,可能为空、null 或缺失。 |
data.result.content.results[].links | 引用数组,包含 title 和 url;不是页面分享地址。 |
data.result.content.results[].longitude | 实际返回的 longitude 业务值,可能为空、null 或缺失。 |
data.result.content.results[].name | 实际返回的 name 业务值,可能为空、null 或缺失。 |
data.result.content.results[].phone | 实际返回的 phone 业务值,可能为空、null 或缺失。 |
data.result.content.results[].position | 实际返回的 position 业务值,可能为空、null 或缺失。 |
data.result.content.results[].rank | 实际返回的 rank 业务值,可能为空、null 或缺失。 |
data.result.content.results[].rating | 实际返回的 rating 业务值,可能为空、null 或缺失。 |
data.result.content.results[].rating_max | 实际返回的 rating_max 业务值,可能为空、null 或缺失。 |
data.result.content.results[].rating_source | 实际返回的 rating_source 业务值,可能为空、null 或缺失。 |
data.result.content.results[].review_count | 实际返回的 review_count 业务值,可能为空、null 或缺失。 |
data.result.content.results[].snippet | 实际返回的 snippet 业务值,可能为空、null 或缺失。 |
data.result.content.results[].text | 回答正文。 |
data.result.content.results[].thumbnail | 实际返回的 thumbnail 业务值,可能为空、null 或缺失。 |
data.result.content.results[].title | 回答标题,保存示例为 AI Mode。 |
data.result.content.results[].type | 实际返回的 type 业务值,可能为空、null 或缺失。 |
data.result.content.results[].url | 结果 URL,可能为空,不补造分享地址。 |
data.result.content.results[].website | 实际返回的 website 业务值,可能为空、null 或缺失。 |
data.result.content.serp_features[] | 提取的回答特征,可包含 id、engine、type、title、text、items、links、source_result_ids、position、confidence、extracted_at、data_cid、live_busyness、popular_times;正文与引用可能和 results 重复。 |
data.result.content.search_parameters | 返回的 query、engine、operation、type、country、language、device、location、coordinates、uule、image_url、continuable、feature_available、pagination_limited、pagination_reason。 |
data.result.content.has_next_page / next_page_token | 返回的分页元数据;本接口不接收翻页令牌,不可与追问令牌混用。 |
data.result.content.subsequent_request_token | 账户绑定的不透明追问令牌,也可能出现在 search_parameters;为空表示不可用。 |
业务字段可能为 null、空值或缺失;保留所有记录及零值。标题为 AI Mode、URL 为空均是有效数据,不补造页面 URL,也不因此判断请求失败。AI 生成的结论请结合引用核对。
本地保存的响应示例
以下使用提供的真实快照;计费字段见上表,真实调用时按当前账户及价格返回。查看示例不发起实时请求。
{
"code": "ok",
"message": "Saved example response",
"data": {
"endpoint": "google-ai-mode",
"query": {
"query": "What is x.com"
},
"result": {
"format": "json",
"content": {
"has_next_page": false,
"next_page_token": "",
"results": [
{
"address": "",
"category": "",
"description": "",
"id": "",
"name": "",
"phone": "",
"rating_source": "",
"snippet": "",
"thumbnail": "",
"url": "",
"website": "",
"latitude": 0,
"longitude": 0,
"position": 0,
"rank": 0,
"rating": 0,
"rating_max": 0,
"review_count": 0,
"coordinates": {
"latitude": 0,
"longitude": 0
},
"links": [
{
"title": "Business Insider",
"url": "https://www.businessinsider.com/history-behind-elon-musk-x-brand-that-may-replace-twitter-2023-7"
},
{
"title": "X.com",
"url": "https://x.com"
}
],
"text": "X.com is the official domain name and corporate identity for the social media platform formerly known as Twitter. What it is Today The Platform: It is the web address and brand for Elon Musk's microblogging and social networking site, which dropped the classic blue bird logo and name in July 2023. The \"Everything App\" Vision: Musk uses X as the foundation for a broader visionan all-in-one platform intended to blend social media, messaging, video, and future financial/shopping services. The Parent Company: Twitter was folded into X Corp., a private corporation owned by Musk. A Brief History of the Name 1999 (Online Banking): The name actually dates back to 1999, when Elon Musk co-founded X.com as an online financial services and banking startup. The PayPal Merger: X.com merged with a competitor named Confinity in 2000, and the combined company was eventually renamed PayPal. The Reacquisition: Musk bought back the x.com domain name from PayPal in 2017, noting it had strong sentimental value. The Twitter Takeover: After purchasing Twitter in late 2022 for $44 billion, Musk gradually transitioned the service over to the historic X.com brand. You can access the platform directly at X.com. Are you looking for information on how to use a specific feature on X, or are you trying to recover/manage an account there?",
"title": "AI Mode",
"type": "ai_summary"
}
],
"search_parameters": {
"continuable": false,
"coordinates": {
"latitude": 0,
"longitude": 0
},
"country": "us",
"device": "desktop",
"engine": "google",
"feature_available": true,
"image_url": "",
"language": "en",
"location": "",
"operation": "google_ai_mode",
"pagination_limited": false,
"pagination_reason": "",
"query": "What is x.com",
"subsequent_request_token": "",
"type": "search",
"uule": ""
},
"serp_features": [
{
"confidence": 0.75,
"data_cid": "",
"engine": "google",
"extracted_at": "2026-11-10T04:31:18.371Z",
"id": "f_ce11420d51cefb66",
"items": [],
"links": [
{
"title": "Business Insider",
"url": "https://www.businessinsider.com/history-behind-elon-musk-x-brand-that-may-replace-twitter-2023-7"
},
{
"title": "X.com",
"url": "https://x.com"
}
],
"live_busyness": {
"busyness_percent": 0,
"day": "",
"description": "",
"hour": 0
},
"popular_times": {},
"position": {
"absolute": 1
},
"source_result_ids": [],
"text": "X.com is the official domain name and corporate identity for the social media platform formerly known as Twitter. What it is Today The Platform: It is the web address and brand for Elon Musk's microblogging and social networking site, which dropped the classic blue bird logo and name in July 2023. The \"Everything App\" Vision: Musk uses X as the foundation for a broader visionan all-in-one platform intended to blend social media, messaging, video, and future financial/shopping services. The Parent Company: Twitter was folded into X Corp., a private corporation owned by Musk. A Brief History of the Name 1999 (Online Banking): The name actually dates back to 1999, when Elon Musk co-founded X.com as an online financial services and banking startup. The PayPal Merger: X.com merged with a competitor named Confinity in 2000, and the combined company was eventually renamed PayPal. The Reacquisition: Musk bought back the x.com domain name from PayPal in 2017, noting it had strong sentimental value. The Twitter Takeover: After purchasing Twitter in late 2022 for $44 billion, Musk gradually transitioned the service over to the historic X.com brand. You can access the platform directly at X.com. Are you looking for information on how to use a specific feature on X, or are you trying to recover/manage an account there?",
"title": "AI Mode",
"type": "ai_summary"
}
],
"subsequent_request_token": ""
}
}
}
}隐私与错误
zero_trace=true 不保存问题和响应正文,仍保留计费与运行元数据;不代表匿名计费或删除历史请求。令牌不写入用量元数据。400 invalid_params:正文或会话令牌错误;401:需要鉴权;402 insufficient_credits:积分不足;429:限流;502 request_failed:搜索或响应失败;504 request_timeout:请求超时;503 service_not_configured:服务或单价不可用。失败不扣费,重新发送已完成的请求是独立计费请求。