接口
在 URL 前加上本站域名就是一次转换。批量、提取、任务和深爬需要 API key。
快速开始
# 获取原始 Markdown
curl -H "Accept: text/markdown" https://md.genedai.me/https://example.com# 获取 JSON 输出
curl "https://md.genedai.me/https://example.com?raw=true&format=json"# 批量转换
curl -X POST https://md.genedai.me/api/batch \
-H "Authorization: Bearer API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"urls":["https://example.com"]}'# 结构化提取
curl -X POST https://md.genedai.me/api/extract \
-H "Authorization: Bearer API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"strategy":"css","url":"https://example.com","schema":{"fields":[{"name":"title","selector":"h1","type":"text","required":true}]}}'# Deep Crawl
curl -X POST https://md.genedai.me/api/deepcrawl \
-H "Authorization: Bearer API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"seed":"https://example.com/docs","stream":true}'API 参考
| 路由 | |
|---|---|
GET /{url} | 将单个 URL 转为 Markdown |
GET /api/stream | 单 URL SSE 转换进度(step / done / fail) |
POST /api/batch | 最多转换 10 个 URL(需要 API_TOKEN) |
POST /api/extract | 结构化提取(css / xpath / regex) |
POST /api/jobs | 任务创建、查询、状态流与执行 |
POST /api/deepcrawl | BFS / BestFirst 深爬,支持过滤与打分 |
GET /api/health | 健康检查与运营指标 |
GET /api/og | 分享图生成 |
GET /llms.txt | AI 可读的 API 描述 |
查询参数
?raw=true | 返回原始 Markdown(不包裹 HTML) |
?format= | 输出格式 (markdown | html | text | json) |
?selector=.css | 仅提取匹配的 CSS 选择器 |
?force_browser=true | 强制使用无头浏览器渲染 |
?engine=jina|firecrawl|cf | 使用指定引擎转换(jina / firecrawl / cf) |
?no_cache=true | 绕过缓存,抓取最新内容 |
?token= | 公开 API 令牌 |
鉴权
PUBLIC_API_TOKEN 单 URL 转换与 /api/stream 支持 Bearer 或 ?token=...
API_TOKEN /api/batch、/api/extract、/api/jobs*、/api/deepcrawl 需要 API_TOKEN
响应头
X-Markdown-Method | native | readability+turndown | browser+readability+turndown | jina |
X-Cache-Status | HIT | MISS |
X-Source-URL | 原始目标 URL |