> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pubrio.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 云足迹洞察

> 一次调用读取单家公司的完整云足迹，并获取值得跟进的变化标记：迁移主机、新云、新区域与测试环境。

[云足迹洞察](/cn/api-reference/endpoint/companies/cloud_footprints_insights) 接收一家公司，返回它的完整云足迹：总量、主要服务商、国家与区域、每周新增的主机数、最新主机，以及**标记** —— 值得跟进的变化。

使用[云足迹搜索](/cn/developer-guides/search/cloud-footprint-search)构建公司名单。想了解其中某家公司的全貌时，使用洞察。

## 开始之前

你需要该公司的 `domain_search_id`。云足迹搜索、公司搜索与公司查询返回的每条记录都带有它。

```bash cURL theme={null}
curl -X POST https://api.pubrio.com/companies/cloud_footprints/search \
  -H "pubrio-api-key: $PUBRIO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "domains": ["platform9.com"], "per_page": 1 }'
```

从第一条记录中取出 `domain_search_id`。

## 请求

```bash cURL theme={null}
curl -X POST https://api.pubrio.com/companies/cloud_footprints/insights \
  -H "pubrio-api-key: $PUBRIO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "domain_search_id": "a8064391-03c6-4ed2-91b0-217a9f89d418" }'
```

| 键 | 必填 | 含义 |
| - | - | - |
| `domain_search_id` | 是 | 目标公司。 |
| `date_from` | 否 | 日期窗口的起始，`YYYY-MM-DD`。 |
| `date_to` | 否 | 日期窗口的结束，`YYYY-MM-DD`。 |

不传日期时，窗口为最近 90 天。你的套餐可能会限制 `date_from` 能往前追溯多远。

## 返回内容

| 键 | 说明 | 随日期窗口变化？ |
| - | - | - |
| `totals` | 主机、服务器、服务商、国家、跨境国家与区域的总数 | 仅 `new_hosts` |
| `providers` | 前 8 个服务商 | 否 |
| `countries` | 前 8 个国家，每项带有 `evidence_url` | 否 |
| `regions` | 前 8 个云区域 | 否 |
| `weekly_series` | 每周首次发现的主机数 | 是 |
| `recent_hosts` | 最多 12 个最新主机，每个主机一条 | 是 |
| `window_days` | 窗口的天数，包含首尾两天 | — |
| `flags` | 值得跟进的变化 | 是 |

**主机**是公司运行的具名地址，例如 `api.example.com`。**服务器**是这些主机背后的不同 IP 地址。排行列表先按服务器数、再按主机数排序。

`weekly_series` 的每周从周一开始，按你的工作区时区计算。

## 标记

标记把足迹变成可以跟进的线索。共有五个列表。每个列表最多 8 项，最新的在前，每项都列出你可以自行核实的真实主机。

| 标记 | 含义 | 为何重要 |
| - | - | - |
| `moved_hosts` | 某个主机现在从不同的服务商、国家或区域响应。 | 公司正在迁移或搬迁。 |
| `twin_hosts` | 同一服务同时运行在两个云上，其中一个是最近新增的。 | 多云部署或迁移正在进行。 |
| `test_hosts` | 在公司主要服务商以外的云上出现新的开发、测试、预发布或概念验证主机。 | 公司正在试用新的云。这是最早的信号。 |
| `new_providers` | 公司此前从未使用过的服务商。 | 新的供应商关系。 |
| `new_regions` | 公司已在使用的服务商上出现新区域或新国家。 | 向新的地域扩张。 |

每次请求时，所有标记都会重新检查。已经撤回的变化会被剔除。

### 迁移主机

```json theme={null}
{
  "host": "onemindservices-new-jersey-prod.app.pcd.platform9.com",
  "is_provider_change": true,
  "from": { "provider": "AWS", "country_code": "US", "cloud_region": "us-west-2", "city": "Portland", "region_name": "Oregon", "first_seen_at": "2026-07-22T12:07:12.918787", "last_seen_at": "2026-07-22T12:19:41.499986" },
  "to": { "provider": "OCI", "country_code": "US", "cloud_region": "us-phoenix-1", "city": "Phoenix", "region_name": "Phoenix", "first_seen_at": "2026-09-13T16:07:26.248556", "last_seen_at": "2026-09-14T09:41:19.500363" },
  "is_live_confirmed": true
}
```

这个生产主机离开了俄勒冈的 AWS，现在运行在凤凰城的 Oracle Cloud 上。

* 服务商发生变化时，`is_provider_change` 为 `true`。仅国家或区域变化时为 `false`。
* 主机当前从 `to` 响应时，`is_live_confirmed` 为 `true`。主机已离开 `from` 但无法确认新位置时为 `false`。

### 双云主机

```json theme={null}
{
  "service": "du.testbed.only.app.pcd",
  "providers": ["AWS", "OCI"],
  "new_provider": "AWS",
  "first_seen_at": "2026-07-21T11:59:25.286744",
  "new_provider_first_seen_at": "2026-09-10T09:23:35.767165",
  "hosts": [
    { "host": "test-du-testbed-only-5113915.app.qa-pcd.platform9.com", "provider": "AWS", "country_code": "US", "cloud_region": "us-west-2", "city": "Portland", "region_name": "Oregon", "first_seen_at": "2026-09-10T09:23:35.767165" },
    { "host": "test-du-testbed-only-5114083.app.qa-pcd.platform9.com", "provider": "OCI", "country_code": "US", "cloud_region": "us-phoenix-1", "city": "Phoenix", "region_name": "Phoenix", "first_seen_at": "2026-09-10T11:53:10.757998" }
  ]
}
```

