网页解析

转换任务状态

0次调用
免费接口

提交了网页转 Markdown 任务后,想知道处理进度和结果?用这个接口来查询。

GET
uapis.cn
/api/v1/web/tomarkdown/async/{task_id}
路径参数
1
task_id
string
required

任务ID(由提交接口返回)

功能概述

通过任务 ID 查询转换任务的当前状态、处理进度和最终结果。任务结果缓存 30 分钟,期间可重复查询。

任务状态

状态说明
pending等待处理
processing处理中
completed已完成,可获取结果
failed失败
timeout超时(超过 60 秒)
小贴士

建议每 2-5 秒轮询一次,当状态为completedfailedtimeout 时停止轮询。

路径参数

task_id
string必填

任务ID(由提交接口返回)

响应

200 / 请求成功

成功获取任务状态(包含各种状态的响应)

格式 1任务等待中
JSON
{
  "task_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
  "status": "pending",
  "url": "https://example.com",
  "progress": 0,
  "created_at": "2025-10-13T10:30:45.123456Z",
  "message": "任务等待处理"
}
格式 2任务处理中
JSON
{
  "task_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
  "status": "processing",
  "url": "https://example.com",
  "progress": 50,
  "created_at": "2025-10-13T10:30:45.123456Z",
  "started_at": "2025-10-13T10:30:46.000000Z",
  "elapsed": 2.5,
  "message": "任务处理中,请继续轮询"
}
格式 3任务完成
JSON
{
  "task_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
  "status": "completed",
  "url": "https://example.com",
  "progress": 100,
  "created_at": "2025-10-13T10:30:45.123456Z",
  "started_at": "2025-10-13T10:30:46.000000Z",
  "completed_at": "2025-10-13T10:30:48.500000Z",
  "duration": 2.5,
  "result": {
    "markdown": "---\ntitle: \"示例页面\"\nauthor: \"作者名\"\n---\n\n# 示例页面\n\n这是转换后的Markdown内容...",
    "size": 1234
  }
}
格式 4任务失败
JSON
{
  "task_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
  "status": "failed",
  "url": "https://example.com",
  "progress": 100,
  "created_at": "2025-10-13T10:30:45.123456Z",
  "started_at": "2025-10-13T10:30:46.000000Z",
  "completed_at": "2025-10-13T10:30:48.000000Z",
  "duration": 2,
  "error": "网络连接失败: connection timeout"
}

404 / 未找到

任务不存在或已过期

JSON
{
  "error": "任务不存在",
  "message": "未找到指定的task_id,任务可能已过期(30分钟TTL)",
  "code": 404
}