<!-- 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 -->

# 网页正文提取

> 从新闻、博客、公众号等网页抽取主体正文，自动去除导航/侧栏/广告/评论。基于文本密度算法，同时返回标题、发布时间、配图列表、字数与预估阅读时长。

## 1. 基本信息

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

## 2. 认证

匿名免登录可调每日 20 次；登录用户每日 100 次。

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

## 3. 请求参数

| 参数 | 类型 | 必填 | 说明 | 示例 |
| --- | --- | --- | --- | --- |
| `url` | `string` | 是 | 目标网页 URL | — |

## 5. 请求示例 (cURL)

```bash
curl "https://v1.apizero.cn/api/content-extract?url=%3Curl%3E&key=YOUR_API_KEY"
```

## 6. 响应字段

| 字段 | 类型 | 说明 | 示例 |
| --- | --- | --- | --- |
| `title` | `string` | 文章标题 | — |
| `publish_time` | `string` | 发布时间（来源于 meta/time 标签） | — |
| `content` | `string` | 提取的正文（含 markdown 风格的标题） | — |
| `word_count` | `number` | 字数（不含空白） | — |
| `reading_time` | `string` | 预估阅读时长 | — |
| `images` | `array` | 配图 URL 列表 | — |

## 7. 响应示例

```json
{
    "code": 0,
    "msg": "成功",
    "data": {
        "title": "示例文章标题",
        "publish_time": "2024-01-15",
        "content": "...",
        "word_count": 2300,
        "reading_time": "5分钟",
        "image_count": 3,
        "images": [
            "https:\/\/..."
        ]
    }
}
```

## 8. 错误码

| code | status | 说明 |
| --- | --- | --- |
| `4000` | `—` | url 为空 / 格式错误 / 内网地址 |
| `5020` | `—` | 目标网页无法访问 |

## 9. 变更日志

- **1.0.0** (2026-05-07)
  - 首次上线 · 文本密度算法

---

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

Source: `https://apizero.cn/aidocs/content-extract/raw.md`
Last updated: 2026-05-11T20:45:07+08:00
