# OnPage API 微資料

**API:** Data API

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

**Tags:** DataForSEO

驗證某個已爬取 `url` 上的結構化資料。讀取已完成的爬取，因此需要 `post_dataforseo_on_page_submit` 傳回的 `id`，並傳回 `crawl_progress` 以及 `crawl_status`（`max_crawl_pages`、`pages_in_queue` 與 `pages_crawled`）——在採信偏少的結果前先檢查這些欄位，因為仍在進行的爬取能回報的內容本來就少。⚠️ 該頁面必須屬於本次爬取：請求不屬於爬取的 URL 會在 HTTP 200 內傳回 `status_code` 40406、`Requested page was not submitted for crawling`。如果要找的頁面缺失，請調大 `max_crawl_pages`，或在提交呼叫中設定 `start_url`。💰 上游免費：查詢已完成的爬取不產生費用，只有爬取本身計費。

### 計費參考

- 計量方式：依回報的回應成本計量。
- 參考請求估算：0.012 美元。
- 參考客戶倍率：1.0。不得對已結算的客戶金額再次套用。

僅供參考的中繼資料，並非帳戶報價、保證價格或消費上限。資源額度並非 Felo 額度。最終費用依 Felo 計費記錄為準。

## 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>你可以在 <a href=\"/v3/on_page/task_post/\">Task POST</a> 端點的回應中取得此 ID<br>範例：<br><code>\"07131248-1535-0216-1000-17384017ad04\"</code>"
          },
          "url": {
            "type": "string",
            "description": "<em>資源 URL</em><br><strong>必填欄位</strong><br>你可以在 <a href=\"/v3/on_page/pages/\">Pages</a> 端點的回應中取得此 URL<br>範例：<br><code>https://dataforseo.com/apis</code>"
          },
          "tag": {
            "type": [
              "string",
              "null"
            ],
            "description": "<em>使用者自訂任務識別碼</em><br>選填欄位<br><em>字元數上限為 255</em><br>可使用此參數識別任務，並將其與結果對應<br>可在回應的 <code>data</code> 物件中找到指定的 <code>tag</code> 值"
          }
        },
        "example": [
          {
            "id": "02241700-1535-0216-0000-034137259bc1",
            "url": "https://dataforseo.com/apis"
          }
        ]
      }
    ]
  },
  "example": [
    {
      "id": "02241700-1535-0216-0000-034137259bc1",
      "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_OnPageMicrodataResponseInfo"
    }
  ]
}
```

### 400 — 無法處理該要求。請檢查請求參數。

### 401 — 需要有效的 Felo API 金鑰。

### 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": "任務總費用，美元",
      "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": "任務總費用，美元",
      "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_MessageInfo

`#/components/schemas/Response36Afe1097B20_MessageInfo`

```json
{
  "type": "object",
  "properties": {
    "level": {
      "type": [
        "string",
        "null"
      ],
      "description": "錯誤層級\n可取下列值：fatal、error、warning、info"
    },
    "message": {
      "type": [
        "string",
        "null"
      ],
      "description": "與錯誤相關聯的訊息\n提供偵測到之錯誤詳細資料的訊息"
    }
  }
}
```

### Response36Afe1097B20_MicrodataFieldsInfo

`#/components/schemas/Response36Afe1097B20_MicrodataFieldsInfo`

```json
{
  "type": "object",
  "properties": {
    "name": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>欄位名稱</em><br>資料欄位的名稱"
    },
    "types": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": [
          "string",
          "null"
        ]
      },
      "description": "微資料類型清單"
    },
    "value": {
      "type": [
        "string",
        "null"
      ],
      "description": "微資料值\n目標網頁上指定的微資料值"
    },
    "test_results": {
      "type": [
        "object",
        "null"
      ],
      "oneOf": [
        {
          "$ref": "#/components/schemas/Response36Afe1097B20_MessageInfo"
        }
      ],
      "description": "<em>微資料驗證測試結果</em><br>包含偵測到的錯誤與相關訊息的微資料子類型測試結果"
    },
    "fields": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": [
          "object",
          "null"
        ],
        "oneOf": [
          {
            "$ref": "#/components/schemas/Response36Afe1097B20_MicrodataFieldsInfo"
          }
        ]
      },
      "description": "<em>微資料欄位</em><br>包含與特定微資料類型相關之資料欄位的物件陣列"
    }
  }
}
```

