# 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>"
    }
  }
}
```
