# OnPage Lighthouse JSON แบบเรียลไทม์

**API:** Data API

**Endpoint:** `POST /v1/beta/dataforseo/on_page/lighthouse/live/json`

**Tags:** DataForSEO

รัน audit ของ Google Lighthouse บน `url` หนึ่งรายการ แล้วคืนรายงานฉบับเต็ม: `lighthouseVersion`, `requestedUrl`, `finalUrl`, `fetchTime`, `gatherMode`, `runWarnings` พร้อมคะแนนของทุก audit และทุกหมวดหมู่ `for_mobile` สลับอุปกรณ์ที่จำลอง ส่วน `categories` และ `audits` จำกัดขอบเขตการรัน ส่ง `categories` หรือ `audits` เพื่อลดขนาดรายงาน และใช้ `post_dataforseo_on_page_waterfall` เมื่อคำถามมีแค่ว่าหน้านี้ช้าทำไม ห่อด้วย envelope ของ DataForSEO: ข้อมูลอยู่ใน `tasks[0].result` ผลลัพธ์อยู่ใน `tasks[0].status_code` — คำขอที่ถูกปฏิเสธยังคงคืน HTTP 200

### ข้อมูลอ้างอิงราคา

- การวัดปริมาณการใช้งาน: ต้นทุนการตอบกลับที่รายงาน
- ค่าประมาณคำขออ้างอิง: USD 0.005
- ตัวคูณอ้างอิงสำหรับลูกค้า: 1.0 ห้ามนำไปใช้ซ้ำกับยอดที่เรียกเก็บจากลูกค้าแล้ว

เป็นข้อมูลเมตาอ้างอิงเท่านั้น ไม่ใช่ใบเสนอราคาสำหรับบัญชี ไม่ใช่ราคาที่รับประกัน และไม่ใช่เพดานการใช้จ่าย เครดิตของทรัพยากรไม่ใช่เครดิต Felo ยอดเรียกเก็บขั้นสุดท้ายเป็นไปตามบันทึกการเรียกเก็บเงินของ Felo

## Related links

