> For the complete documentation index, see [llms.txt](https://docs.exoclick.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.exoclick.com/rtb/zh/fa-bu-shang/kai-fang-rtb/pub-open-rtb-2.5-request.md).

# Open RTB 2.5 出价请求

此页面说明如何发起出价请求。

## 建议的出价请求头

* **OpenRTB 版本 HTTP 头：** `x-openrtb-version: 2.5`
* **Keep-Alive HTTP 头：** `Connection: Keep-Alive`
* **内容 JSON：** `Content-Type: application/json`

以下对象应作为 JSON 编码后发送到请求体中：

## 竞价请求对象

| 属性     | 必填？ | 描述                        |
| ------ | --- | ------------------------- |
| 在      | 是   | 竞价类型，第一价格 = 1（整数）         |
| id     | 是   | 唯一竞价请求 ID（字符串）            |
| imp    | 是   | 表示所提供展示位的 Imp 对象数组（对象）。   |
| site   | 是   | 关于发布商网站的详细信息（对象）。         |
| app    | 是   | 关于发布商应用的详细信息（对象）。         |
| device | 是   | 关于将要展示该广告位的用户设备的详细信息（对象）。 |
| user   | 否   | 该设备的人类用户；广告受众（对象）。        |
| ext    | 否   | OpenRTB 扩展的占位符。           |

{% hint style="info" %}
以下对象中只应有一个 `{site, app}` 应出现在每个请求中。
{% endhint %}

## imp

| 属性       | 必填？      | 描述                                                                                   |
| -------- | -------- | ------------------------------------------------------------------------------------ |
| id       | 是        | 此竞价请求中的唯一展示 ID（字符串）                                                                  |
| bidfloor | 否        | 此次展示的最低出价（CPM）/点击出价（CPC）以及账户货币（浮点数）。                                                 |
| banner   | 仅适用于全屏展示 | 一个横幅对象（对象）。                                                                          |
| secure   | 否；推荐 1   | 用于指示该展示是否需要安全的 HTTPS URL 创意素材和标记，其中 0 = 非安全，1 = 安全。若省略，则安全状态未知，但可假定支持非安全 HTTP，可选（整数） |

### imp.banner

| 属性    | 必填？ | 描述                                                   |
| ----- | --- | ---------------------------------------------------- |
| w     | 是   | 横幅的宽度（整数）                                            |
| h     | 是   | 横幅的高度（整数）                                            |
| mimes | 是   | MIME 类型 - image/jpg、image/png、video/mp4 或 image/webp |

### imp.video

| 属性            | 必填？ | 描述                                               |
| ------------- | --- | ------------------------------------------------ |
| mimes         | 是   | 支持的内容 MIME 类型（例如“video/mp4”）（字符串数组）              |
| minduration   | 否   | 视频广告最小时长（秒）（整数)                                  |
| maxduration   | 否   | 视频广告最长时长（秒）（整数)                                  |
| protocols     | 否   | 支持的视频协议数组（整数）                                    |
| linearity     | 否   | 指示该展示是否必须为线性、非线性等。如果未指定，则假定全部允许（整数）              |
| boxingallowed | 否   | 指示是否允许将 4:3 内容以黑边方式放入 16:9 窗口，其中 0 = 否，1 = 是（整数） |
| 位置            | 否   | 屏幕上的广告位置（整数）                                     |
| h             | 否   | 视频播放器宽度，单位为设备无关像素（DIPS）（整数）                      |
| w             | 否   | 视频播放器高度，单位为设备无关像素（DIPS）（整数）                      |
| ext           | 否   | 用于 OpenRTB 交换方特定扩展的占位符（对象）                       |

### imp.video.ext

| 属性   | 必填？ | 描述                                    |
| ---- | --- | ------------------------------------- |
| 区域类型 | 否   | ExoClick 广告格式中的区域类型（例如：video\_slider） |
| CTA  | 否   | 指定广告位是否显示 CTA 组件（整数）                  |

## site

| 属性       | 必填？ | 描述                                    |
| -------- | --- | ------------------------------------- |
| id       | 推荐  | 唯一站点 ID（字符串）                          |
| 名称       | 否   | 网站名称（字符串）                             |
| domain   | 推荐  | 站点的域名（字符串）                            |
| cat      | 否   | IAB 类别 ID（字符串数组）                      |
| page     | 推荐  | 将展示广告的页面完整 URL（字符串）                   |
| keywords | 否   | 关键词可用于确保广告位获得正确类型的广告。关键词应为以逗号分隔的单词字符串 |

### site.ext

| 属性          | 必填？ | 描述                      |
| ----------- | --- | ----------------------- |
| exchangecat | 否   | 自定义 ExoClick 类别 ID（整数）  |
| idzone      | 否   | 自定义 ExoClick 广告位 ID（整数） |

## app

| 属性        | 必填？ | 描述                                           |
| --------- | --- | -------------------------------------------- |
| id        | 推荐  | 唯一 App ID（字符串）                               |
| 名称        | 否   | 应用名称（字符串）                                    |
| domain    | 推荐  | 应用的域名（字符串）                                   |
| cat       | 否   | IAB 类别 ID（字符串数组）                             |
| keywords  | 否   | 关键字可用于确保广告位获得正确类型的广告。关键字应为由逗号分隔的词组成的字符串（字符串） |
| publisher | 否   | 关于发布者的详细信息（对象）                               |

