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

# OnPage API 页面截图

> 使用此端点，可以为任意网页捕获完整的高质量截图。



## OpenAPI

````yaml openapi/zh/dataforseo.json POST /dataforseo/on_page/page_screenshot
openapi: 3.0.3
info:
  title: DataForSEO API
  version: 1.0.0
  description: 通过 AIsa 统一网关提供的 DataForSEO API 端点。
servers:
  - url: https://api.aisa.one/apis/v1
security:
  - BearerAuth: []
paths:
  /dataforseo/on_page/page_screenshot:
    post:
      summary: OnPage API 页面截图
      description: 使用此端点，您可以获取任意网页的完整高质量截图。通过这种方式，您可以查看 DataForSEO 爬虫和 Googlebot 所看到的目标页面。
      operationId: post_dataforseo_on_page_page_screenshot
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                url:
                  type: string
                  description: >-
                    页面 url，必填字段。要截图的页面绝对 URL。注意：如果您在此处指定的 URL 返回 404
                    状态代码，或者指定的值不是有效的 URL，则响应数组中会出现 "error_message":"Screenshot
                    is empty"
                accept_language:
                  type: string
                  description: >-
                    访问网站时使用的语言标头；可选字段。支持所有区域设置格式（xx、xx-XX、xxx-XX
                    等）。注意：如果未指定此参数，某些网站可能会拒绝访问；在这种情况下，响应数组中将出现
                    "error_message":"Screenshot is empty"
                custom_user_agent:
                  type: string
                  description: >-
                    自定义用户代理。可选字段，用于抓取网站的自定义用户代理。示例：Mozilla/5.0 (Macintosh; Intel
                    Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko)
                    Chrome/83.0.4103.116 Safari/537.36。默认值：Mozilla/5.0
                    (compatible; RSiteAuditor)
                browser_preset:
                  type: string
                  description: >-
                    浏览器屏幕参数预设，可选字段。如果使用此字段，则无需指定
                    browser_screen_width、browser_screen_height、browser_screen_scale_factor。可选值：desktop,
                    mobile, tablet。desktop 预设将应用以下值：browser_screen_width: 1920
                    browser_screen_height: 1080 browser_screen_scale_factor:
                    1。mobile 预设将应用以下值：browser_screen_width: 390
                    browser_screen_height: 844 browser_screen_scale_factor:
                    3。tablet 预设将应用以下值：browser_screen_width: 1024
                    browser_screen_height: 1366 browser_screen_scale_factor:
                    2。注意：在此端点中，enable_browser_rendering、enable_javascript、load_resources
                    和 enable_xhr 参数始终处于启用状态。
                browser_screen_width:
                  type: integer
                  description: >-
                    浏览器屏幕宽度 可选字段 你可以设置自定义浏览器屏幕宽度，以针对特定设备执行审计；如果使用此字段，则无需指定
                    browser_preset，因为它将被忽略；最小值（像素）：240 最大值（像素）：9999
                browser_screen_height:
                  type: integer
                  description: >-
                    浏览器屏幕高度，可选字段。你可以设置自定义浏览器屏幕高度，以针对特定设备执行审计；如果使用此字段，则无需指定
                    browser_preset，因为它将被忽略；最小值（像素）：240；最大值（像素）：9999
                browser_screen_scale_factor:
                  type: number
                  description: >-
                    浏览器屏幕缩放系数 可选字段 你可以设置自定义浏览器屏幕分辨率比例，以针对特定设备执行审计；如果使用此字段，则无需指定
                    browser_preset，因为它将被忽略；最小值：0.5 最大值：3
                full_page_screenshot:
                  type: boolean
                  description: 截取完整页面的屏幕截图；可选字段，如果只想截取滚动前显示的页面部分，请设置为 false；默认值：true
                disable_cookie_popup:
                  type: boolean
                  description: >-
                    禁用 Cookie 弹窗 可选字段；如果要禁用请求用户同意使用 Cookie 的弹窗，请设置为
                    true；默认值：false
                switch_pool:
                  type: boolean
                  description: >-
                    切换代理池，可选字段；如果为 true，将使用其他代理池获取请求的数据；当同时设置大量任务，偶尔出现限流和/或
                    site_unreachable 错误时，可以使用此参数
                ip_pool_for_scan:
                  type: string
                  description: >-
                    代理池，可选字段；可选择用于获取所请求数据的代理池位置。如果某一位置无法访问页面内容并偶尔导致
                    site_unreachable 错误，则可使用此参数。可选值：us, de
              required:
                - url
      responses:
        '200':
          description: 成功响应
          content:
            application/json:
              schema:
                type: object
                properties:
                  version:
                    type: string
                    description: API 的当前版本
                  status_code:
                    type: integer
                    description: 通用状态码；您可以在此处查看完整的响应码列表。注意：我们强烈建议设计必要的系统来处理相关异常或错误情况
                  status_message:
                    type: string
                    description: 常规信息消息；可在此处查看常规信息消息的完整列表
                  time:
                    type: string
                    description: 执行时间（秒）
                  cost:
                    type: number
                    description: 任务总成本（美元）
                  tasks_count:
                    type: integer
                    description: tasks 数组中的任务数量
                  tasks_error:
                    type: integer
                    description: 返回错误的 tasks 数组中的任务数量
                  tasks:
                    type: array
                    items:
                      type: string
                    description: 任务数组
                  tasks.id:
                    type: string
                    description: 任务标识符，系统中采用 UUID 格式的唯一任务标识符
                  tasks.status_code:
                    type: integer
                    description: DataForSEO 生成的任务状态码；范围为：10000-60000；完整响应代码列表可在此处查看
                  tasks.status_message:
                    type: string
                    description: 任务的信息性消息，你可以在此处查看通用信息性消息的完整列表
                  tasks.time:
                    type: string
                    description: 执行时间（秒）
                  tasks.cost:
                    type: number
                    description: 任务成本（美元）
                  tasks.result_count:
                    type: integer
                    description: 结果数组中的元素数量
                  tasks.path:
                    type: array
                    items:
                      type: string
                    description: URL 路径
                  tasks.data:
                    type: object
                    description: 包含您在 POST 请求中指定的相同参数
                  tasks.result:
                    type: array
                    items:
                      type: string
                    description: 结果数组
                  tasks.result.crawl_progress:
                    type: string
                    description: 抓取会话的状态，可能的值：in_progress、finished
                  tasks.result.error_message:
                    type: string
                    description: >-
                      错误消息；如果您指定的 url 返回 404 状态码或不是有效的 URL，将获得
                      "error_message":"Screenshot is empty"；如果未遇到错误，该值将为 null
                  tasks.result.items_count:
                    type: integer
                    description: results 数组中的项目数量
                  tasks.result.items:
                    type: array
                    items:
                      type: string
                    description: items 数组
                  tasks.result.items.image:
                    type: string
                    description: 所请求页面的截图；DataForSEO 存储空间中页面截图的 URL
        '400':
          description: 错误请求
        '401':
          description: 未授权
        '429':
          description: 超出速率限制
        '500':
          description: 内部服务器错误
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````