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

# 获取当前进行中的爬取任务

> 注意：全新的 [此 API 的 v2 版本](/zh/api-reference/endpoint/crawl-active) 现已可用，功能和性能均有所提升。


## OpenAPI

````yaml zh/api-reference/v1-openapi.json GET /crawl/active
openapi: 3.0.0
info:
  contact:
    email: support@firecrawl.dev
    name: Firecrawl Support
    url: https://firecrawl.dev/support
  description: 用于与 Firecrawl 服务交互，以进行网页抓取和爬取任务的 API。
  title: Firecrawl API
  version: v1
servers:
  - url: https://api.firecrawl.dev/v1
security:
  - bearerAuth: []
paths:
  /crawl/active:
    get:
      tags:
        - Crawling
      summary: 获取当前已认证团队的所有活跃抓取任务
      operationId: getActiveCrawls
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  crawls:
                    items:
                      properties:
                        id:
                          description: 爬取任务的唯一标识符
                          format: uuid
                          type: string
                        options:
                          description: 本次抓取使用的爬虫配置
                          properties:
                            scrapeOptions:
                              $ref: '#/components/schemas/ScrapeOptions'
                          type: object
                        teamId:
                          description: 拥有此抓取任务的团队 ID
                          type: string
                        url:
                          description: 爬取的起始 URL
                          format: uri
                          type: string
                      required:
                        - id
                        - teamId
                        - url
                        - status
                        - options
                      type: object
                    type: array
                  success:
                    example: true
                    type: boolean
                required:
                  - success
                  - data
                type: object
          description: 成功的响应
        '402':
          content:
            application/json:
              schema:
                properties:
                  error:
                    example: Payment required to access this resource.
                    type: string
                  success:
                    example: false
                    type: boolean
                type: object
          description: 需要付款
        '429':
          content:
            application/json:
              schema:
                properties:
                  error:
                    example: >-
                      Request rate limit exceeded. Please wait and try again
                      later.
                    type: string
                  success:
                    example: false
                    type: boolean
                type: object
          description: 请求过多
        '500':
          content:
            application/json:
              schema:
                properties:
                  error:
                    example: An unexpected error occurred on the server.
                    type: string
                  success:
                    example: false
                    type: boolean
                type: object
          description: 服务器错误
      security:
        - bearerAuth: []
