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

# Firecrawl 批量抓取

> 把多个 URL 作为一个后台任务批量抓取。

把多个 URL 作为一个后台任务批量抓取。`urls` 和 `Idempotency-Key` 必填；`maxConcurrency`、`onlyMainContent`、`includeTags`、`excludeTags`、`maxAge`、`minAge`、`timeout` 用于调节。异步。提交后返回 HTTP 202 和一个任务信封 —— `id`、`object`、`endpoint`、`status`、`createdAt`、`completedAt`、`pricing`、`output`、`error`，此时 `output` 还是 null。轮询 [`get_firecrawl_batch_scrape_job`](/docs/zh/api-reference/search/get_firecrawl-batch-scrape-job) 直到终态；届时 `output` 是文档数组，每项含 `markdown` 和 `metadata`。手上有一批 URL 且不急着要的时候用它。急着要就用 [`post_tavily_extract`](/docs/zh/api-reference/search/post_tavily-extract)，它同步返回小批量，实测约 1 秒；单个页面用 [`post_firecrawl_scrape`](/docs/zh/api-reference/search/post_firecrawl-scrape)。每批换一个新的 `Idempotency-Key`。

<Note>
  **第一次用？** 把任意 MCP 客户端指向 `https://mcp.aisa.one/mcp` —— Claude Code、
  Codex、Cursor、VS Code 都可以。鉴权走 OAuth：客户端打开浏览器，你点一次
  Allow，不需要粘贴任何 key。各客户端的具体命令和每次调用的价格见
  [aisa.one/zh-cn/mcp](https://aisa.one/zh-cn/mcp#connect)。
</Note>

[在你的 agent 里把这个端点跑起来 →](https://aisa.one/mcp?from=/zh/api-reference/search/post_firecrawl-batch-scrape)


## OpenAPI

````yaml openapi/zh/firecrawl.json POST /firecrawl/batch-scrape
openapi: 3.0.0
info:
  title: Firecrawl API
  version: 1.0.0
  description: >-
    Firecrawl 各 endpoint 的统一 API 文档，包括 Scrape、Search、Map、Parse、Crawl 和 Batch
    Scrape。Scrape、Search、Map 和 Parse 是同步接口。Crawl 和 Batch Scrape
    是异步接口：调用方提交任务，然后轮询返回的任务资源以获取状态和结果。


    计费按消耗的 Firecrawl credit 计量，而不是按请求固定收费，因此总费用随任务产生的页面、链接或结果数量增长。大致 credit
    消耗：Scrape = 每页 1 credit，Map = 每页 1 credit，Search = 每 10 条结果约 2 credits，Crawl
    = 每页 1 credit，Batch Scrape = 每页 1 credit。每个 credit 对应的美元费率取决于你的等级。
servers:
  - url: https://api.aisa.one/apis/v1
security:
  - bearerAuth: []
paths:
  /firecrawl/batch-scrape:
    post:
      tags:
        - https://docs.firecrawl.dev/api-reference/endpoint/batch-scrape
      summary: 提交一个异步的批量抓取任务。
      description: >-
        把多个 URL 作为一个后台任务批量抓取。`urls` 和 `Idempotency-Key`
        必填；`maxConcurrency`、`onlyMainContent`、`includeTags`、`excludeTags`、`maxAge`、`minAge`、`timeout`
        用于调节。异步。提交后返回 HTTP 202 和一个任务信封 ——
        `id`、`object`、`endpoint`、`status`、`createdAt`、`completedAt`、`pricing`、`output`、`error`，此时
        `output` 还是 null。轮询 `get_firecrawl_batch_scrape_job` 直到终态；届时 `output`
        是文档数组，每项含 `markdown` 和 `metadata`。手上有一批 URL 且不急着要的时候用它。急着要就用
        `post_tavily_extract`，它同步返回小批量，实测约 1 秒；单个页面用
        `post_firecrawl_scrape`。每批换一个新的 `Idempotency-Key`。
      operationId: post_firecrawl_batch_scrape
      parameters:
        - in: header
          name: Idempotency-Key
          required: true
          schema:
            type: string
            maxLength: 191
          description: 使提交具备幂等性的唯一 key（1 到 191 字符）。使用相同 key 重复提交会返回原任务。
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                urls:
                  type: array
                  items:
                    type: string
                    format: uri
                  minItems: 1
                  maxItems: 1000
                  description: 1 到 1000 个唯一的 HTTPS URL 用于抓取。不支持 PDF URL。
                  example:
                    - https://docs.firecrawl.dev
                    - https://docs.firecrawl.dev/introduction
                maxConcurrency:
                  type: integer
                  minimum: 1
                  maximum: 20
                  description: 并发抓取数的上限（1 到 20）。
                onlyMainContent:
                  type: boolean
                  description: 只返回每个页面的正文内容。
                  default: true
                includeTags:
                  type: array
                  items:
                    type: string
                    maxLength: 128
                  maxItems: 50
                  description: 要保留的 HTML 标签/选择器。
                excludeTags:
                  type: array
                  items:
                    type: string
                    maxLength: 128
                  maxItems: 50
                  description: 要丢弃的 HTML 标签/选择器。
                maxAge:
                  type: integer
                  minimum: 0
                  maximum: 31536000000
                  description: 可接受的最大缓存时长，单位为毫秒。
                minAge:
                  type: integer
                  minimum: 0
                  maximum: 31536000000
                  description: 重新抓取页面前所需的最小缓存时长，单位为毫秒。
                timeout:
                  type: integer
                  minimum: 1000
                  maximum: 300000
                  description: 单页超时时间，单位为毫秒。
              required:
                - urls
      responses:
        '202':
          description: 批量抓取任务已受理。Location 响应头指向该任务资源；请轮询直到终态。
          headers:
            Location:
              schema:
                type: string
              description: 所创建任务资源的路径，例如 /apis/v1/firecrawl/batch-scrape/{jobId}。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AsyncJob'
components:
  schemas:
    AsyncJob:
      type: object
      description: >-
        一个异步集成任务。由提交调用（HTTP 202）以及轮询/详情调用返回。请按 id 轮询该任务，直到 status
        进入终态（completed、failed 或 cancelled）。
      properties:
        id:
          type: string
          description: 唯一的 AIsa 任务标识符。可用它轮询、列出或取消该任务。
          example: iaj_01HZY8Q2M4K7N9V3T6W1X0B2C3
        object:
          type: string
          description: 始终为 "integration_async_job"。
          example: integration_async_job
        endpoint:
          type: string
          description: 该任务所属的提交 endpoint。
          example: /apis/v1/firecrawl/crawl
        status:
          type: string
          enum:
            - queued
            - running
            - completed
            - failed
            - cancelled
          description: 面向用户的生命周期状态。queued 和 running 为非终态；completed、failed 和 cancelled 为终态。
        createdAt:
          type: string
          format: date-time
          description: 任务被受理的时间。
        completedAt:
          type: string
          format: date-time
          nullable: true
          description: 任务进入终态的时间。任务仍处于排队或运行中时为 null。
        pricing:
          type: object
          properties:
            currency:
              type: string
              example: USD
            authorizedMicrosUSD:
              type: integer
              description: 任务被受理时授权（冻结）的金额，单位为微美元。计量型任务最终按实际消耗的 credits 结算。
            finalMicrosUSD:
              type: integer
              nullable: true
              description: 任务进入终态后的最终结算金额，单位为微美元。结算前为 null。
            billingMode:
              type: string
              description: 该任务的计费模式。
              example: metered_result
        output:
          description: >-
            任务结果载荷。仅在 status 为 completed 后出现。对 crawl 而言是抓取到的页面数组；对 batch scrape
            而言是抓取到的文档数组。
          nullable: true
        outputExpired:
          type: boolean
          description: 当结果已超过留存窗口、不再可获取时为 true。
        error:
          type: object
          nullable: true
          description: 当 status 为 failed 时出现，否则为 null。
          properties:
            code:
              type: string
              description: 机器可读的错误码。
            message:
              type: string
              description: 人类可读的错误信息。
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.