### Response36Afe1097B20_MicrodataInspectionInfo

`#/components/schemas/Response36Afe1097B20_MicrodataInspectionInfo`

```json
{
  "type": "object",
  "properties": {
    "types": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": [
          "string",
          "null"
        ]
      },
      "description": "<em>父層微資料類型</em><br>如需可用類型的完整清單，請前往 <a href=\"https://schema.org/docs/full.html\" rel=\"noopener noreferrer\" target=\"_blank\">schema.org</a>"
    },
    "fields": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": [
          "object",
          "null"
        ],
        "oneOf": [
          {
            "$ref": "#/components/schemas/Response36Afe1097B20_MicrodataFieldsInfo"
          }
        ]
      },
      "description": "<em>微資料欄位</em><br>包含與特定微資料類型相關之資料欄位的物件陣列"
    }
  }
}
```

### Response36Afe1097B20_OnPageMicrodataInfoItem

`#/components/schemas/Response36Afe1097B20_OnPageMicrodataInfoItem`

```json
{
  "type": "object",
  "properties": {
    "type": {
      "type": [
        "string",
        "null"
      ],
      "description": "元素類型"
    },
    "inspection_info": {
      "type": [
        "object",
        "null"
      ],
      "oneOf": [
        {
          "$ref": "#/components/schemas/Response36Afe1097B20_MicrodataInspectionInfo"
        }
      ],
      "description": "<em>與微資料驗證相關的資訊</em>"
    }
  }
}
```

### Response36Afe1097B20_OnPageMicrodataResponseInfo

`#/components/schemas/Response36Afe1097B20_OnPageMicrodataResponseInfo`

```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_OnPageMicrodataTaskInfo"
              }
            ]
          },
          "description": "<em>任務陣列</em>"
        }
      }
    }
  ]
}
```

### Response36Afe1097B20_OnPageMicrodataResultInfo

`#/components/schemas/Response36Afe1097B20_OnPageMicrodataResultInfo`

```json
{
  "type": "object",
  "properties": {
    "crawl_progress": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>擷取工作階段的狀態</em><br>可能的值：<code>in_progress</code>、<code>finished</code>"
    },
    "crawl_status": {
      "type": [
        "object",
        "null"
      ],
      "oneOf": [
        {
          "$ref": "#/components/schemas/Response36Afe1097B20_CrawlStatusInfo"
        }
      ],
      "description": "<em>擷取工作階段的詳細資料</em>"
    },
    "test_summary": {
      "type": [
        "object",
        "null"
      ],
      "oneOf": [
        {
          "$ref": "#/components/schemas/Response36Afe1097B20_TestSummary"
        }
      ],
      "description": "<em>微資料驗證測試結果</em>"
    },
    "items_count": {
      "type": [
        "integer",
        "null"
      ],
      "description": "<em>結果陣列中的項目數</em>",
      "format": "int64"
    },
    "items": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": [
          "object",
          "null"
        ],
        "oneOf": [
          {
            "$ref": "#/components/schemas/Response36Afe1097B20_OnPageMicrodataInfoItem"
          }
        ]
      },
      "description": "<em>項目陣列</em>"
    }
  }
}
```

### Response36Afe1097B20_OnPageMicrodataTaskInfo

`#/components/schemas/Response36Afe1097B20_OnPageMicrodataTaskInfo`

```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_OnPageMicrodataResultInfo"
              }
            ]
          },
          "description": "<em>結果陣列</em>"
        }
      }
    }
  ]
}
```

### Response36Afe1097B20_TestSummary

`#/components/schemas/Response36Afe1097B20_TestSummary`

```json
{
  "type": "object",
  "properties": {
    "fatal": {
      "type": [
        "integer",
        "null"
      ],
      "description": "<em>致命微資料錯誤數量</em>"
    },
    "error": {
      "type": [
        "integer",
        "null"
      ],
      "description": "<em>嚴重微資料錯誤數量</em>"
    },
    "warning": {
      "type": [
        "integer",
        "null"
      ],
      "description": "<em>微資料警告數量</em>"
    },
    "info": {
      "type": [
        "integer",
        "null"
      ],
      "description": "<em>微資料資訊標記數量</em>"
    }
  }
}
```