components:
  schemas:
    ScrapeOptions:
      allOf:
        - $ref: '#/components/schemas/BaseScrapeOptions'
        - properties:
            changeTrackingOptions:
              description: >-
                用于 changeTracking 的选项（Beta）。仅当在 formats 中包含 'changeTracking'
                时才适用。使用 changeTracking 时，还必须同时指定 'markdown' 格式。
              properties:
                modes:
                  description: 用于更改跟踪的模式。`git-diff` 提供详细的差异对比，而 `json` 用于比较提取的 JSON 数据。
                  items:
                    enum:
                      - git-diff
                      - json
                    type: string
                  type: array
                prompt:
                  description: 在使用 JSON 模式进行变更跟踪时要使用的提示。如果未提供，则会使用默认提示。
                  type: string
                schema:
                  description: >-
                    在使用 `json` 模式时用于 JSON 提取的 schema。用于定义要提取和对比的数据结构。必须符合 [JSON
                    Schema](https://json-schema.org/) 规范。
                  type: object
                tag:
                  default: null
                  description: >-
                    用于变更跟踪的标签。标签可以将变更跟踪历史划分为不同的「分支」，使用特定标签的变更跟踪只会与同一标签下的抓取结果进行比较。如果未提供，则会使用默认标签（null）。
                  nullable: true
                  type: string
              type: object
            formats:
              default:
                - markdown
              description: 输出中要包含的formats。
              items:
                enum:
                  - markdown
                  - html
                  - rawHtml
                  - links
                  - screenshot
                  - screenshot@fullPage
                  - json
                  - changeTracking
                type: string
              type: array
          type: object
    BaseScrapeOptions:
      properties:
        actions:
          description: 在抓取页面内容前需要执行的 actions
          items:
            oneOf:
              - properties:
                  milliseconds:
                    description: 等待的时间（毫秒）
                    minimum: 1
                    type: integer
                  selector:
                    description: 用于定位该元素的查询选择器
                    example: '#my-element'
                    type: string
                  type:
                    description: 等待指定的毫秒数
                    enum:
                      - wait
                    type: string
                required:
                  - type
                title: Wait
                type: object
              - properties:
                  fullPage:
                    default: false
                    description: 是否截取整页截图，或仅截取当前视口。
                    type: boolean
                  quality:
                    description: 截图质量，取值范围为 1 至 100，100 为最高质量。
                    type: integer
                  type:
                    description: 进行截图。链接将位于响应的 `actions.screenshots` 数组中。
                    enum:
                      - screenshot
                    type: string
                required:
                  - type
                title: Screenshot
                type: object
              - properties:
                  all:
                    default: false
                    description: 点击所有匹配该选择器的元素，而不仅仅是第一个元素。如果没有元素匹配该选择器，也不会抛出错误。
                    type: boolean
                  selector:
                    description: 用于查找元素的查询选择器
                    example: '#load-more-button'
                    type: string
                  type:
                    description: 单击元素
                    enum:
                      - click
                    type: string
                required:
                  - type
                  - selector
                title: Click
                type: object
              - properties:
                  text:
                    description: 输入文本
                    example: Hello, world!
                    type: string
                  type:
                    description: >-
                      在输入框、文本区域或 contenteditable
                      元素中写入文本。注意：在写入之前，必须先通过一次“click”操作使该元素获得焦点。文本将以逐字符输入的方式进行，以模拟键盘敲击。
                    enum:
                      - write
                    type: string
                required:
                  - type
                  - text
                title: Write text
                type: object
              - description: >-
                  请在页面上按下任意键。按键代码请参考：https://asawicki.info/nosense/doc/devices/keyboard/key_codes.html。
                properties:
                  key:
                    description: 按键
                    example: Enter
                    type: string
                  type:
                    description: 在页面上按下任意键
                    enum:
                      - press
                    type: string
                required:
                  - type
                  - key
                title: Press a key
                type: object
              - properties:
                  direction:
                    default: down
                    description: 滚动方向
                    enum:
                      - up
                      - down
                    type: string
                  selector:
                    description: 需要滚动的元素的查询选择器
                    example: '#my-element'
                    type: string
                  type:
                    description: 滚动页面或特定元素
                    enum:
                      - scroll
                    type: string
                required:
                  - type
                title: Scroll
                type: object
              - properties:
                  type:
                    description: 抓取当前页面内容，同时返回其 URL 和 HTML。
                    enum:
                      - scrape
                    type: string
                required:
                  - type
                title: Scrape
                type: object
              - properties:
                  script:
                    description: 待执行的 JavaScript 代码
                    example: document.querySelector('.button').click();
                    type: string
                  type:
                    description: 在页面上执行 JavaScript 代码
                    enum:
                      - executeJavascript
                    type: string
                required:
                  - type
                  - script
                title: Execute JavaScript
                type: object
              - properties:
                  format:
                    default: Letter
                    description: 生成的 PDF 的页面大小
                    enum:
                      - A0
                      - A1
                      - A2
                      - A3
                      - A4
                      - A5
                      - A6
                      - Letter
                      - Legal
                      - Tabloid
                      - Ledger
                    type: string
                  landscape:
                    default: false
                    description: 是否以横向页面方向生成 PDF 文件
                    type: boolean
                  scale:
                    default: 1
                    description: 生成的 PDF 的缩放比例
                    type: number
                  type:
                    description: 生成当前页面的 PDF。该 PDF 将在响应中的 `actions.pdfs` 数组里返回。
                    enum:
                      - pdf
                    type: string
                required:
                  - type
                title: Generate PDF
                type: object
          type: array
        blockAds:
          default: true
          description: 启用广告拦截和 Cookie 弹窗屏蔽。
          type: boolean
        excludeTags:
          description: 在输出结果中要排除的标签。
          items:
            type: string
          type: array
        headers:
          description: 随请求发送的请求头。可用于携带 cookies、user-agent 等信息。
          type: object
        includeTags:
          description: 需要包含在输出中的标签。
          items:
            type: string
          type: array
        jsonOptions:
          description: JSON 配置对象
          properties:
            prompt:
              description: 在无 schema 情况下用于抽取的数据提示词（可选）
              type: string
            schema:
              description: 用于提取的数据模式（可选）。必须符合 [JSON Schema](https://json-schema.org/) 规范。
              type: object
            systemPrompt:
              description: 用于抽取的系统提示（可选）
              type: string
          type: object
        location:
          description: 请求的地理位置设置。指定后，如果可用，将使用合适的代理服务器，并模拟相应的语言和时区设置。如果未指定，默认值为“US”。
          properties:
            country:
              default: US
              description: ISO 3166-1 alpha-2 两位字母国家代码（例如：“US”、“AU”、“DE”、“JP”）
              pattern: ^[A-Z]{2}$
              type: string
            languages:
              description: >-
                按照优先级为本次请求指定首选语言和区域设置。默认使用所指定地区的语言。详见：https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language
              items:
                example: en-US
                type: string
              type: array
          type: object
        maxAge:
          default: 0
          description: >-
            如果页面的缓存版本的生成时间距现在小于此值（毫秒），则返回该缓存版本；如果缓存版本早于此值，则会重新抓取页面。如果你不需要极其实时的数据，启用此选项可以将抓取速度最多提升
            5 倍。默认值为 0，表示禁用缓存。
          type: integer
        mobile:
          default: false
          description: 若要模拟移动端抓取，请将其设置为 true。适用于测试响应式页面并获取移动端截图。
          type: boolean
        onlyMainContent:
          default: true
          description: 仅返回页面的主体内容，不包括页眉、导航、页脚等。
          type: boolean
        parsePDF:
          default: true
          description: >-
            控制在爬取过程中如何处理 PDF 文件。为 true 时，会提取 PDF 内容并转换为 Markdown 格式，按页数计费（每页 1
            个积分）。为 false 时，会返回以 base64 编码的 PDF 文件，统一按 1 个积分计费。
          type: boolean
        proxy:
          description: |-
            指定要使用的代理类型。

             - **basic**：适用于抓取没有或仅有基础防爬机制网站的代理。速度快，通常足够好用。
             - **enhanced**：适用于抓取具有高级防爬机制网站的增强型代理。速度较慢，但在某些网站上更可靠。每次请求最多消耗 5 个积分。
             - **auto**：当使用 basic 代理抓取失败时，Firecrawl 会自动使用 enhanced 代理重试。如果使用 enhanced 重试成功，该次抓取将收取 5 个积分；如果首次使用 basic 即抓取成功，则只收取常规费用。

            如果未指定代理类型，Firecrawl 将默认使用 basic。
          enum:
            - basic
            - enhanced
            - auto
          type: string
        removeBase64Images:
          default: true
          description: 从输出中移除所有 Base64 图片，以避免内容过于冗长。图片的替代文本（alt 文本）会保留在输出中，但其 URL 会被占位符替换。
          type: boolean
        skipTlsVerification:
          default: false
          description: 在发送请求时跳过 TLS 证书校验
          type: boolean
        storeInCache:
          default: true
          description: >-
            如果为 true，该页面将被存储到 Firecrawl 的索引和缓存中。若你的抓取活动可能涉及数据保护方面的问题，将其设置为 false
            会更合适。使用某些与敏感抓取相关的参数（如 actions、headers）时，该参数会被强制设为 false。
          type: boolean
        threatProtection:
          $ref: '#/components/schemas/ThreatProtectionOverride'
        timeout:
          default: 30000
          description: 请求超时时间（毫秒）
          type: integer
        waitFor:
          default: 0
          description: 设置在获取内容前的延迟时间（毫秒），以便页面有足够时间加载完成。
          type: integer
      type: object
    ThreatProtectionOverride:
      description: >-
        此请求的 [威胁防护](https://docs.firecrawl.dev/features/threat-protection)
        单次请求覆盖配置。你提供的字段只会替换本次请求中组织策略里的对应字段；未提供的字段将保留组织级别的值。你的团队必须已启用威胁防护（企业版功能），否则该请求将被
        403 拒绝。如果你的组织已禁用单次请求覆盖，任何包含此对象的请求都会被 403 拒绝。如果你的团队强制启用了威胁防护，则不能将 `mode`
        设为 `off`。
      properties:
        blacklist:
          description: 始终封禁的域名，可为普通域名（`example.com`）或通配 glob（`*.example.com`）。不包含协议、路径或端口。
          items:
            type: string
          maxItems: 1000
          type: array
        blockedTlds:
          description: 要直接封禁的顶级域名，使用不带前导点的小写形式（例如 `zip`）。
          items:
            type: string
          maxItems: 1000
          type: array
        failurePolicy:
          description: 当无法访问分类器时的处理方式：`closed` 会封禁该请求，`open` 则会允许该请求。
          enum:
            - open
            - closed
          type: string
        mode:
          description: >-
            此请求的 URL 扫描模式。`normal` 会根据 Google Web Risk 检查 URL（每扫描一个 URL 额外消耗 2
            点额度）。
          enum:
            - 'off'
            - normal
          type: string
        riskScoreThreshold:
          description: 标准化风险分数阈值（0–100）：当分类器判定结果达到或超过该值时，URL 会被封禁。值越低，限制越严格。
          example: 75
          maximum: 100
          minimum: 0
          type: integer
        whitelist:
          description: 始终允许的域名，可为普通域名或通配 glob。其优先级高于其他所有规则。
          items:
            type: string
          maxItems: 1000
          type: array
      title: Threat Protection Override
      type: object
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````