> For the complete documentation index, see [llms.txt](https://developers.oxylabs.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.oxylabs.io/api-reference/cn/zhuan-yong-zhua-qu-qi/llm-yu-ai-zhua-qu-qi.md).

# LLM 与 AI 抓取器

Web API 的 ChatGPT、Gemini 和 Perplexity 抓取器端点参考。仅支持异步，并包含参数和响应字段。

<table><thead><tr><th width="168.5">爬虫</th><th>端点</th></tr></thead><tbody><tr><td><a href="#chatgpt">ChatGPT</a></td><td><code>/chatgpt</code></td></tr><tr><td><a href="#gemini">Gemini</a></td><td><code>/gemini</code></td></tr><tr><td><a href="#perplexity">Perplexity</a></td><td><code>/perplexity</code></td></tr></tbody></table>

### ChatGPT

#### `POST /v1/async/scrape/chatgpt`

返回 ChatGPT 对问题的回答。

**模式：** `异步`, `批处理`

<table><thead><tr><th width="139.5">名称</th><th width="104.5">类型</th><th width="98">是否必填</th><th>描述</th></tr></thead><tbody><tr><td><code>query</code></td><td>字符串</td><td>是</td><td>要提问的问题</td></tr><tr><td><code>search</code></td><td>布尔值</td><td>否</td><td><code>true</code> 允许浏览当前信息并附带引用。 <code>false</code> 仅基于训练数据回答。无中立默认值</td></tr><tr><td><code>output</code></td><td>字符串数组</td><td>否</td><td>返回格式： <code>Markdown</code>, <code>HTML</code>, <code>JSON</code>, <code>截图</code>。默认值 <code>["html"]</code>. <code>JSON</code> 返回解析后的字段。 <code>截图</code> 需要 <code>run_js: true</code></td></tr><tr><td><code>JSON</code></td><td>对象</td><td>否</td><td>自定义提取： <code>{"prompt": string}</code> 或 <code>{"schema": object}</code>，且不能同时使用。会覆盖内置解析器</td></tr><tr><td><code>location</code></td><td>字符串</td><td>否</td><td>用于抓取的两字母国家代码，例如 <code>DE</code></td></tr><tr><td><code>device</code></td><td>字符串</td><td>否</td><td><code>桌面端</code> （默认）或 <code>移动端</code></td></tr><tr><td><code>callback_url</code></td><td>字符串</td><td>否</td><td>任务完成后的 Webhook URL。仅限异步。格式错误的 URL 会被拒绝，并返回 <code>400</code></td></tr><tr><td><code>storage</code></td><td>对象</td><td>否</td><td>将结果传送到 bucket，而不是响应： <code>{"type": string, "url": string}</code>. <code>type</code> 是 <code>s3</code>, <code>s3_gzip</code>, <code>s3_compatible</code>, <code>gcs</code>，或 <code>tos</code>。仅限异步。 <code>url</code> 不会被验证</td></tr></tbody></table>

**响应字段** – `results[].json`

<table><thead><tr><th width="141.5">字段</th><th width="530.5">描述</th><th width="92">类型</th></tr></thead><tbody><tr><td><code>prompt</code></td><td>发送给 ChatGPT 的问题</td><td>字符串</td></tr><tr><td><code>response_text</code></td><td>以纯文本回答</td><td>字符串</td></tr><tr><td><code>markdown_text</code></td><td>以 Markdown 回答</td><td>字符串</td></tr><tr><td><code>markdown_json</code></td><td>以结构化 Markdown 元素回答</td><td>数组</td></tr><tr><td><code>citations</code></td><td>答案中引用的来源：title、url、text</td><td>数组</td></tr><tr><td><code>links</code></td><td>答案中的内联链接：url、text</td><td>数组</td></tr><tr><td><code>shopping_products</code></td><td>ChatGPT 推荐的产品： <code>title</code>, <code>url</code>, <code>price</code>, <code>price_str</code>, <code>currency</code>, <code>merchant</code>, <code>badge</code>, <code>description</code>, <code>rating</code>, <code>thumbnail</code>, <code>image_page_title</code>, <code>image_page_url</code>, <code>citations</code> (<code>source</code>, <code>title</code>, <code>url</code>）以及 <code>offers</code> (<code>merchant</code>, <code>price</code>, <code>price_str</code>, <code>currency</code>, <code>url</code>, <code>details</code>).</td><td>数组</td></tr><tr><td><code>raw_response</code></td><td>ChatGPT 的原始流式响应</td><td>字符串数组</td></tr></tbody></table>

相同请求的响应可能不同。没有 Realtime 路径。

解析后的字段遵循 ChatGPT 当前的布局，并且会随着 ChatGPT 的变化而改变。

### Gemini

#### `POST /v1/async/scrape/gemini`

返回 Gemini 对问题的回答。

**模式：** `异步`, `批处理`

<table><thead><tr><th width="149">名称</th><th width="103.5">类型</th><th width="99.5">是否必填</th><th>描述</th></tr></thead><tbody><tr><td><code>query</code></td><td>字符串</td><td>是</td><td>要提问的问题</td></tr><tr><td><code>output</code></td><td>字符串数组</td><td>否</td><td>返回格式： <code>Markdown</code>, <code>HTML</code>, <code>JSON</code>, <code>截图</code>。默认值 <code>["html"]</code>. <code>JSON</code> 返回解析后的字段。 <code>截图</code> 需要 <code>run_js: true</code></td></tr><tr><td><code>JSON</code></td><td>对象</td><td>否</td><td>自定义提取： <code>{"prompt": string}</code> 或 <code>{"schema": object}</code>，且不能同时使用。会覆盖内置解析器</td></tr><tr><td><code>location</code></td><td>字符串</td><td>否</td><td>用于抓取的两字母国家代码，例如 <code>DE</code></td></tr><tr><td><code>device</code></td><td>字符串</td><td>否</td><td><code>桌面端</code> （默认）或 <code>移动端</code></td></tr><tr><td><code>callback_url</code></td><td>字符串</td><td>否</td><td>任务完成后的 Webhook URL。仅限异步。格式错误的 URL 会被拒绝，并返回 <code>400</code></td></tr><tr><td><code>storage</code></td><td>对象</td><td>否</td><td>将结果传送到 bucket，而不是响应： <code>{"type": string, "url": string}</code>. <code>type</code> 是 <code>s3</code>, <code>s3_gzip</code>, <code>s3_compatible</code>, <code>gcs</code>，或 <code>tos</code>。仅限异步。 <code>url</code> 不会被验证</td></tr></tbody></table>

**响应字段** – `results[].json`

<table><thead><tr><th width="181.546875">字段</th><th width="478.06640625">描述</th><th width="86.390625">类型</th></tr></thead><tbody><tr><td><code>prompt</code></td><td>发送给 Gemini 的问题</td><td>字符串</td></tr><tr><td><code>response_text</code></td><td>以纯文本回答</td><td>字符串</td></tr><tr><td><code>markdown_text</code></td><td>以 Markdown 回答</td><td>字符串</td></tr><tr><td><code>citations</code></td><td>答案中引用的来源： <code>title</code>, <code>url</code>, <code>text</code>, <code>description</code>。仅在 Gemini 搜索了网页时</td><td>数组</td></tr><tr><td><code>additional_results</code></td><td><p><code>sources_results</code> - Gemini 在回答时查阅的网页（<code>url</code>，以及可选的 <code>title</code>). </p><p><code>images_results</code> - 答案中显示的图片（<code>title</code>, <code>image_url</code>，以及可选的 <code>image_from_url</code> - 图片来源页面）。</p><p><code>videos_results</code> - 答案中显示的 YouTube 视频（<code>url</code>, <code>title</code>，以及可选的 <code>thumbnail</code>).</p></td><td>对象</td></tr><tr><td><code>related_queries</code></td><td>Gemini 在答案下方建议的后续问题</td><td>字符串数组</td></tr><tr><td><code>links</code></td><td>答案中的内联链接： <code>url</code>, <code>text</code>. <code>text</code> 如果没有文本，可以为空</td><td>数组</td></tr><tr><td><code>model</code></td><td>作答的模型</td><td>字符串</td></tr><tr><td><code>raw_response</code></td><td>Gemini 的原始响应</td><td>字符串数组</td></tr></tbody></table>

