> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zapfetch.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 快速开始：curl

> 用 curl 在 60 秒内跑通 ZapFetch 的每一个端点。

所有示例都使用你的 UUID 格式 ZapFetch API Key，并指向
`https://api.zapfetch.com`。

```bash theme={null}
export ZAPFETCH_KEY="YOUR_ZAPFETCH_API_KEY"
```

## Scrape 单个页面

抓取单页内容，返回干净的 markdown 或结构化结果。

```bash theme={null}
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 按抓取到的页面数计费。

```bash theme={null}
# 启动 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。

```bash theme={null}
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，不抓取内容本身。

```bash theme={null}
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 负责抓取、解析、推理。

```bash theme={null}
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" }
            }
          }
        }
      }
    }
  }'
```

## 下一步

* 用 [Python](/zh/quickstart/python) 或 [Node.js](/zh/quickstart/nodejs) 接入自动化流程。
* 在 [Console](https://console.zapfetch.com/dashboard) 查看当前套餐和用量。
