# 查询 AI 回答引擎，以了解 GEO/AEO 可见度。

**API:** Data API

**Endpoint:** `POST /v1/beta/oxylabs/ai-search`

**Tags:** Oxylabs

使用 source google_search 或 google_ai_mode 以及文档记载的其他请求字段，运行同步的 AI 辅助搜索。本端点不接受 chatgpt、gemini 或 perplexity 作为同步来源。

### 计费参考

- 计量方式：按成功请求的固定成本计费。
- 参考请求估算：0.00145 美元。
- 参考客户倍率：1.45。不得对已结算的客户金额再次应用。

仅供参考的元数据，不是账户报价、保证价格或消费上限。资源额度不同于 Felo 额度。最终扣费以 Felo 计费记录为准。

## Base URL

- `https://openapi.felo.ai`

## Authentication

- `FeloBearerAuth` (http bearer, bearer format Felo API Key)
- `FeloApiKey` (apiKey in header `X-API-Key`)

## Request body

Required: **yes**

### application/json

Schema:

```json
{
  "type": "object",
  "description": "Google 答案引擎的直通请求体。`source` 选择引擎；`query`、`render`、`parse` 和 `geo_location` 是 Google 来源所需的参数。其他上游参数按原样透传。",
  "additionalProperties": true,
  "properties": {
    "source": {
      "type": "string",
      "enum": [
        "google_search",
        "google_ai_mode"
      ],
      "description": "要查询的 Google AI 答案引擎。`google_search` 返回 Google AI Overviews；`google_ai_mode` 返回 Google AI Mode。如需查询 ChatGPT/Gemini/Perplexity，请改用异步端点 `post_oxylabs_llm`。",
      "example": "google_search"
    },
    "query": {
      "type": "string",
      "description": "搜索查询。`google_search` 和 `google_ai_mode` 必填。",
      "example": "best noise cancelling headphones 2026"
    },
    "render": {
      "type": "string",
      "enum": [
        "html"
      ],
      "description": "对于 `google_search` 和 `google_ai_mode`，设为 \"html\" 可在解析前渲染页面。",
      "example": "html"
    },
    "parse": {
      "type": "boolean",
      "description": "返回结构化、已解析的结果，而非原始输出。建议所有来源都启用。",
      "example": true
    },
    "geo_location": {
      "type": "string",
      "description": "查询的国家/地区级地理位置，例如 \"United States\"。",
      "example": "United States"
    }
  },
  "required": [
    "source"
  ]
}
```

Example:

```json
{
  "source": "google_ai_mode",
  "query": "best noise cancelling headphones 2026",
  "parse": true,
  "render": "html",
  "geo_location": "United States"
}
```

## Responses

### 200 — 查询成功完成。`results[]` 每个查询保存一条结果。`content` 内的解析结构因来源而异（参见属性说明）；下面的示例展示 `google_search`（Google AI 概览）的结构。

Headers:
- `X-Request-Id` (string) — 联系 Felo 支持时需提供的请求标识符。

**application/json**

Schema: object

```json
{
  "type": "object",
  "properties": {
    "results": {
      "type": "array",
      "description": "每个查询一条。Realtime 单次查询只返回一个结果，该结果即为计费单位。",
      "items": {
        "type": "object",
        "properties": {
          "content": {
            "type": "object",
            "description": "已解析的答案负载。结构因 Google 来源而异：\n- `google_search` → `content.results.ai_overviews[]`，包含 `answer_text` 和 `references[]{source, url}`（如下所示）。\n- `google_ai_mode` → `content.citations[]{text, urls[]}`。",
            "properties": {
              "results": {
                "type": "object",
                "description": "Google 类型的已解析结果容器。",
                "properties": {
                  "ai_overviews": {
                    "type": "array",
                    "description": "为该查询返回的 Google AI Overviews。",
                    "items": {
                      "type": "object",
                      "properties": {
                        "answer_text": {
                          "type": "array",
                          "description": "AI 生成的答案，拆分为若干片段，片段可能带有行内引用。",
                          "items": {
                            "type": "object",
                            "properties": {
                              "fragments": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "references": {
                                      "type": "array",
                                      "items": {}
                                    }
                                  }
                                }
                              }
                            }
                          }
                        },
                        "references": {
                          "type": "array",
                          "description": "此概览引用的来源。",
                          "items": {
                            "type": "object",
                            "properties": {
                              "source": {
                                "type": "string"
                              },
                              "url": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
```

### 400 — 无法处理该请求。请检查请求参数。

### 401 — 需要有效的 Felo API 密钥。

### 402 — 由于未满足计费要求，请求无法继续。

### 403 — 该账户无权执行此操作。

### 429 — 已达到请求或支出限额。

### 502 — 服务无法完成该请求。

### 503 — API 或计费服务暂时不可用。

### 504 — 服务在处理请求时超时。

### default — 错误响应；上游透传响应可能采用提供方格式

**application/json**

Schema:

```json
{}
```
