# OnPage API 摘要

**API:** Data API

**Endpoint:** `GET /v1/beta/dataforseo/on_page/summary/{id}`

**Tags:** DataForSEO

依 `id` 取得某次爬取的狀態與概要指標。傳回 `crawl_progress`、`crawl_status`、`crawl_gateway_address`、`crawl_stop_reason`、`domain_info` 與 `page_metrics`。採用 DataForSEO 的信封結構：資料位於 `tasks[0].result`，結果狀態位於 `tasks[0].status_code`——被拒絕的請求仍會回傳 HTTP 200。**這也是判斷爬取是否完成的方式**——在讀取此處任何其他端點之前，先輪詢直到 `crawl_progress` 為 `finished`，否則你會讀到看似真實的局部結果。💰 上游免費：查詢已完成的爬取不產生費用，只有爬取本身計費。

### 計費參考

- 計量方式：依回報的回應成本計量。
- 參考請求估算：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`)

## Parameters

| Name | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| `id` | path | yes | string | <em>任務識別碼</em><br><strong>必填欄位</strong><br>你可以在 <a href="/v3/on_page/task_post/" target="_blank" rel="noopener noreferrer">Task POST</a> 端點的回應中取得此 ID<br>範例：<br>“07131248-1535-0216-1000-17384017ad04” |

## Responses

### 200 — 操作成功

Headers:
- `X-Request-Id` (string) — 聯絡 Felo 支援時需提供的請求識別碼。

**application/json**

Schema: object | null

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

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

`#/components/schemas/Response36Afe1097B20_DomainInfo`

```json
{
  "type": "object",
  "properties": {
    "name": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>網域名稱</em>"
    },
    "cms": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>內容管理系統</em><br>網站上識別到的內容管理系統<br><code>generator</code> 中繼標籤的內容<br>資料取自第一個傳回 200 回應碼的隨機頁面<br>如果我們的檢索器無法識別內容管理系統，該值將為 <code>null</code>"
    },
    "ip": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>網域 IP 位址</em>"
    },
    "server": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>網站伺服器</em><br>網站上偵測到的伺服器版本<br><code class=\"prettyprint\">server</code> 標頭的內容<br>資訊取自回應碼為 200 的第一個頁面"
    },
    "crawl_start": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>檢索開始時間</em><br>網站被送出檢索的日期與時間<br>採用 UTC 格式：“yyyy-mm-dd hh-mm-ss +00:00”<br>範例：<br><code class=\"long-string\">2019-11-15 12:57:46 +00:00</code>"
    },
    "crawl_end": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>檢索結束時間</em><br>檢索完成的日期與時間<br>採用 UTC 格式：“yyyy-mm-dd hh-mm-ss +00:00”<br>範例：<br><code class=\"long-string\">2019-11-15 12:57:46 +00:00</code><br><strong>注意：</strong>僅在 <code>\"crawl_progress\"</code> 為 <code>\"finished\"</code> 時提供有效資訊<br>如果 <code>\"crawl_progress\"</code> 為 <code>in_progress</code>，該值將為 <code>null</code>"
    },
    "extended_crawl_status": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>檢索狀態與錯誤</em><br>表示網站未被檢索的原因；<br>可取下列值：<br><code>no_errors</code>：未偵測到檢索錯誤；<br><code>site_unreachable</code>：我們的檢索器無法觸及網站，因而無法取得狀態碼；<br><code>invalid_page_status_code</code>：首個被檢索頁面的狀態碼 &gt;= 400；<br><code>forbidden_meta_tag</code>：首個被檢索頁面含有 &lt;meta robots=\"noindex\"&gt; 標籤；<br><code>forbidden_robots</code>：robots.txt 禁止檢索該頁面；<br><code>forbidden_http_header</code>：頁面的 HTTP 標頭含有 \"X-Robots-Tag: noindex\" ；<br><code>too_many_redirects</code>：首個被檢索頁面有超過 10 次重新導向；<br><code>unknown</code>：原因未知"
    },
    "ssl_info": {
      "type": [
        "object",
        "null"
      ],
      "oneOf": [
        {
          "$ref": "#/components/schemas/Response36Afe1097B20_SslInfo"
        }
      ],
      "description": "<em>SSL 憑證資訊</em><br>網站上偵測到的安全通訊協定資訊"
    },
    "checks": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": {
        "type": [
          "boolean",
          "null"
        ]
      },
      "description": "<em>網站檢查</em><br>與網站相關的其他頁面內檢查"
    },
    "total_pages": {
      "type": [
        "integer",
        "null"
      ],
      "description": "<em>已檢索頁面總數</em><br>已檢索頁面的總數",
      "format": "int64"
    },
    "total_uncrawlable_resources": {
      "type": [
        "integer",
        "null"
      ],
      "description": "<em>無法檢索資源總數</em><br>無法檢索的資源總數；<br>當資源的實際內容類型與檢索器預期的內容類型不符時，該資源即視為無法檢索",
      "format": "int64"
    },
    "page_not_found_status_code": {
      "type": [
        "integer",
        "null"
      ],
      "description": "<em>不存在的頁面傳回的狀態碼</em><br>大多數情況下，建議伺服器傳回 404 回應碼"
    },
    "canonicalization_status_code": {
      "type": [
        "integer",
        "null"
      ],
      "description": "<em>標準化頁面傳回的狀態碼</em><br>我們的檢索器嘗試透過 IP 存取網站時對伺服器行為的檢查；<br>大多數情況下，建議標準化頁面傳回 <code>301</code> 或 <code>302</code> 狀態碼"
    },
    "directory_browsing_status_code": {
      "type": [
        "integer",
        "null"
      ],
      "description": "<em>目錄傳回的狀態碼</em><br>目標網站上目錄頁面傳回的狀態碼<br>大多數情況下，建議目錄傳回 <code>403</code> 或 <code>401</code> 狀態碼"
    },
    "www_redirect_status_code": {
      "type": [
        "integer",
        "null"
      ],
      "description": "<em>重新導向狀態碼</em><br>www 至非 www 重新導向的狀態碼<br>大多數情況下，建議該重新導向傳回 <code>301</code> 狀態碼"
    },
    "main_domain": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>根網域名稱</em>"
    }
  }
}
```

