> 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-targets/cn/llm-yu-ai.md).

# LLM 与 AI

Oxylabs LLM 抓取器可让你向领先的 AI 平台提交提示，并接收结构化和已解析的响应。支持的目标：

* [ChatGPT](/api-targets/cn/llm-yu-ai/chatgpt.md) – 源： `chatgpt`
* [Gemini](/api-targets/cn/llm-yu-ai/gemini.md) – 源： `gemini`
* [Perplexity](/api-targets/cn/llm-yu-ai/perplexity.md) – 源： `perplexity`

{% hint style="info" %}
**注意：** 默认情况下，所有 LLM 目标都启用 JavaScript 渲染。请不要在你的请求负载中包含 `render` 。
{% endhint %}

### 请求示例

所有 LLM 目标大多使用相同的请求参数，主要区别在于最大提示长度。

```json
{
  "source": "chatgpt",
  "prompt": "best supplements for better sleep",
  "parse": true,
  "geo_location": "United States"
}
```

<table><thead><tr><th width="195.5">参数</th><th width="452.5">描述</th><th width="117">类型</th></tr></thead><tbody><tr><td><mark style="background-color:green;"><strong><code>source</code></strong></mark></td><td>要抓取的 LLM 目标。允许的值： <code>chatgpt</code>, <code>perplexity</code>, <code>gemini</code>.</td><td>字符串</td></tr><tr><td><mark style="background-color:green;"><strong><code>prompt</code></strong></mark></td><td>要提交的查询或提示。最大长度：对于 <code>chatgpt</code>为 8,000 个字符；对于 <code>perplexity</code> 和 <code>gemini</code>.</td><td>字符串</td></tr><tr><td><code>parse</code></td><td>设置为 <code>true</code> 以接收结构化 JSON 响应。</td><td>布尔值</td></tr><tr><td><code>geo_location</code></td><td>用于路由请求的地理位置（例如， <code>"United States"</code>).</td><td>字符串</td></tr><tr><td><code>callback_url</code></td><td>作业完成后将结果投递到的 URL。</td><td>字符串</td></tr></tbody></table>

&#x20;    \- 必填参数

### 响应

所有 LLM 目标返回相同的顶层数据结构。每个目标特定的已解析内容位于 `results[].content` （请参阅各个目标页面以获取完整字段参考）。

<table><thead><tr><th width="196">字段</th><th width="452">描述</th><th width="114">类型</th></tr></thead><tbody><tr><td><code>job.id</code></td><td>抓取作业的唯一标识符。</td><td>字符串</td></tr><tr><td><code>job.status</code></td><td>作业的当前状态（例如， <code>done</code>).</td><td>字符串</td></tr><tr><td><code>job.source</code></td><td>提交的 <code>source</code> 值。</td><td>字符串</td></tr><tr><td><code>job.parse</code></td><td>提交的 <code>parse</code> 值。</td><td>布尔值</td></tr><tr><td><code>job.prompt</code></td><td>请求中的原始提示。</td><td>字符串</td></tr><tr><td><code>job.geo_location</code></td><td> 请求使用的地理位置。</td><td>字符串</td></tr><tr><td><code>job.created_at</code></td><td>作业创建时间戳（UTC， <code>YYYY-MM-DD HH:MM:SS</code>).</td><td>字符串</td></tr><tr><td><code>job.updated_at</code></td><td>作业更新时间戳</td><td>字符串</td></tr><tr><td><code>results[].job_id</code></td><td>与结果关联的作业 ID。</td><td>字符串</td></tr><tr><td><code>results[].status_code</code></td><td>页面抓取的 HTTP 状态码。</td><td>整数</td></tr><tr><td><code>results[].url</code></td><td>目标 LLM 页面。</td><td>字符串</td></tr><tr><td><code>results[].content</code></td><td>LLM 响应数据。字段因 <a href="/pages/935400779964199a6c00b9c14eabc090904883c7#response-data-by-target">目标而异</a>.</td><td>对象</td></tr></tbody></table>

### 按目标划分的响应数据

下表显示每个 LLM 目标可用的数据字段。&#x20;

|                                                         | [**ChatGPT**](/api-targets/cn/llm-yu-ai/chatgpt.md) | [**Gemini**](/api-targets/cn/llm-yu-ai/gemini.md) | [**Perplexity**](/api-targets/cn/llm-yu-ai/perplexity.md) |
| ------------------------------------------------------- | :-------------------------------------------------: | :-----------------------------------------------: | :-------------------------------------------------------: |
| 提示输入                                                    |                          ✓                          |                         ✓                         |                             ✓                             |
| 已解析输出（JSON）                                             |                          ✓                          |                         ✓                         |                             ✓                             |
| 纯文本响应                                                   |                          ✓                          |                         ✓                         |                             –                             |
| Markdown 输出                                             |                          ✓                          |                         ✓                         |                             ✓                             |
| Markdown JSON 树                                         |                          ✓                          |                         –                         |                             ✓                             |
| <mark style="background-color:yellow;">搜索 / 相关查询</mark> |                          ✓                          |                         –                         |                             ✓                             |
| <mark style="background-color:yellow;">引用 / 来源</mark>   |                          ✓                          |                         ✓                         |                             ✓                             |
| <mark style="background-color:yellow;">购物结果</mark>      |                          ✓                          |                         –                         |                             ✓                             |
| <mark style="background-color:yellow;">广告</mark>        |                          ✓                          |                         –                         |                             –                             |
| 地理位置                                                    |                          ✓                          |                         ✓                         |                             ✓                             |
| 使用的 LLM 模型                                              |                          ✓                          |                         –                         |                             ✓                             |

&#x20;    – 条件式，仅在内容出现在 LLM 的响应中时返回。


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://developers.oxylabs.io/api-targets/cn/llm-yu-ai.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
