> ## Documentation Index
> Fetch the complete documentation index at: https://docs.brightdata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Proxy REST API Playground

> Send proxied requests through the Bright Data Proxy REST API using a single POST endpoint on port 33335. Includes an interactive playground for testing.

<Note> See instruction on how to create API key: [API key creation](https://docs.brightdata.com/api-reference/authentication#how-do-i-generate-a-new-api-key%3F)</Note>


## OpenAPI

````yaml proxy-rest-api POST /request
openapi: 3.0.1
info:
  title: Bright Data API
  description: 将 Bright Data API 集成到您的管道中，实现高端抓取精度
  version: 1.0.0
servers:
  - url: https://api.brightdata.com
security:
  - bearerAuth: []
paths:
  /request:
    post:
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PostBody'
      responses:
        '200':
          description: 成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTP200'
        '400':
          description: 错误请求
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTP400'
        '401':
          description: 未授权
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTP401'
components:
  schemas:
    PostBody:
      required:
        - zone
        - url
        - format
      type: object
      properties:
        zone:
          description: 将为您的请求提供服务的代理区域名称。
          type: string
        url:
          description: 请求的目标 URL。
          type: string
        format:
          description: |-
            通过代理请求原始 HTML 的格式为 `raw`。

            请求 JSON 响应的格式为 `json`。
          type: string
          enum:
            - raw
            - json
        method:
          description: 通过代理请求 HTML 的方法为 `GET`。
          type: string
          default: GET
        country:
          description: 请求通过的代理所在的国家代码。
          type: string
        city:
          description: |-
            请求通过的代理所在的城市名称，必须定义国家。

            在数据中心和 ISP 区域中支持预配置城市，在住宅和移动网络中默认支持。
          type: string
        zip:
          description: |-
            请求通过的代理所在的邮政编码，必须定义国家。

            仅在住宅网络中支持。
          type: string
        ASN:
          description: |-
            请求通过的代理所在的 ASN 代码，必须定义国家。

            仅在住宅网络中支持。
          type: string
        carrier:
          description: |-
            仅适用于移动网络：请求通过的运营商代码。

            仅在移动网络中支持。
          type: string
        os:
          description: |-
            设置在代理上的客户端操作系统。

            仅在移动网络中支持。
          type: string
        dns:
          description: 使用 `local` 或 `remote` 设置域名映射是在客户端本地还是在远程代理节点上完成。
          type: string
          enum:
            - local
            - remote
        session:
          description: 客户端传递的字符串以标记会话，所有具有相同 session 参数的请求将被传递到相同的代理节点。
          type: string
        ip:
          description: 在数据中心和 ISP 区域中：将请求转发到由 `ip` 标识的特定代理。
          type: string
        gip:
          description: 在 `住宅` 和 `移动` 区域中：将请求转发到由 `gip` 标识的特定代理组。
          type: string
        c_tag:
          description: >-
            在请求中包含唯一的 `c_tag`
            标志。响应中，业务端会在头部返回相同的标志。此无缝交换确保每个响应都绑定到其对应的请求，消除混淆并简化数据管理。
          type: string
        direct:
          description: 将参数设置为 `true` 会指示通过 Bright Data 超级代理（数据中心代理，而非代理节点本身）处理请求。
          type: boolean
    HTTP200:
      type: string
      example: OK
    HTTP400:
      type: string
      example: 错误请求
    HTTP401:
      type: string
      example: 需要用户身份验证
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        在 Authorization 头中使用您的 Bright Data API Key 作为 Bearer token。


        **认证方法:**

        1. 从 Bright Data 账户设置获取您的 API Key:
        https://brightdata.com/cp/setting/users

        2. 在请求的 Authorization 头中包含 API Key

        3. 格式: `Authorization: Bearer YOUR_API_KEY`


        **示例:**

        ```

        Authorization: Bearer
        b5648e1096c6442f60a6c4bbbe73f8d2234d3d8324554bd6a7ec8f3f251f07df

        ```


        了解如何获取 Bright Data API Key:
        https://docs.brightdata.com/cn/api-reference/authentication#如何生成新的-api-key？
      bearerFormat: API Key

````