### Response36Afe1097B20_OnPageSummaryResponseInfo

`#/components/schemas/Response36Afe1097B20_OnPageSummaryResponseInfo`

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

### Response36Afe1097B20_OnPageSummaryResultInfo

`#/components/schemas/Response36Afe1097B20_OnPageSummaryResultInfo`

```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>"
    },
    "crawl_gateway_address": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>爬蟲 IP 位址</em><br>顯示爬蟲用於發起目前擷取工作階段的 IP 位址<br>您可以在<a href=\"/v3/on_page/overview\" target=\"_blank\" rel=\"noopener noreferrer\">概覽部分</a>找到我們的爬蟲使用的完整 IP 清單"
    },
    "crawl_stop_reason": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>擷取停止的原因</em><br>有關擷取程序停止原因的資訊；<br>可能的值：<br><code>limit_exceeded</code> - 超過 <code>max_crawl_pages</code> 中設定的限制；<br><code>empty_queue</code> - 佇列中的所有 URL 皆已擷取；<br><code>force_stopped</code> - 使用<a href=\"/v3/on_page/force_stop\" target=\"_blank\" rel=\"noopener noreferrer\"> On Page API Force Stop</a> 功能中止擷取程序；<br><code>unexpected_exception</code> - 擷取 <code>target</code> 時發生內部錯誤，請聯絡支援團隊以取得更多資訊"
    },
    "domain_info": {
      "type": [
        "object",
        "null"
      ],
      "oneOf": [
        {
          "$ref": "#/components/schemas/Response36Afe1097B20_DomainInfo"
        }
      ],
      "description": "<em>網域範圍資訊</em><br>有關目標網域與擷取程序的頁面資訊"
    },
    "page_metrics": {
      "type": [
        "object",
        "null"
      ],
      "oneOf": [
        {
          "$ref": "#/components/schemas/Response36Afe1097B20_PageMetrics"
        }
      ],
      "description": "<em>頁面特定資訊</em><br>目標網站頁面的指標資訊"
    }
  }
}
```

### Response36Afe1097B20_OnPageSummaryTaskInfo

`#/components/schemas/Response36Afe1097B20_OnPageSummaryTaskInfo`

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

### Response36Afe1097B20_PageMetrics

`#/components/schemas/Response36Afe1097B20_PageMetrics`

