> ## 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 バージョン](/ja/api-reference/endpoint/batch-scrape) が利用可能になりました。バッチ処理のパフォーマンスと信頼性が向上しています。


## OpenAPI

````yaml ja/api-reference/v1-openapi.json POST /batch/scrape
openapi: 3.0.0
info:
  contact:
    email: support@firecrawl.dev
    name: Firecrawl Support
    url: https://firecrawl.dev/support
  description: Firecrawl サービスと連携して Web サイトのスクレイピングおよびクロール処理を行うための API です。
  title: Firecrawl API
  version: v1
servers:
  - url: https://api.firecrawl.dev/v1
security:
  - bearerAuth: []
paths:
  /batch/scrape:
    post:
      tags:
        - Scraping
      summary: 複数のURLをスクレイピングし、必要に応じてLLMを使って情報を抽出する
      operationId: scrapeAndExtractFromUrls
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - properties:
                    ignoreInvalidURLs:
                      default: false
                      description: >-
                        urls 配列に無効な URL が含まれている場合、それらは無視されます。無効な URL
                        が原因でリクエスト全体が失敗するのではなく、残りの有効な URL のみを使ってバッチスクレイプが実行され、無効な
                        URL はレスポンスの invalidURLs フィールドで返されます。
                      type: boolean
                    maxConcurrency:
                      description: >-
                        同時スクレイプの最大数。このパラメータで、このバッチスクレイプにおける同時実行数の上限を設定できます。指定しない場合は、チームの同時実行数の上限が適用されます。
                      type: integer
                    urls:
                      items:
                        description: スクレイピング対象のURL
                        format: uri
                        type: string
                      type: array
                    webhook:
                      description: Webhook の仕様を表すオブジェクト。
                      properties:
                        events:
                          description: 'Webhook URL に送信するイベントの種類。（デフォルト: すべて）'
                          items:
                            enum:
                              - completed
                              - page
                              - failed
                              - started
                            type: string
                          type: array
                        headers:
                          additionalProperties:
                            type: string
                          description: Webhook URL に送信する HTTP ヘッダー。
                          type: object
                        metadata:
                          additionalProperties: true
                          description: このクロールのすべてのWebhookペイロードに含まれるカスタムメタデータ
                          type: object
                        url:
                          description: >-
                            Webhook の送信先 URL
                            です。バッチスクレイプの開始時（batch_scrape.started）、各ページのスクレイプ時（batch_scrape.page）、およびバッチスクレイプが完了したとき（batch_scrape.completed
                            または batch_scrape.failed）にトリガーされます。レスポンスは `/scrape`
                            エンドポイントと同じです。
                          type: string
                      required:
                        - url
                      type: object
                  required:
                    - urls
                  type: object
                - $ref: '#/components/schemas/ScrapeOptions'
                - properties:
                    zeroDataRetention:
                      default: false
                      description: >-
                        true
                        の場合、このバッチスクレイプではデータを一切保持しないゼロデータ保持モードが有効になります。この機能を有効にするには、help@firecrawl.dev
                        までご連絡ください。
                      type: boolean
                  type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchScrapeResponseObj'
          description: 成功時のレスポンス
        '402':
          content:
            application/json:
              schema:
                properties:
                  error:
                    example: Payment required to access this resource.
                    type: string
                type: object
          description: お支払いが必要です
        '429':
          content:
            application/json:
              schema:
                properties:
                  error:
                    example: >-
                      Request rate limit exceeded. Please wait and try again
                      later.
                    type: string
                type: object
          description: リクエスト数が多すぎます
        '500':
          content:
            application/json:
              schema:
                properties:
                  error:
                    example: An unexpected error occurred on the server.
                    type: string
                type: object
          description: サーバーエラー
      security:
        - bearerAuth: []
