API Reference
Base URL https://api.leancrawl.com · every endpoint takes
Authorization: Bearer ac-… and returns one envelope:
sync {success:true, data, credit_cost} · async {success:true, data:{job_id, status_url}} (202) ·
error {success:false, error:{code,message}}.
Machine-readable spec: openapi.json.
capture
| Path | Summary | |
|---|---|---|
| post | /v1/extract |
AI structured extraction → JSON(schema 或 prompt 必填其一) |
| post | /v1/html |
Fully rendered HTML after JS execution |
| post | /v1/links |
All links on a single page |
| post | /v1/map |
Discover site URLs(sitemap 优先 + 页面链接兜底) |
| post | /v1/markdown |
Read a page as clean Markdown |
| post | /v1/pdf |
Page → PDF → pdf_url(鉴权下载) |
| post | /v1/screenshot |
Page screenshot → screenshot_url(鉴权下载) |
crawl
| Path | Summary | |
|---|---|---|
| get | /v1/crawl |
List crawl jobs(keyset 分页) |
| post | /v1/crawl |
Start an async crawl job(预扣 limit 额度,逐页结算) |
| delete | /v1/crawl/{jobId} |
Cancel crawl job(未用预扣退回) |
| get | /v1/crawl/{jobId} |
Crawl job status(+ ?include=pages 取页内容) |
monitor
| Path | Summary | |
|---|---|---|
| get | /v1/monitor |
List monitors(keyset 分页) |
| post | /v1/monitor |
Create a periodic change monitor |
| delete | /v1/monitor/{id} |
Delete monitor(级联 checks + snapshots) |
| get | /v1/monitor/{id} |
Monitor detail |
| patch | /v1/monitor/{id} |
Pause / resume / retune monitor |
| get | /v1/monitor/{id}/checks |
Monitor check history(keyset 分页) |
| get | /v1/monitor/{id}/checks/{checkId}/diff |
Adjacent-snapshot line diff for a check(monitor-diff) |
| post | /v1/monitor/{id}/run |
Trigger a manual check now(验证 webhook 链路) |
| get | /v1/monitor/{id}/snapshots/{snapshotId} |
Fetch a monitor snapshot as normalized markdown(agent-selfserve) |
account
| Path | Summary | |
|---|---|---|
| get | /v1/account/activity |
Run-level activity log(过滤 + keyset 分页) |
| get | /v1/account/keys |
List API keys(掩码) |
| post | /v1/account/keys |
Create API key(明文仅本次返回) |
| post | /v1/account/keys/{id}/revoke |
Revoke API key |
| get | /v1/account/usage |
Credit balance + quota + in-flight reserved |
| get | /v1/account/usage/daily |
Daily usage aggregation(UTC 日历日,days 轴预填) |
notifications
| Path | Summary | |
|---|---|---|
| get | /v1/notifications/channels |
List notification channels(不含 secrets/signing_secret) |
| post | /v1/notifications/channels |
Create notification channel(custom 的 signing_secret 仅此一次返回) |
| delete | /v1/notifications/channels/{id} |
Delete channel(deliveries 留审计;挂接的 monitor 自动解绑) |
| get | /v1/notifications/channels/{id} |
Channel detail |
| patch | /v1/notifications/channels/{id} |
Update channel(url/events/status/config/secrets;channel_type 与 id 不可变) |
| get | /v1/notifications/channels/{id}/deliveries |
Recent deliveries(最近 50 条,无分页) |
| post | /v1/notifications/channels/{id}/deliveries/{deliveryId}/resend |
Resend a delivery(attempts 归零重计 3 次配额) |
| post | /v1/notifications/channels/{id}/rotate |
Rotate signing secret(仅 custom;id/挂接不动,旧 secret 立即失效) |
| post | /v1/notifications/channels/{id}/test |
Send a test notification(notification.test 事件,走真实投递链路) |
artifacts
| Path | Summary | |
|---|---|---|
| get | /v1/artifacts/{runId} |
Download run artifact(screenshot/png 或 pdf) |