web/extract
基于 AI 的网页内容提取,自动识别正文、标题、作者等信息。
接口详情
POST
https://api123.codenews.cc/v1/extract请求参数
| 参数名 | 类型 | 必填 | 默认值 | 描述 |
|---|---|---|---|---|
| url | string | 是 | - | 目标网页 URL |
| format | string | 否 | markdown | 输出格式 (markdown/text/html) |
代码示例
请将 $API_KEY 替换为您在控制台申请的真实 API Key。
curl -X POST https://api123.codenews.cc/v1/extract \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $API_KEY" \
-d '{"url": "https://example.com"}'响应示例
{
"title": "Example Page",
"content": "# Hello World\nThis is extracted content.",
"url": "https://example.com"
}错误码
| 状态码 | 说明 |
|---|---|
| 400 | 无效的 URL |
| 422 | 无法提取该网页内容 |