相同请求的响应可能不同。没有 Realtime 路径。

### Perplexity

#### `POST /v1/async/scrape/perplexity`

返回 Perplexity 对问题的回答及其引用来源。

**模式：** `异步`, `批处理`

<table><thead><tr><th width="139.5">名称</th><th width="94.5">类型</th><th width="99.5">是否必填</th><th>描述</th></tr></thead><tbody><tr><td><code>query</code></td><td>字符串</td><td>是</td><td>要提问的问题</td></tr><tr><td><code>output</code></td><td>字符串数组</td><td>否</td><td>返回格式： <code>Markdown</code>, <code>JSON</code>。默认值 <code>JSON</code>，它会返回解析后的字段。</td></tr><tr><td><code>JSON</code></td><td>对象</td><td>否</td><td>自定义提取： <code>{"prompt": string}</code> 或 <code>{"schema": object}</code>，且不能同时使用。会覆盖内置解析器</td></tr><tr><td><code>location</code></td><td>字符串</td><td>否</td><td>用于抓取的两字母国家代码，例如 <code>DE</code></td></tr><tr><td><code>device</code></td><td>字符串</td><td>否</td><td><code>桌面端</code> （默认）或 <code>移动端</code></td></tr><tr><td><code>callback_url</code></td><td>字符串</td><td>否</td><td>任务完成后的 Webhook URL。仅限异步。格式错误的 URL 会被拒绝，并返回 <code>400</code></td></tr><tr><td><code>storage</code></td><td>对象</td><td>否</td><td>将结果传送到 bucket，而不是响应： <code>{"type": string, "url": string}</code>. <code>type</code> 是 <code>s3</code>, <code>s3_gzip</code>, <code>s3_compatible</code>, <code>gcs</code>，或 <code>tos</code>。仅限异步。 <code>url</code> 不会被验证</td></tr></tbody></table>

**响应字段** – `results[].json`

<table><thead><tr><th width="178">字段</th><th width="489.5">描述</th><th width="95">类型</th></tr></thead><tbody><tr><td><code>prompt_query</code></td><td>发送给 Perplexity 的问题</td><td>字符串</td></tr><tr><td><code>answer_results</code></td><td>答案</td><td>数组</td></tr><tr><td><code>answer_results_md</code></td><td>以 Markdown 回答</td><td>字符串</td></tr><tr><td><code>additional_results</code></td><td><code>sources_results</code>：Perplexity 用作来源的页面（<code>title</code>, <code>url</code>)</td><td>对象</td></tr><tr><td><code>related_queries</code></td><td>Perplexity 建议的相关查询</td><td>字符串数组</td></tr><tr><td><code>model</code></td><td>作答的模型</td><td>字符串</td></tr><tr><td><code>raw_response</code></td><td>Perplexity 的原始响应</td><td>字符串数组</td></tr></tbody></table>

相同请求的响应可能不同。没有 Realtime 路径。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developers.oxylabs.io/api-reference/cn/zhuan-yong-zhua-qu-qi/llm-yu-ai-zhua-qu-qi.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
