> ## 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 内容解析

> 此端点支持解析您指定的任意页面内容，并返回目标页面的结构化内容，包括链接 URL、锚文本、标题...



## OpenAPI

````yaml openapi/zh/dataforseo.json POST /dataforseo/on_page/content_parsing/live
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/content_parsing/live:
    post:
      summary: 实时 OnPage API 内容解析
      description: 此端点允许解析您指定的任意页面内容，并返回目标页面的结构化内容，包括链接 URL、锚文本、标题和文本内容。
      operationId: post_dataforseo_on_page_content_parsing_live
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                url:
                  type: string
                  description: 要解析的内容 URL，必填字段，要解析的页面 URL，示例：https://www.fujielectric.com/
                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_javascript 或 enable_browser_rendering 设置为 true
                browser_screen_width:
                  type: integer
                  description: >-
                    浏览器屏幕宽度，可选字段。您可以设置自定义浏览器屏幕宽度，以针对特定设备执行审计；如果使用此字段，则无需指定
                    browser_preset，因为它将被忽略。注意：要使用此参数，请将 enable_javascript 或
                    enable_browser_rendering 设置为 true。最小值（像素）：240；最大值（像素）：9999
                browser_screen_height:
                  type: integer
                  description: >-
                    浏览器屏幕高度，可选字段。您可以设置自定义浏览器屏幕高度，以针对特定设备执行审计；如果使用此字段，则无需指定
                    browser_preset，因为它将被忽略。注意：要使用此参数，请将 enable_javascript 或
                    enable_browser_rendering 设置为 true。最小值（像素）：240；最大值（像素）：9999
                browser_screen_scale_factor:
                  type: number
                  description: >-
                    浏览器屏幕缩放系数，可选字段。可以设置自定义浏览器屏幕分辨率比例，以针对特定设备执行审计；如果使用此字段，则无需指定
                    browser_preset，因为它将被忽略。注意：要使用此参数，请将 enable_javascript 或
                    enable_browser_rendering 设置为 true。最小值：0.5。最大值：3
                store_raw_html:
                  type: boolean
                  description: >-
                    存储已抓取页面的 HTML；可选字段；如果要通过 OnPage Raw HTML 端点获取页面的 HTML，请设置为
                    true；默认值：false
                disable_cookie_popup:
                  type: boolean
                  description: >-
                    禁用 Cookie 弹窗 可选字段；如果要禁用请求用户同意使用 Cookie 的弹窗，请设置为
                    true；默认值：false
                accept_language:
                  type: string
                  description: >-
                    用于访问网站的语言标头，可选字段。支持所有区域设置格式（xx、xx-XX、xxx-XX
                    等）。注意：如果未指定此参数，某些网站可能会拒绝访问；在这种情况下，响应数组中返回的页面将包含
                    "type":"broken
                enable_javascript:
                  type: boolean
                  description: >-
                    在页面上加载 JavaScript。可选字段。如果要加载页面上可用的脚本，请设置为
                    true。默认值：false。注意：使用此参数将产生额外费用；有关使用此参数的任务费用，请参阅我们的帮助文章；费用可在定价页面上计算
                enable_browser_rendering:
                  type: boolean
                  description: >-
                    模拟浏览器渲染以测量 Core Web Vitals 可选字段
                    使用此参数可在加载网页时模拟浏览器；enable_browser_rendering
                    会加载页面上的样式、图像、字体、动画、视频及其他资源；默认值：false 设置为 true 可在响应中获取 Core
                    Web Vitals（FID、CLS、LCP）指标；如果使用此字段，enable_javascript 和
                    load_resources 参数必须设置为 true
                    注意：使用此参数会产生额外费用；有关使用此参数的任务费用，请参阅我们的帮助文章；具体费用可在 Pricing Page
                    上计算
                enable_xhr:
                  type: boolean
                  description: >-
                    在页面上启用 XMLHttpRequest；可选字段。如果希望我们的爬虫使用 XMLHttpRequest 对象从
                    Web 服务器请求数据，请设置为 true。默认值：false。如果使用此字段，enable_javascript
                    必须设置为 true；
                switch_pool:
                  type: boolean
                  description: >-
                    切换代理池，可选字段；如果为 true，将使用其他代理池获取请求的数据；当同时设置大量任务，偶尔出现限流和/或
                    site_unreachable 错误时，可以使用此参数
                ip_pool_for_scan:
                  type: string
                  description: >-
                    代理池，可选字段；可选择用于获取所请求数据的代理池位置。如果某一位置无法访问页面内容并偶尔导致
                    site_unreachable 错误，则可使用此参数。可选值：us, de
                markdown_view:
                  type: boolean
                  description: >-
                    以 Markdown 格式返回页面内容。可选字段；如果设置为 true，页面的 Markdown 格式内容将在响应的
                    page_as_markdown 字段中返回；默认值：false
              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.crawl_status:
                    type: object
                    description: 抓取会话的详细信息
                  tasks.result.items_count:
                    type: integer
                    description: results 数组中的项目数量
                  tasks.result.items:
                    type: array
                    items:
                      type: string
                    description: items 数组
                  tasks.result.items.type:
                    type: string
                    description: 返回项的类型 = ‘сontent_parsing_element’
                  tasks.result.items.fetch_time:
                    type: string
                    description: >-
                      内容获取的日期和时间，采用 UTC 格式：“yyyy-mm-dd hh-mm-ss
                      +00:00”，示例："2022-11-01 10:02:52 +00:00"
                  tasks.result.items.status_code:
                    type: integer
                    description: 页面状态码
                  tasks.result.items.page_content:
                    type: object
                    description: 页面的解析内容
                  tasks.result.items.page_content.header:
                    type: object
                    description: 解析后的标头内容
                  tasks.result.items.page_content.primary_content:
                    type: array
                    items:
                      type: string
                    description: 页面上的主要内容；有关内容优先级计算的更多信息，请参阅此帮助中心文章
                  tasks.result.items.page_content.primary_content.text:
                    type: string
                    description: 内容文本
                  tasks.result.items.page_content.primary_content.url:
                    type: string
                    description: 当文本为链接锚文本时显示的页面 URL
                  tasks.result.items.page_content.primary_content.urls:
                    type: array
                    items:
                      type: string
                    description: 包含在内容元素中找到的其他 URL 和锚文本
                  tasks.result.items.page_content.primary_content.urls.url:
                    type: string
                    description: 在 content 元素中找到的其他 URL
                  tasks.result.items.page_content.primary_content.urls.anchor_text:
                    type: string
                    description: URL 的锚文本
                  tasks.result.items.page_content.secondary_content:
                    type: array
                    items:
                      type: string
                    description: 页面上的次要内容；有关内容优先级计算的更多信息，请参阅此帮助中心文章
                  tasks.result.items.page_content.secondary_content.text:
                    type: string
                    description: 内容文本
                  tasks.result.items.page_content.secondary_content.url:
                    type: string
                    description: 当文本为链接锚文本时显示的页面 URL
                  tasks.result.items.page_content.secondary_content.urls:
                    type: array
                    items:
                      type: string
                    description: 包含在内容元素中找到的其他 URL 和锚文本
                  tasks.result.items.page_content.secondary_content.urls.url:
                    type: string
                    description: 在 content 元素中找到的其他 URL
                  tasks.result.items.page_content.secondary_content.urls.anchor_text:
                    type: string
                    description: URL 的锚文本
                  tasks.result.items.page_content.table_content:
                    type: array
                    items:
                      type: string
                    description: 页面上的表格内容
                  tasks.result.items.page_content.table_content.header:
                    type: array
                    items:
                      type: string
                    description: 表格的表头内容
                  tasks.result.items.page_content.table_content.header.row_cells:
                    type: array
                    items:
                      type: string
                    description: 表头行单元格的内容
                  tasks.result.items.page_content.table_content.header.row_cells.text:
                    type: string
                    description: 行单元格中的文本
                  tasks.result.items.page_content.table_content.header.row_cells.urls:
                    type: array
                    items:
                      type: string
                    description: 包含单元格中发现的其他 URL 和锚点
                  tasks.result.items.page_content.table_content.header.row_cells.urls.url:
                    type: string
                    description: 单元格中找到的 URL
                  tasks.result.items.page_content.table_content.header.row_cells.urls.anchor_text:
                    type: string
                    description: URL 的锚文本
                  tasks.result.items.page_content.table_content.header.row_cells.is_header:
                    type: boolean
                    description: 指示文本是否属于标题
                  tasks.result.items.page_content.table_content.body:
                    type: array
                    items:
                      type: string
                    description: 表格主体内容
                  tasks.result.items.page_content.table_content.body.row_cells:
                    type: array
                    items:
                      type: string
                    description: 表头行单元格的内容
                  tasks.result.items.page_content.table_content.body.row_cells.text:
                    type: string
                    description: 行单元格中的文本
                  tasks.result.items.page_content.table_content.body.row_cells.urls:
                    type: array
                    items:
                      type: string
                    description: 包含单元格中发现的其他 URL 和锚点
                  tasks.result.items.page_content.table_content.body.row_cells.urls.url:
                    type: string
                    description: 单元格中找到的 URL
                  tasks.result.items.page_content.table_content.body.row_cells.urls.anchor_text:
                    type: string
                    description: URL 的锚文本
                  tasks.result.items.page_content.table_content.body.row_cells.is_header:
                    type: boolean
                    description: 指示文本是否属于标题
                  tasks.result.items.page_content.table_content.footer:
                    type: array
                    items:
                      type: string
                    description: 表格页脚的内容
                  tasks.result.items.page_content.table_content.footer.row_cells:
                    type: array
                    items:
                      type: string
                    description: 表头行单元格的内容
                  tasks.result.items.page_content.table_content.footer.row_cells.text:
                    type: string
                    description: 行单元格中的文本
                  tasks.result.items.page_content.table_content.footer.row_cells.urls:
                    type: array
                    items:
                      type: string
                    description: 包含单元格中发现的其他 URL 和锚点
                  tasks.result.items.page_content.table_content.footer.row_cells.urls.url:
                    type: string
                    description: 单元格中找到的 URL
                  tasks.result.items.page_content.table_content.footer.row_cells.urls.anchor_text:
                    type: string
                    description: URL 的锚文本
                  tasks.result.items.page_content.table_content.footer.row_cells.is_header:
                    type: boolean
                    description: 指示文本是否属于标题
                  tasks.result.items.page_content.footer:
                    type: object
                    description: 页脚的解析内容
                  tasks.result.items.page_content.main_topic:
                    type: array
                    items:
                      type: string
                    description: 页面上的主要主题；可在此帮助中心文章中了解有关主题优先级计算的更多信息
                  tasks.result.items.page_content.main_topic.h_title:
                    type: string
                    description: 元标题
                  tasks.result.items.page_content.main_topic.main_title:
                    type: string
                    description: 区块主标题
                  tasks.result.items.page_content.main_topic.author:
                    type: string
                    description: 内容作者姓名
                  tasks.result.items.page_content.main_topic.language:
                    type: string
                    description: 内容语言
                  tasks.result.items.page_content.main_topic.level:
                    type: string
                    description: HTML 层级
                  tasks.result.items.page_content.main_topic.primary_content:
                    type: array
                    items:
                      type: string
                    description: 页面上的主要内容；有关内容优先级计算的更多信息，请参阅此帮助中心文章
                  tasks.result.items.page_content.main_topic.text:
                    type: string
                    description: 内容文本
                  tasks.result.items.page_content.main_topic.url:
                    type: string
                    description: 当文本为链接锚文本时显示的页面 URL
                  tasks.result.items.page_content.main_topic.urls:
                    type: array
                    items:
                      type: string
                    description: 包含在内容元素中找到的其他 URL 和锚文本
                  tasks.result.items.page_content.main_topic.urls.url:
                    type: string
                    description: 在 content 元素中找到的其他 URL
                  tasks.result.items.page_content.main_topic.urls.anchor_text:
                    type: string
                    description: URL 的锚文本
                  tasks.result.items.page_content.main_topic.secondary_content:
                    type: array
                    items:
                      type: string
                    description: 页面上的次要内容；有关内容优先级计算的更多信息，请参阅此帮助中心文章
                  tasks.result.items.page_content.secondary_topic:
                    type: array
                    items:
                      type: string
                    description: 页面上的次要主题；有关主题优先级计算的更多信息，请参阅此帮助中心文章
                  tasks.result.items.page_content.secondary_topic.h_title:
                    type: string
                    description: 元标题
                  tasks.result.items.page_content.secondary_topic.main_title:
                    type: string
                    description: 区块主标题
                  tasks.result.items.page_content.secondary_topic.author:
                    type: string
                    description: 内容作者姓名
                  tasks.result.items.page_content.secondary_topic.language:
                    type: string
                    description: 内容语言
                  tasks.result.items.page_content.secondary_topic.level:
                    type: string
                    description: HTML 层级
                  tasks.result.items.page_content.secondary_topic.primary_content:
                    type: array
                    items:
                      type: string
                    description: 页面上的主要内容；有关内容优先级计算的更多信息，请参阅此帮助中心文章
                  tasks.result.items.page_content.secondary_topic.text:
                    type: string
                    description: 内容文本
                  tasks.result.items.page_content.secondary_topic.url:
                    type: string
                    description: 当文本为链接锚文本时显示的页面 URL
                  tasks.result.items.page_content.secondary_topic.urls:
                    type: array
                    items:
                      type: string
                    description: 包含在内容元素中找到的其他 URL 和锚文本
                  tasks.result.items.page_content.secondary_topic.urls.url:
                    type: string
                    description: 在 content 元素中找到的其他 URL
                  tasks.result.items.page_content.secondary_topic.urls.anchor_text:
                    type: string
                    description: URL 的锚文本
                  tasks.result.items.page_content.secondary_topic.secondary_content:
                    type: array
                    items:
                      type: string
                    description: 页面上的次要内容；有关内容优先级计算的更多信息，请参阅此帮助中心文章
                  tasks.result.items.page_content.ratings:
                    type: array
                    items:
                      type: string
                    description: 包含页面所展示产品的评分信息对象
                  tasks.result.items.page_content.ratings.name:
                    type: string
                    description: rating 名称。注意：此字段未在此特定对象中使用，其值始终设为 null
                  tasks.result.items.page_content.ratings.rating_value:
                    type: integer
                    description: 评级值
                  tasks.result.items.page_content.ratings.max_rating_value:
                    type: integer
                    description: 评分的最大值
                  tasks.result.items.page_content.ratings.rating_count:
                    type: integer
                    description: 反馈数量
                  tasks.result.items.page_content.ratings.relative_rating:
                    type: number
                    description: 相对评分的取值范围为 0 到 1
                  tasks.result.items.page_content.offers:
                    type: array
                    items:
                      type: string
                    description: 页面上展示的产品数组，其中包含具有页面所展示产品相关信息的对象
                  tasks.result.items.page_content.offers.name:
                    type: string
                    description: 产品名称
                  tasks.result.items.page_content.offers.price:
                    type: integer
                    description: 产品价格
                  tasks.result.items.page_content.offers.price_currency:
                    type: string
                    description: 价格币种
                  tasks.result.items.page_content.offers.price_valid_until:
                    type: integer
                    description: >-
                      显示价格有效期截止的日期和时间，采用 UTC 格式：“yyyy-mm-dd hh-mm-ss
                      +00:00”，示例："2022-11-01 10:02:52 +00:00"
                  tasks.result.items.page_content.comments:
                    type: array
                    items:
                      type: string
                    description: 页面上显示的评论数组，包含与所展示产品相关的评论信息对象
                  tasks.result.items.page_content.comments.rating:
                    type: object
                    description: 产品评分，包含客户为该产品给出的评分信息
                  tasks.result.items.page_content.comments.name:
                    type: string
                    description: 评分名称。注意：此字段未在此特定对象中使用，其值始终为 null
                  tasks.result.items.page_content.comments.rating_value:
                    type: integer
                    description: 评级值
                  tasks.result.items.page_content.comments.max_rating_value:
                    type: integer
                    description: 评分的最大值
                  tasks.result.items.page_content.comments.rating_count:
                    type: integer
                    description: 反馈数量。注意：此字段未在此特定对象中使用，其值始终为 null
                  tasks.result.items.page_content.comments.relative rating:
                    type: number
                    description: 相对评分的取值范围为 0 到 1
                  tasks.result.items.page_content.comments.title:
                    type: string
                    description: 客户评论的标题
                  tasks.result.items.page_content.comments.publish_date:
                    type: string
                    description: 评论发布日期
                  tasks.result.items.page_content.comments.author:
                    type: string
                    description: 评论作者
                  tasks.result.items.page_content.comments.primary_content:
                    type: array
                    items:
                      type: string
                    description: 页面上的主要内容；有关内容优先级计算的更多信息，请参阅此帮助中心文章
                  tasks.result.items.page_content.comments.primary_content.text:
                    type: string
                    description: 评论文本
                  tasks.result.items.page_content.comments.primary_content.url:
                    type: string
                    description: 当文本为链接锚文本时显示
                  tasks.result.items.page_content.comments.primary_content.urls:
                    type: array
                    items:
                      type: string
                    description: 包含在内容元素中找到的其他 URL 和锚文本
                  tasks.result.items.page_content.contacts:
                    type: object
                    description: 联系信息，包含页面上显示的联系信息
                  tasks.result.items.page_content.contacts.telephones:
                    type: array
                    items:
                      type: string
                    description: 电话号码数组
                  tasks.result.items.page_content.contacts.emails:
                    type: array
                    items:
                      type: string
                    description: 电子邮件数组
                  tasks.result.items.page_as_markdown:
                    type: string
                    description: >-
                      Markdown 格式的页面内容 text-to-HTML Markdown 格式的页面内容；在请求中将
                      markdown_view 指定为 true 以返回该值
        '400':
          description: 错误请求
        '401':
          description: 未授权
        '429':
          description: 超出速率限制
        '500':
          description: 内部服务器错误
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````