```json
{
  "type": "object",
  "properties": {
    "links_external": {
      "type": [
        "integer",
        "null"
      ],
      "description": "<em>外部連結數</em><br>指向其他網站的連結數"
    },
    "links_internal": {
      "type": [
        "integer",
        "null"
      ],
      "description": "<em>內部連結數</em><br>指向目標網站內其他頁面的連結數"
    },
    "duplicate_title": {
      "type": [
        "integer",
        "null"
      ],
      "description": "<em>標題重複的頁面數</em>"
    },
    "duplicate_description": {
      "type": [
        "integer",
        "null"
      ],
      "description": "<em>描述重複的頁面數</em>"
    },
    "duplicate_content": {
      "type": [
        "integer",
        "null"
      ],
      "description": "<em>內容重複的頁面數</em>"
    },
    "broken_links": {
      "type": [
        "integer",
        "null"
      ],
      "description": "<em>損壞連結數</em><br>目標網站所有已擷取頁面中的損壞連結數"
    },
    "broken_resources": {
      "type": [
        "integer",
        "null"
      ],
      "description": "<em>損壞資源數</em><br>連結損壞的圖片與其他資源數量"
    },
    "links_relation_conflict": {
      "type": [
        "integer",
        "null"
      ],
      "description": "<em>目標網站上可能發生衝突的連結數</em><br>例如，如果 <code>\"links_relation_conflict\": 2</code>，則目標網站透過至少一個帶有 <code>rel=\"nofollow\"</code> 屬性的內部連結<strong>以及</strong>至少一個 dofollow 連結引用同一來源"
    },
    "redirect_loop": {
      "type": [
        "integer",
        "null"
      ],
      "description": "<em>起點與終點 URL 相同的重新導向鏈數</em><br>目標 URL 重新導向回原始 URL 的重新導向鏈數量"
    },
    "onpage_score": {
      "type": [
        "number",
        "null"
      ],
      "description": "<em>以 100 分制顯示網站最佳化情況</em><br>此欄位顯示在考量偵測到的重大頁面問題與警告後網站的最佳化情況；<br><code>100</code> 是可能的最高分，表示網站沒有任何重大頁面問題與重要警告；<br><strong>注意</strong>，此值取決於已擷取的頁面數；<br>如需瞭解此指標的計算方式，請參閱<a href=\"https://dataforseo.com/help-center/how-is-onpage-score-of-a-domain-calculated\" target=\"_blank\" rel=\"noopener noreferrer\">這篇說明中心文章</a>"
    },
    "non_indexable": {
      "type": [
        "integer",
        "null"
      ],
      "description": "<em>無法被索引的頁面數</em><br>因 robots.txt、HTTP 標頭或 meta 標籤設定而被 Google 及其他搜尋引擎阻止索引的頁面數；<br>您可以使用<a href=\"https://docs.dataforseo.com/v3/on_page/non_indexable/?bash\" target=\"_blank\" rel=\"noopener noreferrer\">此端點</a>取得無法被索引的 URL 清單"
    },
    "checks": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": {
        "type": [
          "integer",
          "null"
        ],
        "format": "int64"
      },
      "description": "<em>頁面特定的頁面檢查</em>"
    }
  }
}
```

### Response36Afe1097B20_SslInfo

`#/components/schemas/Response36Afe1097B20_SslInfo`

```json
{
  "type": "object",
  "properties": {
    "valid_certificate": {
      "type": [
        "boolean",
        "null"
      ],
      "description": "<em>SSL 憑證有效期限</em><br>指出網站上偵測到的 SSL 憑證是否未過期、未暫停、未撤銷且有效"
    },
    "certificate_issuer": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>SSL 憑證頒發機構</em><br>簽發偵測到的 SSL 憑證的實體"
    },
    "certificate_subject": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>SSL 憑證主體</em><br>與公開金鑰建立關聯的實體"
    },
    "certificate_version": {
      "type": [
        "integer",
        "null"
      ],
      "description": "<em>SSL 憑證版本</em><br>指出 SSL 憑證使用的 <a href=\"https://en.wikipedia.org/wiki/X.509\" target=\"_blank\" rel=\"noopener noreferrer\">X.509</a> 版本"
    },
    "certificate_hash": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>SSL 憑證雜湊</em><br>SSL 憑證雜湊函式的版本"
    },
    "certificate_expiration_date": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>SSL 憑證到期日</em><br>SSL 憑證到期的日期與時間<br>採用 UTC 格式：“yyyy-mm-dd hh-mm-ss +00:00”<br>範例：<br><code class=\"long-string\">2019-11-15 12:57:46 +00:00</code>"
    }
  }
}
```