- [ดูคำจำกัดความอย่างเป็นทางการ](<https://github.com/GoogleChrome/lighthouse/blob/master/docs/architecture.md#auditreport-terminology>)
- [ดูคำจำกัดความอย่างเป็นทางการ](<https://github.com/GoogleChrome/lighthouse/blob/master/docs/architecture.md#components--terminology>)
- [รายการ audit ที่เป็นไปได้ทั้งหมดได้ที่นี่](<https://docs.dataforseo.com/v3/on_page/lighthouse/audits/>)
- [endpoint Lighthouse Versions](<https://docs.dataforseo.com/v3/on_page/lighthouse/versions/>)
- [ตามลิงก์นี้](<https://github.com/GoogleChrome/lighthouse/blob/master/readme.md>)

## Base URL

- `https://openapi.felo.ai`

## Authentication

- `FeloBearerAuth` (http bearer, bearer format Felo API Key)
- `FeloApiKey` (apiKey in header `X-API-Key`)

## Request body

Required: **no**

### application/json

Schema:

```json
{
  "type": "array",
  "items": {
    "type": [
      "object",
      "null"
    ],
    "oneOf": [
      {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "<em>URL เป้าหมาย</em><br><strong>ฟิลด์ที่จำเป็น</strong><br>หน้าเป้าหมายควรระบุด้วย URL แบบสัมบูรณ์ (รวม http:// หรือ https://)<br>ตัวอย่าง:<br><code>https://dataforseo.com/</code>"
          },
          "for_mobile": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "<em>ใช้การจำลองมือถือ</em><br>ฟิลด์ไม่บังคับ<br>หากตั้งเป็น <code>true</code> Lighthouse จะใช้อุปกรณ์มือถือและการจำลองหน้าจอเพื่อทดสอบหน้าเว็บกับสภาพแวดล้อมมือถือ<br>หากตั้งเป็น <code>false</code> ผลลัพธ์จะถูกจัดหาให้สำหรับเดสก์ท็อป<br>ค่าเริ่มต้น: <code>false</code>"
          },
          "categories": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            },
            "description": "<em>หมวดหมู่ของ audit ใน Lighthouse</em><br>ฟิลด์ไม่บังคับ<br>แต่ละหมวดหมู่คือชุดของ audit และกลุ่ม audit ที่ใช้การถ่วงน้ำหนักและการให้คะแนนกับส่วนนั้น (ดูคำจำกัดความอย่างเป็นทางการ)<p><strong>หากเพิกเฉยต่อฟิลด์นี้ เราจะส่งคืนข้อมูลสำหรับทุกหมวดหมู่ เว้นแต่คุณจะระบุ <code>audits</code></strong><br>ใช้ฟิลด์นี้เพื่อรับข้อมูลสำหรับหมวดหมู่เฉพาะที่คุณระบุที่นี่<p>ค่าที่เป็นไปได้:<br><code>seo</code>, <code>performance</code>, <code>best_practices</code>, <code>accessibility</code>"
          },
          "audits": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            },
            "description": "<em>audit ของ Lighthouse</em><br>ฟิลด์ไม่บังคับ<br>audit คือการทดสอบแต่ละรายการที่ Lighthouse รันสำหรับคุณสมบัติ/การปรับแต่ง/เมตริกเฉพาะ เพื่อสร้างคะแนนเป็นตัวเลข (ดูคำจำกัดความอย่างเป็นทางการ);  <p><strong>หากเพิกเฉยต่อฟิลด์นี้ เราจะส่งคืนข้อมูลสำหรับ audit ทั้งหมด</strong>;<br>ใช้ฟิลด์นี้เพื่อรับข้อมูลสำหรับ audit เฉพาะที่คุณระบุที่นี่;<p><strong>หมายเหตุ:</strong> audit บางรายการไม่ได้อยู่ในหมวดหมู่เฉพาะและเป็นการวัดคุณภาพหน้าเว็บแบบเดี่ยว;<p>โดยทั่วไปแล้ว อาจมีกรณีการใช้งานหลายแบบ:<p>1. หากเพิกเฉยต่อ <code>categories</code> คุณสามารถใช้ฟิลด์นี้เพื่อรับข้อมูลเฉพาะ audit ที่ระบุ<br>ตัวอย่างเช่น หากเพิกเฉยต่อ <code>\"categories\"</code> และระบุ <code>\"audits\": [\"metrics/cumulative-layout-shift\",\"metrics/largest-contentful-paint\",\"metrics/total-blocking-time\"]</code> คุณจะได้รับข้อมูลเฉพาะ audit เหล่านี้<p>2. หากระบุหมวดหมู่ คุณสามารถใช้ฟิลด์นี้เพื่อรับ audit เพิ่มเติมที่ไม่ได้อยู่ในหมวดหมู่ที่คุณระบุ<br>ตัวอย่างเช่น หากระบุ <code>\"categories\": [\"seo\"]</code> และ <code>\"audits\": [\"metrics/cumulative-layout-shift\",\"metrics/largest-contentful-paint\",\"metrics/total-blocking-time\"]</code> คุณจะได้รับเฉพาะ audit เหล่านี้ภายใต้ \"performance\" และ audit ทั้งหมดภายใต้ \"seo\"<p>คุณสามารถรับ รายการ audit ที่เป็นไปได้ทั้งหมดได้ที่นี่"
          },
          "version": {
            "type": [
              "string",
              "null"
            ],
            "description": "<em>เวอร์ชัน lighthouse</em><br>ฟิลด์ไม่บังคับ<br>คุณสามารถรับผลลัพธ์เฉพาะเจาะจงสำหรับเวอร์ชัน Lighthouse ที่กำหนดได้โดยระบุหมายเลขเวอร์ชัน<br>รายการเวอร์ชันที่ใช้ได้มีให้ผ่าน endpoint Lighthouse Versions"
          },
          "language_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "<em>ชื่อภาษาของ lighthouse</em><br>ฟิลด์ไม่บังคับ<br>คุณสามารถรับรายการภาษาที่เครื่องมือค้นหามีให้พร้อม <code>language_name</code> ได้โดยส่งคำขอแยกไปยัง <code>https://api.dataforseo.com/v3/on_page/lighthouse/languages</code><br>ค่าเริ่มต้น:<br><code class=\"long-string\">English</code>"
          },
          "language_code": {
            "type": [
              "string",
              "null"
            ],
            "description": "<em>รหัสภาษาของ lighthouse</em><br>ฟิลด์ไม่บังคับ<br>คุณสามารถรับรายการภาษาที่เครื่องมือค้นหามีให้พร้อม <code>language_code</code> ได้โดยส่งคำขอแยกไปยัง <code>https://api.dataforseo.com/v3/on_page/lighthouse/languages</code><br>ค่าเริ่มต้น:<br><code class=\"long-string\">en</code>"
          },
          "custom_user_agent": {
            "type": [
              "string",
              "null"
            ],
            "description": "<em>user agent แบบกำหนดเอง</em><br>ฟิลด์ไม่บังคับ<br>ระบุ user agent แบบกำหนดเองที่เบราว์เซอร์ใช้เมื่อรัน audit ของ Lighthouse;<br>ระบุได้สูงสุด 254 อักขระ;"
          },
          "browser_screen_width": {
            "type": [
              "integer",
              "null"
            ],
            "description": "<em>ความกว้างหน้าจอเบราว์เซอร์</em><br>ฟิลด์ไม่บังคับ<br>ตั้งความกว้างหน้าจอของเบราว์เซอร์ที่ใช้สำหรับ audit ของ Lighthouse เพื่อจำลองอุปกรณ์เฉพาะ;<br>ระบุได้ภายในช่วงต่อไปนี้: <code>240–9999</code>;",
            "format": "int64"
          },
          "browser_screen_height": {
            "type": [
              "integer",
              "null"
            ],
            "description": "<em>ความสูงหน้าจอเบราว์เซอร์</em><br>ฟิลด์ไม่บังคับ<br>ตั้งความสูงหน้าจอของเบราว์เซอร์ที่ใช้สำหรับ audit ของ Lighthouse เพื่อจำลองอุปกรณ์เฉพาะ;<br>ระบุได้ภายในช่วงต่อไปนี้: <code>240–9999</code>;"
          },
          "browser_screen_scale_factor": {
            "type": [
              "number",
              "null"
            ],
            "description": "<em>ตัวคูณสเกลหน้าจอเบราว์เซอร์</em><br>ฟิลด์ไม่บังคับ<br>ตั้งอัตราส่วนพิกเซลของอุปกรณ์ของเบราว์เซอร์ที่ใช้สำหรับ audit ของ Lighthouse;<br>ระบุได้ภายในช่วงต่อไปนี้: <code>0.5–3</code>;"
          },
          "browser_network_throttling_method": {
            "type": [
              "string",
              "null"
            ],
            "description": "<em>วิธีการจำกัดเครือข่ายของเบราว์เซอร์</em><br>ฟิลด์ไม่บังคับ<br>กำหนดวิธีการที่ใช้ในการจำกัดระหว่าง audit ของ Lighthouse;<br>ค่าที่เป็นไปได้:<br><code>simulate</code> - คำนวณเมตริกประสิทธิภาพโดยประมาณโดยไม่ใช้การจำกัดอย่างชัดเจน;<br><code>devtools</code> - ใช้การตั้งค่าการจำกัดที่ระบุใน <code>browser_network_throttling</code> และ <code>browser_cpu_throttling_multiplier</code>;<br><code>provided</code> - ใช้สภาวะเครือข่ายของสภาพแวดล้อมที่ crawl;"
          },
          "browser_cpu_throttling_multiplier": {
            "type": [
              "number",
              "null"
            ],
            "description": "<em>ตัวคูณการจำกัด CPU ของเบราว์เซอร์</em><br><strong>จำเป็นหาก <code>browser_network_throttling_method</code> ตั้งเป็น <code>devtools</code>;</strong><br>ตั้งตัวคูณการจำกัด CPU เพื่อจำลองสภาวะประสิทธิภาพของอุปกรณ์ระหว่าง audit ของ Lighthouse;<br>ระบุได้ภายในช่วงต่อไปนี้: <code>1–4</code>;<br><strong>หมายเหตุ:</strong> พารามิเตอร์นี้ใช้เฉพาะเมื่อ <code>browser_network_throttling_method</code> ตั้งเป็น <code>devtools</code>;"
          },
          "browser_network_throttling": {
            "type": [
              "string",
              "null"
            ],
            "description": "<em>การจำกัดเครือข่ายของเบราว์เซอร์</em><br><strong>จำเป็นหาก <code>browser_network_throttling_method</code> ตั้งเป็น <code>devtools</code>;</strong><br>ตั้งโปรไฟล์การจำกัดเครือข่ายเพื่อจำลองสภาวะความเร็วการเชื่อมต่อระหว่าง audit ของ Lighthouse;<br>ค่าที่เป็นไปได้: <code>no_throttling</code>, <code>fast_4g</code>, <code>slow_4g</code>, <code>regular_3g</code>, <code>pc</code>;<br><strong>หมายเหตุ:</strong> พารามิเตอร์นี้ใช้เฉพาะเมื่อ <code>browser_network_throttling_method</code> ตั้งเป็น <code>devtools</code>;"
          },
          "tag": {
            "type": [
              "string",
              "null"
            ],
            "description": "<em>ตัวระบุงานที่ผู้ใช้กำหนด</em><br>ฟิลด์ไม่บังคับ<br><em>จำกัด 255 อักขระ</em><br>ใช้พารามิเตอร์นี้เพื่อระบุงานและจับคู่กับผลลัพธ์<br>คุณจะพบค่า <code>tag</code> ที่ระบุในออบเจ็กต์ <code>data</code> ของการตอบกลับ"
          }
        },
        "example": [
          {
            "url": "https://dataforseo.com",
            "for_mobile": true,
            "tag": "some_string_123"
          }
        ]
      }
    ]
  },
  "example": [
    {
      "url": "https://dataforseo.com",
      "for_mobile": true,
      "tag": "some_string_123"
    }
  ]
}
```

## Responses

### 200 — ดำเนินการสำเร็จ

Headers:
- `X-Request-Id` (string) — ตัวระบุคำขอที่ต้องระบุเมื่อติดต่อฝ่ายสนับสนุนของ Felo

**application/json**

Schema: object | null

```json
{
  "type": [
    "object",
    "null"
  ],
  "oneOf": [
    {
      "$ref": "#/components/schemas/Response36Afe1097B20_OnPageLighthouseLiveJsonResponseInfo"
    }
  ]
}
```

### 400 — ไม่สามารถประมวลผลคำขอได้ ตรวจสอบพารามิเตอร์ของคำขอ

### 401 — จำเป็นต้องใช้คีย์ API ของ Felo ที่ถูกต้อง

### 402 — ไม่สามารถดำเนินการตามคำขอได้ เนื่องจากไม่เป็นไปตามข้อกำหนดด้านการเรียกเก็บเงิน

### 403 — บัญชีไม่ได้รับอนุญาตให้ดำเนินการนี้

### 429 — ถึงขีดจำกัดคำขอหรือการใช้จ่ายแล้ว

### 502 — บริการไม่สามารถดำเนินการตามคำขอให้เสร็จสิ้นได้

### 503 — API หรือบริการเรียกเก็บเงินไม่พร้อมใช้งานชั่วคราว

### 504 — บริการหมดเวลาระหว่างประมวลผลคำขอ

### default — การตอบกลับข้อผิดพลาด; การตอบกลับที่ส่งผ่านจากต้นทางอาจใช้รูปแบบของผู้ให้บริการ

**application/json**

Schema:

```json
{}
```

## Schema definitions

### Response36Afe1097B20_BaseResponseInfo

`#/components/schemas/Response36Afe1097B20_BaseResponseInfo`

```json
{
  "properties": {
    "version": {
      "type": [
        "string",
        "null"
      ],
      "description": "เวอร์ชันปัจจุบันของ API"
    },
    "status_code": {
      "type": [
        "integer",
        "null"
      ],
      "description": "รหัสสถานะทั่วไป\nคุณสามารถดูรายการรหัสการตอบกลับทั้งหมดได้ที่นี่"
    },
    "status_message": {
      "type": [
        "string",
        "null"
      ],
      "description": "ข้อความข้อมูลทั่วไป\nคุณสามารถดูรายการข้อความข้อมูลทั่วไปทั้งหมดได้ที่นี่"
    },
    "time": {
      "type": [
        "string",
        "null"
      ],
      "description": "เวลาดำเนินการทั้งหมด (วินาที)"
    },
    "cost": {
      "type": [
        "number",
        "null"
      ],
      "description": "ค่าใช้จ่ายรวมของงาน, USD",
      "format": "double"
    },
    "tasks_count": {
      "type": [
        "integer",
        "null"
      ],
      "description": "จำนวนงานในอาร์เรย์ tasks",
      "format": "int64"
    },
    "tasks_error": {
      "type": [
        "integer",
        "null"
      ],
      "description": "จำนวนงานในอาร์เรย์ tasks ที่ส่งคืนพร้อมข้อผิดพลาด",
      "format": "int64"
    }
  }
}
```

### Response36Afe1097B20_BaseResponseTaskInfo

`#/components/schemas/Response36Afe1097B20_BaseResponseTaskInfo`

```json
{
  "properties": {
    "id": {
      "type": [
        "string",
        "null"
      ],
      "description": "ตัวระบุงาน\nตัวระบุงานที่ไม่ซ้ำกันในระบบของเราในรูปแบบ UUID"
    },
    "status_code": {
      "type": [
        "integer",
        "null"
      ],
      "description": "รหัสสถานะของงาน\nสร้างโดย DataForSEO โดยอยู่ในช่วงต่อไปนี้ได้: 10000-60000\nคุณสามารถดูรายการรหัสการตอบกลับทั้งหมดได้ที่นี่"
    },
    "status_message": {
      "type": [
        "string",
        "null"
      ],
      "description": "ข้อความข้อมูลของงาน\nคุณสามารถดูรายการข้อความข้อมูลทั่วไปทั้งหมดได้ที่นี่"
    },
    "time": {
      "type": [
        "string",
        "null"
      ],
      "description": "เวลาดำเนินการ, วินาที"
    },
    "cost": {
      "type": [
        "number",
        "null"
      ],
      "description": "ค่าใช้จ่ายรวมของงาน, USD",
      "format": "double"
    },
    "result_count": {
      "type": [
        "integer",
        "null"
      ],
      "description": "จำนวนองค์ประกอบในอาร์เรย์ result",
      "format": "int64"
    },
    "path": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": [
          "string",
          "null"
        ]
      },
      "description": "พาธ URL"
    },
    "data": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": {
        "type": [
          "object",
          "null"
        ]
      },
      "description": "มีพารามิเตอร์เดียวกับที่คุณระบุในคำขอ POST"
    }
  }
}
```

### Response36Afe1097B20_OnPageLighthouseLiveJsonResponseInfo

`#/components/schemas/Response36Afe1097B20_OnPageLighthouseLiveJsonResponseInfo`

```json
{
  "type": "object",
  "allOf": [
    {
      "$ref": "#/components/schemas/Response36Afe1097B20_BaseResponseInfo"
    },
    {
      "type": "object",
      "properties": {
        "tasks": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": [
              "object",
              "null"
            ],
            "oneOf": [
              {
                "$ref": "#/components/schemas/Response36Afe1097B20_OnPageLighthouseLiveJsonTaskInfo"
              }
            ]
          },
          "description": "<em>อาร์เรย์ของงาน</em>"
        }
      }
    }
  ]
}
```

### Response36Afe1097B20_OnPageLighthouseLiveJsonTaskInfo

`#/components/schemas/Response36Afe1097B20_OnPageLighthouseLiveJsonTaskInfo`

```json
{
  "type": "object",
  "allOf": [
    {
      "$ref": "#/components/schemas/Response36Afe1097B20_BaseResponseTaskInfo"
    },
    {
      "type": "object",
      "properties": {
        "result": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": {
              "type": [
                "object",
                "null"
              ]
            }
          },
          "description": "<em>ผลลัพธ์ของ Lighthouse audit</em><br>อาร์เรย์นี้จะรวมข้อมูลตามพารามิเตอร์ที่คุณระบุเมื่อตั้งงาน;<p>ฟิลด์ทั้งหมดและคำอธิบายมีอยู่ในเอกสารทางการ ตามลิงก์นี้"
        }
      }
    }
  ]
}
```
