API 文档

Google AI Overview API

Google AI Overview 摘要、引用、参数和完整响应字段。

测试 API

获取 Google 搜索中的 AI Overview 摘要和引用链接。同一个请求返回结果,无需任务 ID、轮询或回调。

测试 Google AI Overview API →

接口与鉴权

POST https://api.goanyapi.com/api/v1/google-ai-overview
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

当前配置下,每次成功请求消耗 3 积分。

完成的成功查询按当前配置计费,包括没有摘要、feature_available=false 的结果。参数错误、鉴权失败和运行失败不扣费;重复提交已完成请求会作为新的请求计费。

JSON 请求参数

参数类型必填说明与约束
querystring否搜索词,最多 8192 UTF-8 字节;未传 page_token 时必填,令牌保留原始查询。
最大字符数:8192
how do solar panels work
countrystring否两位国家代码,例如 us、gb;省略使用搜索默认值。
最大字符数:2
^[a-zA-Z]{2}$
us
languagestring否语言代码,例如 en、zh-CN;省略使用搜索默认值。
最大字符数:20
^[A-Za-z]{2,3}(?:-[A-Za-z]{2,4})?$
en
devicestring否设备:desktop、mobile、tablet。
desktop / mobile / tablet
最大字符数:8192
page_tokenstring否兼容 Google 搜索响应提供的 ai_overview.page_token(如有),须在一分钟内使用并保持原查询、国家、语言和设备条件;不是 AI Mode 追问令牌。一般直接传 query 即可。
最大字符数:65536
outputstring否响应格式:json(默认)、md(Markdown)、html(Brotli 压缩后 Base64 原文);HTML 不能使用 json_restrictor。
json / md / html
默认值:json
最大字符数:8192
htmlboolean否output=html 的别名;不能与 output=json/md 或 json_restrictor 同传。
默认值:false
json_restrictorstring否选择 content 字段:逗号分隔路径、索引、半开切片 [0:3]、[]、.{嵌套,字段};最多 128 项、16 层;缺失字段省略,不支持 HTML。
最大字符数:8192
results[].{title,text,links},search_parameters.feature_available
zero_traceboolean否不保存问题和响应正文,仍保留计费及运行元数据;默认 false。
默认值:false
no_cacheboolean否兼容选项,无论取值均实时查询,使用正常计费规则。
默认值:false

query 和 page_token 至少提供一个;常规查询直接使用 query。query 最多 8192 UTF-8 字节。不要传未知字段、null 或错误类型。output=html 或 html=true 不能与 json_restrictor 组合;html=true 不能与 output=json/md 组合。省略可选参数即可使用默认行为。字段筛选不改变计费规则。

请求示例

curl "$GOANYAPI_API_ORIGIN/api/v1/google-ai-overview" \
  -X POST -H "Authorization: Bearer $GOANYAPI_API_KEY" \
  -H "Content-Type: application/json" \
  --data '{"query":"how do solar panels work","country":"us","language":"en","device":"desktop"}'

短效 page_token

如兼容 Google 搜索响应提供 ai_overview.page_token,可将其提交给本接口,须在一分钟内使用。令牌保留原始 query、country、language、device 条件;不要修改这些条件。并非每次搜索或所有 SERP 版本都会返回令牌,没有令牌时直接传 query。page_token 不是 AI Mode 的 subsequent_request_token,也不是 next_page_token,不支持会话追问。

响应字段

字段说明
data.endpointgoogle-ai-overview
data.query提交的查询条件,不回显 page_token。
data.costCredits按当前数据库配置实际扣除的积分。
data.remainingCredits剩余积分。
data.result.formatjson / md / html+br+base64
data.result.contentJSON 对象、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 Overview。
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、country、language、device、engine、operation、type、page_token、feature_available、pagination_limited 和 pagination_reason。
data.result.content.has_next_page / next_page_token返回的分页元数据,不等同于 ai_overview.page_token;本接口不接受 next_page_token 参数。
data.result.content.ai_overview.page_token可选的短效摘要检索令牌,可能为空、null 或缺失;一分钟内有效,不是会话追问令牌。

业务值允许为空字符串、null、空数组或缺失,保留全部记录和零值。不补造标题、回答或页面 URL。feature_available=false 是正常的成功结果;空字段不代表请求失败。摘要内容请结合引用核对。

有摘要的真实示例

示例保存在本地,预览不发送实时请求。实际调用的 costCredits、remainingCredits 由当前配置和账户余额提供。