components:
  schemas:
    ScrapeOptions:
      allOf:
        - $ref: '#/components/schemas/BaseScrapeOptions'
        - properties:
            changeTrackingOptions:
              description: >-
                変更追跡用のオプション（ベータ版）。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 抽出用スキーマです。抽出および比較するデータの構造を定義します。[JSON
                    Schema](https://json-schema.org/) に準拠している必要があります。
                  type: object
                tag:
                  default: null
                  description: >-
                    変更トラッキングに使用するタグ。タグを使うことで、変更トラッキングの履歴を別々の「ブランチ」に分割でき、特定のタグでの変更トラッキングは同じタグで実行されたスクレイプとだけ比較されます。指定しない場合は、デフォルトタグ（null）が使用されます。
                  nullable: true
                  type: string
              type: object
            formats:
              default:
                - markdown
              description: 出力に含めるフォーマット。
              items:
                enum:
                  - markdown
                  - html
                  - rawHtml
                  - links
                  - screenshot
                  - screenshot@fullPage
                  - json
                  - changeTracking
                type: string
              type: array
          type: object
    BatchScrapeResponseObj:
      properties:
        id:
          type: string
        invalidURLs:
          description: >-
            ignoreInvalidURLs が true の場合、この配列にはリクエストで指定された無効な URL が含まれます。無効な URL
            が存在しない場合、この配列は空になります。ignoreInvalidURLs が false の場合、このフィールドは
            undefined になります。
          items:
            type: string
          nullable: true
          type: array
        success:
          type: boolean
        url:
          format: uri
          type: string
      type: object
    BaseScrapeOptions:
      properties:
        actions:
          description: ページからコンテンツを取得する前に実行するアクション
          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」アクションで要素にフォーカスを当ててください。テキストはキーボード入力をシミュレートするため、1文字ずつタイプされます。
                    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: 広告とクッキーポップアップのブロックを有効にします。
          type: boolean
        excludeTags:
          description: 出力結果から除外するタグ。
          items:
            type: string
          type: array
        headers:
          description: リクエストに付与して送信するヘッダー。Cookie や User-Agent などを送るために使用できます。
          type: object
        includeTags:
          description: 出力に含めるタグ。
          items:
            type: string
          type: array
        jsonOptions:
          description: JSON オプションオブジェクト
          properties:
            prompt:
              description: スキーマなしで抽出を行う際に使用するプロンプト（任意）
              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: >-
                リクエストに対して優先順位順に指定する言語およびロケール。指定がない場合は、指定された location
                の言語がデフォルトになります。詳細は
                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: >-
            ページのキャッシュが、このミリ秒数以内に生成されたものであれば、そのキャッシュされたバージョンを返します。キャッシュされたページがこの値より古い場合は、ページをスクレイピングします。極めて最新のデータが不要な場合、これを有効にすることでスクレイピングを最大
            500% 高速化できます。デフォルトは 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ページあたり1クレジット）。false
            の場合、PDFファイルはbase64エンコードされたデータとして返され、合計1クレジットの定額課金となります。
          type: boolean
        proxy:
          description: |-
            使用するプロキシの種類を指定します。

             - **basic**: ボット対策がない、または基本的なボット対策のみが導入されているサイト向けのプロキシです。高速で、ほとんどの場合はこれで十分です。
             - **enhanced**: 高度なボット対策が導入されているサイト向けの強化プロキシです。速度は遅くなりますが、特定のサイトではより信頼性があります。1 リクエストあたり最大 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
            に設定するのが有効です。機密性の高いスクレイピングに関連する一部のパラメータ（アクションやヘッダーなど）を使用すると、このパラメータは強制的に
            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`）またはワイルドカードグロブ（`*.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` では URL を Google Web Risk
            でチェックします（スキャン対象の URL 1 件ごとに +2 クレジット）。
          enum:
            - 'off'
            - normal
          type: string
        riskScoreThreshold:
          description: >-
            分類器の判定で URL
            がブロックされる、正規化リスクスコア（0～100）のしきい値です。この値以上でブロックされ、低いほど厳しくなります。
          example: 75
          maximum: 100
          minimum: 0
          type: integer
        whitelist:
          description: 常に許可するドメインです。通常のドメインまたはワイルドカードグロブで指定します。ほかのすべてのルールより優先されます。
          items:
            type: string
          maxItems: 1000
          type: array
      title: Threat Protection Override
      type: object
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````