> ## 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
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:
    post:
      summary: OnPage API 内容解析
      description: 此端点允许解析您指定的任意页面内容，并返回目标页面的结构化内容，包括链接 URL、锚文本、标题和文本内容。
      operationId: post_dataforseo_on_page_content_parsing
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                url:
                  type: string
                  description: >-
                    要解析的内容的 URL，必填字段；要解析的页面
                    URL；示例：https://dataforseo.com/blog/a-versatile-alternative-to-google-trends-exploring-the-power-of-dataforseo-trends-api
                id:
                  type: string
                  description: >-
                    任务 ID。必填字段。您可以从 Task POST 端点的响应中获取此 ID。注意：POST 请求中的
                    enable_content_parsing 参数必须设置为
                    true。示例："07131248-1535-0216-1000-17384017ad04"
                markdown_view:
                  type: boolean
                  description: >-
                    以 Markdown 格式返回页面内容。可选字段；如果设置为 true，页面的 Markdown 格式内容将在响应的
                    page_as_markdown 字段中返回；默认值：false
              required:
                - url
                - id
      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: 内容获取的日期和时间，示例："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

````