# HTML ดิบใน OnPage API

**API:** Data API

**Endpoint:** `POST /v1/beta/dataforseo/on_page/raw_html`

**Tags:** DataForSEO

HTML ที่จัดเก็บไว้ของ `url` ที่ crawl แล้วหนึ่งหน้า อ่านการ crawl ที่เสร็จแล้ว จึงต้องใช้ `id` จาก `post_dataforseo_on_page_submit` และคืนค่า `crawl_progress` พร้อม `crawl_status` ซึ่งเป็น `max_crawl_pages`, `pages_in_queue` และ `pages_crawled` — ตรวจสอบค่าเหล่านี้ก่อนเชื่อผลลัพธ์ที่มีขนาดเล็ก เพราะการ crawl ที่ยังทำงานอยู่ย่อมมีข้อมูลให้รายงานน้อยกว่า ⚠️ ใช้ได้เฉพาะเมื่อส่ง crawl พร้อมตั้ง `store_raw_html` ไว้ มิฉะนั้นจะไม่มีอะไรให้คืน และไม่สามารถแก้ไขการ crawl ย้อนหลังได้ หากต้องการเนื้อหาที่แยกวิเคราะห์แล้วแทนซอร์ส ให้ใช้ `post_dataforseo_on_page_content_parsing` 💰 ต้นทางฟรี: การ query crawl ที่เสร็จแล้วไม่มีค่าใช้จ่าย มีแต่ตัว crawl เองเท่านั้นที่มีค่าใช้จ่าย

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

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

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

## Related links

- [Task POST](<https://docs.dataforseo.com/v3/on_page/task_post/>)
- [endpoint Instant Pages](<https://docs.dataforseo.com/v3/on_page/instant_pages/>)

## 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": {
          "id": {
            "type": "string",
            "description": "<em>ID ของงาน</em><br><strong>ฟิลด์ที่จำเป็น</strong><br>คุณสามารถรับ ID นี้ได้จากการตอบกลับของ endpoint Task POST<br>ตัวอย่าง:<br>\"07131248-1535-0216-1000-17384017ad04\""
          },
          "url": {
            "type": "string",
            "description": "<em>url ของหน้าเว็บ</em><br><strong>ฟิลด์ที่จำเป็น</strong><br>URL แบบสัมบูรณ์ของหน้าที่ต้องการขอ HTML<br><strong>หมายเหตุ:</strong> ฟิลด์นี้ไม่บังคับหากงานถูกตั้งโดยใช้ endpoint Instant Pages"
          }
        },
        "example": [
          {
            "id": "07281559-0695-0216-0000-c269be8b7592",
            "url": "https://dataforseo.com/apis"
          }
        ]
      }
    ]
  },
  "example": [
    {
      "id": "07281559-0695-0216-0000-c269be8b7592",
      "url": "https://dataforseo.com/apis"
    }
  ]
}
```

## Responses

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

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

**application/json**

Schema: object | null

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

### 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_CrawlStatusInfo

`#/components/schemas/Response36Afe1097B20_CrawlStatusInfo`

```json
{
  "type": "object",
  "properties": {
    "max_crawl_pages": {
      "type": [
        "integer",
        "null"
      ],
      "description": "จำนวนหน้าสูงสุดที่ต้องรวบรวม\n ระบุขีดจำกัด max_crawl_pages ที่คุณกำหนดเมื่อตั้งงาน",
      "format": "int64"
    },
    "pages_in_queue": {
      "type": [
        "integer",
        "null"
      ],
      "description": "จำนวนหน้าที่อยู่ในคิวการรวบรวมในขณะนี้",
      "format": "int64"
    },
    "pages_crawled": {
      "type": [
        "integer",
        "null"
      ],
      "description": "จำนวนหน้าที่รวบรวมแล้ว",
      "format": "int64"
    }
  }
}
```

### Response36Afe1097B20_OnPageRawHtmlItem

`#/components/schemas/Response36Afe1097B20_OnPageRawHtmlItem`

```json
{
  "type": "object",
  "properties": {
    "html": {
      "type": [
        "string",
        "null"
      ],
      "description": "<i>HTML_</i><i>หน้าเว็บ</i>"
    }
  }
}
```

### Response36Afe1097B20_OnPageRawHtmlResponseInfo

`#/components/schemas/Response36Afe1097B20_OnPageRawHtmlResponseInfo`

```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_OnPageRawHtmlTaskInfo"
              }
            ]
          },
          "description": "<em>อาร์เรย์ของงาน</em>"
        }
      }
    }
  ]
}
```

### Response36Afe1097B20_OnPageRawHtmlResultInfo

`#/components/schemas/Response36Afe1097B20_OnPageRawHtmlResultInfo`

```json
{
  "type": "object",
  "properties": {
    "crawl_progress": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>สถานะของเซสชันการ crawl</em><br>ค่าที่เป็นไปได้: <code>in_progress</code>, <code>finished</code>"
    },
    "crawl_status": {
      "type": [
        "object",
        "null"
      ],
      "oneOf": [
        {
          "$ref": "#/components/schemas/Response36Afe1097B20_CrawlStatusInfo"
        }
      ],
      "description": "<em>รายละเอียดของเซสชันการ crawl</em>"
    },
    "items_count": {
      "type": [
        "integer",
        "null"
      ],
      "description": "<em>จำนวนรายการในอาร์เรย์ผลลัพธ์</em>",
      "format": "int64"
    },
    "items": {
      "type": [
        "object",
        "null"
      ],
      "oneOf": [
        {
          "$ref": "#/components/schemas/Response36Afe1097B20_OnPageRawHtmlItem"
        }
      ],
      "description": "<em>ออบเจกต์ items</em>"
    }
  }
}
```

### Response36Afe1097B20_OnPageRawHtmlTaskInfo

`#/components/schemas/Response36Afe1097B20_OnPageRawHtmlTaskInfo`

```json
{
  "type": "object",
  "allOf": [
    {
      "$ref": "#/components/schemas/Response36Afe1097B20_BaseResponseTaskInfo"
    },
    {
      "type": "object",
      "properties": {
        "result": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": [
              "object",
              "null"
            ],
            "oneOf": [
              {
                "$ref": "#/components/schemas/Response36Afe1097B20_OnPageRawHtmlResultInfo"
              }
            ]
          },
          "description": "<em>อาร์เรย์ของผลลัพธ์</em>"
        }
      }
    }
  ]
}
```