## device

| 属性       | 必填？ | 描述                                                 |
| -------- | --- | -------------------------------------------------- |
| ua       | 是   | 浏览器用户代理（字符串）                                       |
| sua      | 否   | 结构化的用户代理信息，可在客户端支持 User-Agent Client Hints 时使用（对象） |
| geo      | 否   | 通过 Geo 对象定义的设备位置，假定为用户当前位置。                        |
| ip       | 是   | 用户的 IPv4 地址（字符串）\*                                 |
| ipv6     | 是   | 用户的 IPv6 地址（字符串）\*                                 |
| language | 推荐  | 浏览器语言（字符串）                                         |
| os       | 否   | 操作系统（字符串）                                          |
| js       | 否   | 是否支持 JavaScript，其中 0 = 否，1 = 是（整数）                 |
| ext      | 否   | 用于 OpenRTB 交易平台特定扩展的占位符                            |

{% hint style="info" %}
您只需要在请求中包含 ip 或 ipv6 其中之一，而不是两者都包含。如果使用 ipv6，请移除 ip 属性，反之亦然。两者都包含可能会导致错误。
{% endhint %}

### device.geo

| 属性      | 必填？ | 描述      |
| ------- | --- | ------- |
| country | 否   | 国家 ISO3 |

### device.ext

| 属性                | 必填？ | 描述                                     |
| ----------------- | --- | -------------------------------------- |
| remote\_addr      | 否   | 用户的主 IP 地址（字符串）                        |
| x\_forwarded\_for | 否   | 用户的 X-FORWARDED-FOR IP 地址；若未设置则为空（字符串） |

### device.sua

结构化用户代理信息。 `device.sua` 被认为是设备属性更准确的表示。

| 属性           | 必填？ | 描述                                                                                                                                                                          |
| ------------ | --- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| browsers     | 推荐  | 实现方应发送从 Sec-CH-UA-Full-Version-List 头中派生的品牌和版本。（数组 `BrandVersion` BrandVersion 对象数组）                                                                                        |
| platform     | 推荐  | 实现方应发送从 Sec-CH-UA-Platform 头中派生的品牌，以及从 Sec-CH-UA-Platform-Version 头中派生的版本。（`BrandVersion` 对象）                                                                               |
| mobile       | 推荐  | 实现方应从 Sec-CH-UA-Mobile 头中派生此值。（整数）                                                                                                                                          |
| architecture | 推荐  | 实现方应从 Sec-CH-UA-Arch 头中获取此值。（字符串）                                                                                                                                           |
| bitness      | 推荐  | 实现方应从 Sec-CH-UA-Bitness 头中获取此值。（字符串）                                                                                                                                        |
| model        | 推荐  | 实现方应从 Sec-CH-UA-Model 头中获取此值。（字符串）                                                                                                                                          |
| source       | 推荐  | 用于创建此对象的数据来源， [列表：User-Agent 来源](https://github.com/InteractiveAdvertisingBureau/AdCOM/blob/master/AdCOM%20v1.0%20FINAL.md#list--user-agent-source-) 在 AdCOM 1.0 中（整数；默认 0） |

### device.sua.browsers | device.sua.platform

| 属性      | 必填？ | 描述                                                                                                            |
| ------- | --- | ------------------------------------------------------------------------------------------------------------- |
| brand   | 必填  | 该值可能来自 User-Agent Client Hints 头部，表示用户代理品牌（来自 Sec-CH-UA-Full-Version 头部）或平台品牌（来自 Sec-CH-UA-Platform 头部）。（字符串） |
| version | 推荐  | 版本组件序列，按降序层级顺序 \[主版本、次版本、微版本、…]（字符串数组）                                                                        |

## user

| 属性  | 必填？ | 描述                         |
| --- | --- | -------------------------- |
| id  | 否   | 唯一用户 ID（字符串）               |
| ext | 否   | 用于 OpenRTB 交换方特定扩展的占位符（对象） |

### user.ext

| 属性 | 必填？ | 描述                               |
| -- | --- | -------------------------------- |
| 同意 | 否   | 这是 IAB 标准要求的同意字符串。目前仅支持否定同意（字符串） |

## regs

| 属性  | 必填？ | 描述                         |
| --- | --- | -------------------------- |
| ext | 否   | 用于 OpenRTB 交换方特定扩展的占位符（对象） |

### regs.ext

| 属性   | 必填？ | 描述                                                         |
| ---- | --- | ---------------------------------------------------------- |
| gdpr | 否   | 如果调用方认为用户不受 GDPR 约束，则为 0；如果用户受 GDPR 约束，则为 1。若都不是，则该参数将未定义。 |

## ext

| 属性  | 必填？ | 描述                                      |
| --- | --- | --------------------------------------- |
| sub | 否   | Sub ID。该值应为 1 到 10 位数字：Sub ID 不要以 0 开头。 |


---

# 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://docs.exoclick.com/rtb/zh/fa-bu-shang/kai-fang-rtb/pub-open-rtb-2.5-request.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.