{
  "code": "ok",
  "message": "Saved example response",
  "data": {
    "endpoint": "google-ai-overview",
    "query": {
      "query": "how do solar panels work",
      "country": "us",
      "language": "en",
      "device": "desktop"
    },
    "result": {
      "format": "json",
      "content": {
        "ai_overview": {
          "page_token": ""
        },
        "has_next_page": false,
        "next_page_token": "",
        "results": [
          {
            "address": "",
            "category": "",
            "coordinates": {
              "latitude": 0,
              "longitude": 0
            },
            "description": "",
            "id": "",
            "latitude": 0,
            "links": [
              {
                "title": "EnergySage",
                "url": "https://www.energysage.com/solar/solar-panels-work"
              },
              {
                "title": "Reddit · r/explainlikeimfive",
                "url": "https://www.reddit.com/r/explainlikeimfive/comments/13ycao0/eli5_how_the_hell_do_solar_panels_work"
              },
              {
                "title": "YouTube · 3D Requiem",
                "url": "https://www.youtube.com/watch?v=M7sgO9OI8D0"
              },
              {
                "title": "National Grid Group",
                "url": "https://www.nationalgrid.com/stories/energy-explained/how-does-solar-power-work"
              },
              {
                "title": "How do solar panels work? - Richard Komp, Video, watch on YouTube",
                "url": "https://www.youtube.com/watch?t=8&v=xKxrkht7CpY"
              }
            ],
            "longitude": 0,
            "name": "",
            "phone": "",
            "position": 0,
            "rank": 0,
            "rating": 0,
            "rating_max": 0,
            "rating_source": "",
            "review_count": 0,
            "snippet": "",
            "text": "Solar panels convert sunlight into usable electricity through a process called the photovoltaic effect. The Science Inside a Solar Cell Silicon Layers: Each solar panel is made up of many individual solar cells built from layers of silicon. P-N Junction: The top layer is N-type silicon (charged with extra electrons), and the bottom layer is P-type silicon (containing vacant spaces called \"holes\"). Where they meet, an internal electric field forms. Knocking Electrons Loose: When sunlight hits the cell, light particles (photons) transfer energy to the silicon and knock electrons free from their atomic bonds. Creating a Current: The internal electric field forces these free electrons to flow in one direction",
            "thumbnail": "",
            "title": "AI Overview",
            "type": "ai_summary",
            "url": "",
            "website": ""
          }
        ],
        "search_parameters": {
          "country": "us",
          "device": "desktop",
          "engine": "google",
          "feature_available": true,
          "language": "en",
          "operation": "google_ai_overview",
          "page_token": "",
          "pagination_limited": false,
          "pagination_reason": "",
          "query": "how do solar panels work",
          "type": "search"
        },
        "serp_features": [
          {
            "confidence": 0.75,
            "data_cid": "",
            "engine": "google",
            "extracted_at": "2026-11-10T08:24:22.618Z",
            "id": "f_ca68b8670a4968fe",
            "items": [],
            "links": [
              {
                "title": "EnergySage",
                "url": "https://www.energysage.com/solar/solar-panels-work"
              },
              {
                "title": "Reddit · r/explainlikeimfive",
                "url": "https://www.reddit.com/r/explainlikeimfive/comments/13ycao0/eli5_how_the_hell_do_solar_panels_work"
              },
              {
                "title": "YouTube · 3D Requiem",
                "url": "https://www.youtube.com/watch?v=M7sgO9OI8D0"
              },
              {
                "title": "National Grid Group",
                "url": "https://www.nationalgrid.com/stories/energy-explained/how-does-solar-power-work"
              },
              {
                "title": "How do solar panels work? - Richard Komp, Video, watch on YouTube",
                "url": "https://www.youtube.com/watch?t=8&v=xKxrkht7CpY"
              }
            ],
            "live_busyness": {
              "busyness_percent": 0,
              "day": "",
              "description": "",
              "hour": 0
            },
            "popular_times": {},
            "position": {
              "absolute": 1
            },
            "source_result_ids": [
              "s_169daea1d6724177",
              "s_5e933f5eb801b623",
              "s_7bdf9a5559f4e045"
            ],
            "text": "Solar panels convert sunlight into usable electricity through a process called the photovoltaic effect. The Science Inside a Solar Cell Silicon Layers: Each solar panel is made up of many individual solar cells built from layers of silicon. P-N Junction: The top layer is N-type silicon (charged with extra electrons), and the bottom layer is P-type silicon (containing vacant spaces called \"holes\"). Where they meet, an internal electric field forms. Knocking Electrons Loose: When sunlight hits the cell, light particles (photons) transfer energy to the silicon and knock electrons free from their atomic bonds. Creating a Current: The internal electric field forces these free electrons to flow in one direction",
            "title": "AI Overview",
            "type": "ai_summary"
          }
        ]
      }
    }
  }
}

成功但无摘要的真实示例

示例保存在本地,预览不发送实时请求。实际调用的 costCredits、remainingCredits 由当前配置和账户余额提供。

{
  "code": "ok",
  "message": "Saved example response",
  "data": {
    "endpoint": "google-ai-overview",
    "query": {
      "query": "site:example.com inurl:goanyapi-overview-no-result-20261110",
      "country": "us",
      "language": "en",
      "device": "desktop"
    },
    "result": {
      "format": "json",
      "content": {
        "ai_overview": {
          "page_token": ""
        },
        "has_next_page": false,
        "next_page_token": "",
        "results": [],
        "search_parameters": {
          "country": "us",
          "device": "desktop",
          "engine": "google",
          "feature_available": false,
          "language": "en",
          "operation": "google_ai_overview",
          "page_token": "",
          "pagination_limited": false,
          "pagination_reason": "",
          "query": "site:example.com inurl:goanyapi-overview-no-result-20261110",
          "type": "search"
        },
        "serp_features": []
      }
    }
  }
}

隐私与错误

zero_trace=true 不存储查询和响应内容,保留计费及必要运行元数据;不会删除历史记录。page_token 不写入用量元数据。400 invalid_params:参数或短效令牌无效;401:需要鉴权;402 insufficient_credits:余额不足;429:限流;502 request_failed:请求或响应失败;504 request_timeout:请求超时;503 service_not_configured:服务或价格未配置。失败不扣费。