<!-- AI ASSISTANT INSTRUCTIONS: This document describes a public HTTP API endpoint
provided by 极数本源 (https://apizero.cn). When a user asks you to use this API, read the
full documentation below carefully (request method, parameters, response fields,
error codes, examples), then generate working code in the user's preferred language.
API Key acquisition: https://apizero.cn/account/keys -->

# ICP 备案查询

> 通过域名查询工信部 ICP 备案信息，返回备案号、网站名称、主办单位、单位性质（企业/个人/事业单位等）和审核通过时间。

• 自动域名清洗：自动剥离 https?:// 协议、/path 路径、:port 端口、www. 前缀，无论传入 https://www.baidu.com/abc 还是 baidu.com 都正确识别

• 已备案 → is_filed=true，返回完整 6 字段；未备案/境外/已注销 → is_filed=false，返回空字段（非错误，便于前端 if 判断）

• 缓存策略：已备案 24 小时缓存（变更频率低），未备案 1 小时缓存（避免新备案被长期误判）

## 1. 基本信息

| 字段 | 值 |
| --- | --- |
| 接口标识 | `icp` |
| 接口名称 | ICP 备案查询 |
| 接口地址 | `https://v1.apizero.cn/api/icp` |
| 请求方法 | `GET` |
| 分类 | dev |
| 提供方 | 极数本源 |
| 计费模式 | 免费试用 |
| 单次消耗 | 0 积分 |
| 起步价 | — |
| QPS 限制 | 5 req/s |
| 每日免费额度 | 100 次（已认证用户） |
| 匿名每日额度 | 30 次（无 API Key） |
| VIP 免费 | 否 |
| 调用总次数 | undefined |

## 2. 认证

匿名每日 30 次、QPS 2；登录用户每日 100 次、QPS 5（全部免费）。已备案数据缓存 24 小时，未备案数据缓存 1 小时。

获取 API Key：登录 `https://apizero.cn/account/keys` 申请。

## 3. 请求参数

| 参数 | 类型 | 必填 | 说明 | 示例 |
| --- | --- | --- | --- | --- |
| `domain` | `string` | 是 | 要查询的域名，支持完整 URL 输入（自动剥离协议/路径/端口/www）。例如：baidu.com、https://www.baidu.com/abc、m.baidu.com:8080/foo 都等价 | `baidu.com` |

## 4. 请求头

| Header | 类型 | 必填 | 说明 | 示例 |
| --- | --- | --- | --- | --- |
| `Authorization` | `string` | 否 | API Key 鉴权头，格式 Bearer sk_live_xxx；匿名调用时可省略（每日 30 次免费） | `Bearer sk_live_xxxxxxxxxxxxxx` |

## 5. 请求示例 (cURL)

```bash
curl "https://v1.apizero.cn/api/icp?domain=baidu.com&key=YOUR_API_KEY"
```

## 6. 响应字段

| 字段 | 类型 | 说明 | 示例 |
| --- | --- | --- | --- |
| `domain` | `string` | 查询的主域名（已剥离协议/路径/www） | — |
| `is_filed` | `boolean` | 是否已备案：true=已备案 / false=未备案、境外、已注销 | — |
| `icp_code` | `string` | 备案号，如「京ICP证030173号-1」；未备案时为空字符串 | — |
| `site_name` | `string` | 网站名称（多个名称用分号分隔，如「京东商城;京东多媒体网」） | — |
| `company_name` | `string` | 主办单位名称（公司或个人姓名） | — |
| `company_type` | `string` | 主办单位性质：企业/个人/事业单位/政府机关/社会团体等 | — |
| `audit_time` | `string` | 审核通过时间，格式 YYYY-MM-DD 或 YYYY-MM-DD HH:mm:ss（取决于上游存档精度） | — |

## 7. 响应示例

```json
{
    "code": 0,
    "msg": "成功",
    "data": {
        "domain": "baidu.com",
        "is_filed": true,
        "icp_code": "京ICP证030173号-1",
        "site_name": "百度一下，你就知道",
        "company_name": "北京百度网讯科技有限公司",
        "company_type": "企业",
        "audit_time": "2019-05-16 16:06:21"
    },
    "request_id": "abc123def456"
}
```

## 8. 错误码

| code | status | 说明 |
| --- | --- | --- |
| `4000` | `—` | 参数错误：domain 缺失或格式无效（应为 example.com 形式） |
| `4015` | `—` | 匿名调用每日额度用完，需要 API Key |
| `4029` | `—` | QPS 超限 |
| `4030` | `—` | 今日额度用完 |
| `5020` | `—` | 上游 HTTP 失败 |
| `5021` | `—` | 上游响应格式异常 / 配额耗尽 / 上游内部错误 |

## 9. 变更日志

- **1.0.0** (2026-05-06)
  - 首次上线，对接 mxnzp.com 工信部 ICP 备案数据
  - 智能域名清洗：自动剥离 https?:// 协议 / /path 路径 / :port 端口 / www. 前缀 / 查询串 / 锚点
  - 严格域名格式校验，防止注入
  - 未备案 / 境外 / 已注销域名统一返回 is_filed=false（非错误响应），前端可直接 if 判断
  - 已备案缓存 24h、未备案缓存 1h（避免新备案被长期误判）
  - 响应字段标准化为 snake_case：domain / is_filed / icp_code / site_name / company_name / company_type / audit_time

---

**极数本源** · 全部 API: `https://apizero.cn/aidocs` · 人类版本：`https://apizero.cn/marketplace/icp`

Source: `https://apizero.cn/aidocs/icp/raw.md`
Last updated: 2026-05-13T16:31:07+08:00