* `service` 是这些主机共用的名称。
* `providers` 列出该服务正在运行的云，最新的在前。`new_provider` 是最新的那个。
* `hosts` 为每个云给出一个在线主机，最多 3 个。

### 测试主机

```json theme={null}
{
  "host": "iam-dev.platform.ea.com",
  "tags": ["dev"],
  "is_poc": false,
  "primary_provider": "AWS",
  "first_seen_at": "2026-09-06T08:13:54.048967",
  "places": [
    { "provider": "GCP", "country_code": "US", "cloud_region": "us-central1", "city": "Council Bluffs", "region_name": "Iowa" }
  ]
}
```

一家以 AWS 为主的公司，在 Google Cloud 上出现了新的开发主机。

* `tags` 是主机名中表明其为非生产环境的词。
* 主机名表明为概念验证或试点时，`is_poc` 为 `true`。这些项排在最前。
* `places` 是主机当前在线的位置。它从不包含 `primary_provider`。

### 新服务商

```json theme={null}
{
  "provider": "Equinix Metal",
  "first_seen_at": "2026-09-14T02:08:27.707494",
  "host_count": 1,
  "hosts": [
    { "host": "hnjobs.cncf.io", "provider": "Equinix Metal", "country_code": "US", "cloud_region": null, "city": "Parsippany", "region_name": null, "first_seen_at": "2026-09-14T02:08:27.707494" }
  ]
}
```

* `host_count` 是公司当前在该服务商上的主机数。
* `hosts` 给出最多 3 个在线主机作为佐证。

### 新区域

```json theme={null}
{
  "provider": "AWS",
  "country_code": "US",
  "cloud_region": "us-west-1",
  "city": "San Jose",
  "region_name": "N. California",
  "first_seen_at": "2026-09-09T22:44:04.868704",
  "host_count": 1,
  "hosts": [
    { "host": "mx.experience.zoom.us", "provider": "AWS", "country_code": "US", "cloud_region": "us-west-1", "city": "San Jose", "region_name": "N. California", "first_seen_at": "2026-09-09T22:44:04.868704" }
  ]
}
```

该服务商在窗口开始前就已在使用，只有区域是新的。当 `cloud_region` 为 `null` 时，该标记表示该服务商上的新国家。

### 标记为空时

* **`flags` 为 `null`**。该公司的标记尚未就绪。响应的其余部分仍然完整。
* **某个列表为 `null`**。该列表在本次调用中无法生成。其他列表仍然有效。请稍后重试。
* **`is_spam_flood` 为 `true`**。该公司的主机名噪声过多，无法生成标记，因此所有列表均为空。
* **某个列表为 `[]`**。窗口内没有匹配项。`twin_hosts`、`test_hosts`、`new_providers` 与 `new_regions` 只有在 Pubrio 追踪该公司满 90 天后才会把变化视为新增，因此最近才开始追踪的公司会返回空列表。

## 示例

<Tabs>
  <Tab title="谁在撤离某个云">
    ```bash cURL theme={null}
    curl -s -X POST https://api.pubrio.com/companies/cloud_footprints/insights \
      -H "pubrio-api-key: $PUBRIO_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{ "domain_search_id": "a8064391-03c6-4ed2-91b0-217a9f89d418" }' \
    | jq '.data.flags.moved_hosts[] | select(.is_provider_change) | {host, from: .from.provider, to: .to.provider}'
    ```

    只保留服务商之间的迁移。大量主机迁离同一个服务商，说明正在进行迁移。
  </Tab>

  <Tab title="指定窗口内的变化">
    ```bash cURL theme={null}
    curl -s -X POST https://api.pubrio.com/companies/cloud_footprints/insights \
      -H "pubrio-api-key: $PUBRIO_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "domain_search_id": "a8064391-03c6-4ed2-91b0-217a9f89d418",
        "date_from": "2026-08-01",
        "date_to": "2026-08-31"
      }'
    ```

    `new_hosts`、`weekly_series`、`recent_hosts` 以及所有标记现在只覆盖 8 月。总量与排行列表不变。
  </Tab>

  <Tab title="统计每类标记">
    ```bash cURL theme={null}
    curl -s -X POST https://api.pubrio.com/companies/cloud_footprints/insights \
      -H "pubrio-api-key: $PUBRIO_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{ "domain_search_id": "a8064391-03c6-4ed2-91b0-217a9f89d418" }' \
    | jq '.data.flags | if . == null then "not ready" else with_entries(select(.value | type == "array") | .value |= length) end'
    ```

    快速查看哪些标记有内容，再决定读取哪些详情。
  </Tab>
</Tabs>

## 需要注意

* 在两个国家都有部署的公司会同时计入两个国家的条目，因此排行列表之和可能大于 `totals`。
* 当公司总部未知时，`is_cross_border` 为 `null`——表示未知，而非本土。

## 相关内容

<CardGroup cols={2}>
  <Card title="云足迹洞察接口" icon="code" href="/cn/api-reference/endpoint/companies/cloud_footprints_insights">
    全部请求参数与响应字段。
  </Card>

  <Card title="云足迹搜索" icon="cloud" href="/cn/developer-guides/search/cloud-footprint-search">
    按服务商、国家、区域与规模构建公司名单。
  </Card>

  <Card title="设置 webhooks" icon="webhook" href="/cn/developer-guides/setting-up-webhooks">
    将云足迹变化推送到 webhook 或邮件。
  </Card>
</CardGroup>
