> ## 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 Lighthouse JSON

> OnPage Lighthouse API 基于 Google 的开源 Lighthouse 项目，用于衡量网页和 Web 应用的质量。



## OpenAPI

````yaml openapi/zh/dataforseo.json POST /dataforseo/on_page/lighthouse/live/json
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/lighthouse/live/json:
    post:
      summary: 实时 OnPage Lighthouse JSON
      description: OnPage Lighthouse API 基于 Google 的开源 Lighthouse 项目，用于衡量网页和 Web 应用的质量。
      operationId: post_dataforseo_on_page_lighthouse_live_json
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                url:
                  type: string
                  description: >-
                    目标 URL 必填字段；应使用绝对 URL（包括 http:// 或
                    https://）指定目标页面；示例：https://dataforseo.com/
                for_mobile:
                  type: boolean
                  description: >-
                    应用移动设备模拟；可选字段。如果设置为 true，Lighthouse
                    将使用移动设备和屏幕模拟，在移动环境下测试页面；如果设置为 false，将提供桌面端结果。默认值：false。
                categories:
                  type: array
                  items:
                    type: string
                  description: >-
                    Lighthouse
                    审核类别。可选字段。每个类别都是审核和审核组的集合，会对相应部分应用权重和评分（请参阅官方定义）。如果忽略此字段，我们将返回所有类别的数据，除非您指定
                    audits。使用此字段可获取您在此处指定的特定类别的数据。可选值：seo、performance、best_practices、accessibility
                audits:
                  type: array
                  items:
                    type: string
                  description: >-
                    Lighthouse 审核 可选字段 audits 是 Lighthouse
                    针对每项特定功能/优化/指标运行的独立测试，用于生成数值分数（参阅官方定义）；如果忽略此字段，我们将返回所有审核的数据；使用此字段可获取您在此处指定的特定审核的数据；注意：某些审核不属于特定类别，而是独立的页面质量衡量指标；通常有以下几种使用场景：1.
                    如果忽略 categories，可以使用此字段仅获取指定审核的数据，例如，如果忽略 "categories" 并指定
                    "audits":
                    ["metrics/cumulative-layout-shift","metrics/largest-contentful-paint","metrics/total-blocking-time"]，则仅会获得这些审核的数据
                    2. 如果指定某个类别，可以使用此字段额外接收不属于所指定类别的审核，例如，如果指定 "categories":
                    ["seo"] 和 "audits":
                    ["metrics/cumulative-layout-shift","metrics/largest-contentful-paint","metrics/total-blocking-time"]，则会获得
                    “performance” 下的这些审核以及 “seo” 下的所有审核 您可以在此处获取所有可用审核的完整列表
                version:
                  type: string
                  description: >-
                    Lighthouse 版本；可选字段；通过指定版本号，您可以获取特定 Lighthouse
                    版本的结果；可用版本列表可通过 Lighthouse Versions 端点获取
                language_name:
                  type: string
                  description: >-
                    Lighthouse 语言名称；可选字段；可通过向
                    https://api.dataforseo.com/v3/on_page/lighthouse/languages
                    单独发起请求，获取搜索引擎的可用语言及其 language_name 列表；默认值：English
                language_code:
                  type: string
                  description: >-
                    Lighthouse 语言代码，可选字段。您可以通过向
                    https://api.dataforseo.com/v3/on_page/lighthouse/languages
                    单独发送请求，获取搜索引擎可用语言及其 language_code 的列表。默认值：en
                tag:
                  type: string
                  description: >-
                    用户定义的任务标识符。可选字段。字符数限制为 255。您可以使用此参数标识任务并将其与结果匹配；您将在响应的 data
                    对象中找到指定的 tag 值
              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: 包含设置任务时指定的相同参数
                  tasks.result:
                    type: array
                    items:
                      type: string
                    description: >-
                      Lighthouse 审核结果
                      此数组将包含根据您设置任务时指定的参数生成的数据；所有字段及其说明均可通过此链接在官方文档中查看。
        '400':
          description: 错误请求
        '401':
          description: 未授权
        '429':
          description: 超出速率限制
        '500':
          description: 内部服务器错误
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````