跳转到主要内容
所有示例都使用你的 UUID 格式 ZapFetch API Key,并指向 https://api.zapfetch.com
export ZAPFETCH_KEY="YOUR_ZAPFETCH_API_KEY"

Scrape 单个页面

抓取单页内容,返回干净的 markdown 或结构化结果。
curl -X POST https://api.zapfetch.com/v1/scrape \
  -H "Authorization: Bearer $ZAPFETCH_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com",
    "formats": ["markdown"]
  }'

Crawl 整个站点

发起 crawl 后轮询状态。Crawl 按抓取到的页面数计费。
# 启动 crawl,返回 job id。
curl -X POST https://api.zapfetch.com/v1/crawl \
  -H "Authorization: Bearer $ZAPFETCH_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://docs.example.com",
    "limit": 50
  }'

# 查询状态并拉取页面。
curl https://api.zapfetch.com/v1/crawl/JOB_ID \
  -H "Authorization: Bearer $ZAPFETCH_KEY"

Search 网页

执行一次网页搜索,可选对每条结果同步执行 scrape。
curl -X POST https://api.zapfetch.com/v1/search \
  -H "Authorization: Bearer $ZAPFETCH_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "best vector databases 2026",
    "limit": 5,
    "scrapeOptions": { "formats": ["markdown"] }
  }'

Map 一个域名

发现某个域名下所有可达 URL,不抓取内容本身。
curl -X POST https://api.zapfetch.com/v1/map \
  -H "Authorization: Bearer $ZAPFETCH_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://docs.example.com",
    "limit": 500
  }'

Extract 结构化数据

让 LLM 直接从一个或多个页面里抽出类型化字段。给它一份 JSON Schema, ZapFetch 负责抓取、解析、推理。
curl -X POST https://api.zapfetch.com/v1/extract \
  -H "Authorization: Bearer $ZAPFETCH_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "urls": ["https://news.ycombinator.com"],
    "prompt": "Extract the top 5 story titles with their points and author.",
    "schema": {
      "type": "object",
      "properties": {
        "stories": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "title":  { "type": "string" },
              "points": { "type": "integer" },
              "author": { "type": "string" }
            }
          }
        }
      }
    }
  }'

下一步