> ## Documentation Index
> Fetch the complete documentation index at: https://student-213fb9fc.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# スクレイピング

> あらゆるURLをクリーンなデータに変換

Firecrawl はウェブページをMarkdownに変換し、LLMアプリケーションに最適です。

* 複雑な処理を代行：プロキシ、キャッシュ、レート制限、JSでブロックされたコンテンツ
* 動的コンテンツに対応：動的サイト、JSレンダリングサイト、PDF、画像
* クリーンなMarkdown、構造化データ、スクリーンショット、またはHTMLを出力

詳細は、[Scrape Endpoint API Reference](https://docs.firecrawl.dev/api-reference/endpoint/scrape)を参照してください。

<Card title="Playground で試す" icon="play" href="https://www.firecrawl.dev/playground?endpoint=scrape">
  インタラクティブな Playground でスクレイピングを試せます。コードは不要です。
</Card>

<div id="scraping-a-url-with-firecrawl">
  ## FirecrawlでURLをスクレイピングする
</div>

<div id="scrape-endpoint">
  ### /scrape エンドポイント
</div>

URL をスクレイピングして、その内容を取得するために使用します。

<div id="installation">
  ### インストール
</div>

<CodeGroup>
  ```python Python theme={null}
  # pip install firecrawl-py

  from firecrawl import Firecrawl

  firecrawl = Firecrawl(api_key="fc-YOUR-API-KEY")
  ```

  ```js Node（Node.js） theme={null}
  # npm install @mendable/firecrawl-js

  import Firecrawl from '@mendable/firecrawl-js';

  const firecrawl = new Firecrawl({ apiKey: "fc-YOUR-API-KEY" });
  ```

  ```bash CLI theme={null}
  # npmでグローバルにインストール
  npm install -g firecrawl

  # 認証（初回セットアップ）
  firecrawl login
  ```
</CodeGroup>

<div id="usage">
  ### 使い方
</div>

<CodeGroup>
  ```python Python theme={null}
  from firecrawl import Firecrawl

  firecrawl = Firecrawl(api_key="fc-YOUR-API-KEY")

  # ウェブサイトをスクレイピングする：
  doc = firecrawl.scrape("https://firecrawl.dev", formats=["markdown", "html"])
  print(doc)
  ```

  ```js Node theme={null}
  import Firecrawl from '@mendable/firecrawl-js';

  const firecrawl = new Firecrawl({ apiKey: "fc-YOUR-API-KEY" });

  // ウェブサイトをスクレイピングする:
  const doc = await firecrawl.scrape('https://firecrawl.dev', { formats: ['markdown', 'html'] });
  console.log(doc);
  ```

  ```bash cURL theme={null}
  curl -s -X POST "https://api.firecrawl.dev/v2/scrape" \
    -H "Authorization: Bearer $FIRECRAWL_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "url": "https://firecrawl.dev",
      "formats": ["markdown", "html"]
    }'
  ```

  ```bash CLI theme={null}
  # Scrape a URL and get markdown
  firecrawl https://firecrawl.dev

  # 複数のフォーマットで取得（JSONを返す）
  firecrawl https://firecrawl.dev --format markdown,html,links --pretty
  ```
</CodeGroup>

パラメータの詳細は、[APIリファレンス](https://docs.firecrawl.dev/api-reference/endpoint/scrape)を参照してください。

<Info>
  各スクレイプで1クレジットを消費します。次のオプションには追加クレジットが必要です。JSONモードは1ページあたり追加で4クレジット、enhanced proxyは1ページあたり追加で4クレジット、PDF解析はPDFの1ページあたり1クレジットを消費します。
</Info>

### レスポンス

SDK はデータオブジェクトを直接返します。cURL は以下のとおり、ペイロードをそのまま返します。

```json theme={null}
{
  "success": true,
  "data" : {
    "markdown": "Launch Week I が開幕！[2日目のリリースを見る 🚀](https://www.firecrawl.dev/blog/launch-week-i-day-2-doubled-rate-limits)[💥 2か月無料をゲット...",
    "html": "<!DOCTYPE html><html lang=\"en\" class=\"light\" style=\"color-scheme: light;\"><body class=\"__variable_36bd41 __variable_d7dc5d font-inter ...",
    "metadata": {
      "title": "ホーム - Firecrawl",
      "description": "Firecrawl は、あらゆるウェブサイトをクリーンな Markdown にクロールして変換します。",
      "language": "en",
      "keywords": "Firecrawl,Markdown,データ,Mendable,Langchain",
      "robots": "follow, index",
      "ogTitle": "Firecrawl",
      "ogDescription": "あらゆるウェブサイトを LLM で使えるデータに変換。",
      "ogUrl": "https://www.firecrawl.dev/",
      "ogImage": "https://www.firecrawl.dev/og.png?123",
      "ogLocaleAlternate": [],
      "ogSiteName": "Firecrawl"
      "sourceURL": "https://firecrawl.dev",
      "statusCode": 200
    }
  }
}
```

<div id="scrape-formats">
  ## スクレイプのフォーマット
</div>

出力のフォーマットを選択できます。複数の出力フォーマットを指定することも可能です。サポートされているフォーマットは次のとおりです:

* Markdown (`markdown`)
* Summary (`summary`)
* HTML (`html`) - ページの HTML をクリーンアップしたバージョン
* Raw HTML (`rawHtml`) - ページから取得した変更前の HTML
* Screenshot (`screenshot`、`fullPage`、`quality`、`viewport` などのオプションあり）
* Links (`links`)
* JSON (`json`) - 構造化された出力
* Images (`images`) - ページ内のすべての画像URLを抽出
* Branding (`branding`) - ブランドアイデンティティとデザインシステムを抽出

出力のキーは、選択したフォーマットに対応します。

<div id="extract-structured-data">
  ## 構造化データの抽出
</div>

<div id="scrape-with-json-endpoint">
  ### /scrape（json あり）エンドポイント
</div>

スクレイピングしたページから構造化データを抽出するために使用します。

<CodeGroup>
  ```python Python theme={null}
  from firecrawl import Firecrawl
  from pydantic import BaseModel

  app = Firecrawl(api_key="fc-YOUR-API-KEY")

  class CompanyInfo(BaseModel):
      company_mission: str
      supports_sso: bool
      is_open_source: bool
      is_in_yc: bool

  result = app.scrape(
      'https://firecrawl.dev',
      formats=[{
        "type": "json",
        "schema": CompanyInfo.model_json_schema()
      }],
      only_main_content=False,
      timeout=120000
  )

  print(result)
  ```

  ```js Node theme={null}
  import Firecrawl from "@mendable/firecrawl-js";
  import { z } from "zod";

  const app = new Firecrawl({
    apiKey: "fc-YOUR_API_KEY"
  });

  // 抽出するコンテンツのスキーマを定義
  const schema = z.object({
    company_mission: z.string(),
    supports_sso: z.boolean(),
    is_open_source: z.boolean(),
    is_in_yc: z.boolean()
  });

  const result = await app.scrape("https://firecrawl.dev", {
    formats: [{
      type: "json",
      schema: schema
    }],
  });

  console.log(result);
  ```

  ```bash cURL theme={null}
  curl -X POST https://api.firecrawl.dev/v2/scrape \
      -H 'Content-Type: application/json' \
      -H 'Authorization: Bearer YOUR_API_KEY' \
      -d '{
        "url": "https://firecrawl.dev",
        "formats": [ {
          "type": "json",
          "schema": {
            "type": "object",
            "properties": {
              "company_mission": {
                        "type": "string"
              },
              "supports_sso": {
                        "type": "boolean"
              },
              "is_open_source": {
                        "type": "boolean"
              },
              "is_in_yc": {
                        "type": "boolean"
              }
            },
            "required": [
              "company_mission",
              "supports_sso",
              "is_open_source",
              "is_in_yc"
            ]
          }
        } ]
      }'
  ```
</CodeGroup>

出力:

```json JSON theme={null}
{
    "success": true,
    "data": {
      "json": {
        "company_mission": "AI対応のウェブスクレイピングとデータ抽出",
        "supports_sso": true,
        "is_open_source": true,
        "is_in_yc": true
      },
      "metadata": {
        "title": "Firecrawl",
        "description": "AI対応のウェブスクレイピングとデータ抽出",
        "robots": "follow, index",
        "ogTitle": "Firecrawl",
        "ogDescription": "AI対応のウェブスクレイピングとデータ抽出",
        "ogUrl": "https://firecrawl.dev/",
        "ogImage": "https://firecrawl.dev/og.png",
        "ogLocaleAlternate": [],
        "ogSiteName": "Firecrawl",
        "sourceURL": "https://firecrawl.dev/"
      },
    }
}
```

<div id="extracting-without-schema">
  ### スキーマなしでの抽出
</div>

エンドポイントに `prompt` を渡すだけで、スキーマなしで抽出できます。LLM がデータ構造を決定します。

<CodeGroup>
  ```python Python theme={null}
  from firecrawl import Firecrawl

  app = Firecrawl(api_key="fc-YOUR-API-KEY")

  result = app.scrape(
      'https://firecrawl.dev',
      formats=[{
        "type": "json",
        "prompt": "ページから企業のミッションを抽出してください。"
      }],
      only_main_content=False,
      timeout=120000
  )

  print(result)
  ```

  ```js Node theme={null}
  import Firecrawl from "@mendable/firecrawl-js";

  const app = new Firecrawl({
    apiKey: "fc-YOUR_API_KEY"
  });

  const result = await app.scrape("https://firecrawl.dev", {
    formats: [{
      type: "json",
      prompt: "ページから会社のミッションを抽出してください。"
    }]
  });

  console.log(result);
  ```

  ```bash cURL theme={null}
  curl -X POST https://api.firecrawl.dev/v2/scrape \
      -H 'Content-Type: application/json' \
      -H 'Authorization: Bearer YOUR_API_KEY' \
      -d '{
        "url": "https://firecrawl.dev",
        "formats": [{
          "type": "json",
          "prompt": "ページから企業ミッションを抽出する"
        }]
      }'
  ```
</CodeGroup>

出力:

```json JSON theme={null}
{
    "success": true,
    "data": {
      "json": {
        "company_mission": "AI搭載のウェブスクレイピングとデータ抽出",
      },
      "metadata": {
        "title": "Firecrawl",
        "description": "AI搭載のウェブスクレイピングとデータ抽出",
        "robots": "follow, index",
        "ogTitle": "Firecrawl",
        "ogDescription": "AI搭載のウェブスクレイピングとデータ抽出",
        "ogUrl": "https://firecrawl.dev/",
        "ogImage": "https://firecrawl.dev/og.png",
        "ogLocaleAlternate": [],
        "ogSiteName": "Firecrawl",
        "sourceURL": "https://firecrawl.dev/"
      },
    }
}
```

<div id="json-format-options">
  ### JSON フォーマットのオプション
</div>

`json` フォーマットを使用する場合は、`formats` 内に以下のパラメータを含むオブジェクトを渡します:

* `schema`: 構造化出力のための JSON Schema。
* `prompt`: スキーマがある場合や、軽い指示で十分な場合に抽出を補助する任意のプロンプト。

<div id="extract-brand-identity">
  ## ブランドアイデンティティの抽出
</div>

<div id="scrape-with-branding-endpoint">
  ### /scrape（ブランディング付き）エンドポイント
</div>

ブランディングフォーマットは、色、フォント、タイポグラフィ、余白・間隔、UIコンポーネントなど、ウェブページからブランドアイデンティティに関する包括的な情報を抽出します。デザインシステムの分析やブランド監視、ウェブサイトのビジュアルアイデンティティを把握する必要があるツールの構築に有用です。

<CodeGroup>
  ```python Python theme={null}
  from firecrawl import Firecrawl

  firecrawl = Firecrawl(api_key='fc-YOUR_API_KEY')

  result = firecrawl.scrape(
      url='https://firecrawl.dev',
      formats=['branding']
  )

  print(result['branding'])
  ```

  ```js Node theme={null}
  import Firecrawl from '@mendable/firecrawl-js';

  const firecrawl = new Firecrawl({ apiKey: "fc-YOUR-API-KEY" });

  const result = await firecrawl.scrape('https://firecrawl.dev', {
      formats: ['branding']
  });

  console.log(result.branding);
  ```

  ```bash cURL theme={null}
  curl -s -X POST "https://api.firecrawl.dev/v2/scrape" \
    -H "Authorization: Bearer $FIRECRAWL_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "url": "https://firecrawl.dev",
      "formats": ["branding"]
    }'
  ```
</CodeGroup>

### レスポンス

ブランディングフォーマットは、以下の構造を持つ包括的な `BrandingProfile` オブジェクトを返します。

```json Output theme={null}
{
  "success": true,
  "data": {
    "branding": {
      "colorScheme": "dark",
      "logo": "https://firecrawl.dev/logo.svg",
      "colors": {
        "primary": "#FF6B35",
        "secondary": "#004E89",
        "accent": "#F77F00",
        "background": "#1A1A1A",
        "textPrimary": "#FFFFFF",
        "textSecondary": "#B0B0B0"
      },
      "fonts": [
        {
          "family": "Inter"
        },
        {
          "family": "Roboto Mono"
        }
      ],
      "typography": {
        "fontFamilies": {
          "primary": "Inter",
          "heading": "Inter",
          "code": "Roboto Mono"
        },
        "fontSizes": {
          "h1": "48px",
          "h2": "36px",
          "h3": "24px",
          "body": "16px"
        },
        "fontWeights": {
          "regular": 400,
          "medium": 500,
          "bold": 700
        }
      },
      "spacing": {
        "baseUnit": 8,
        "borderRadius": "8px"
      },
      "components": {
        "buttonPrimary": {
          "background": "#FF6B35",
          "textColor": "#FFFFFF",
          "borderRadius": "8px"
        },
        "buttonSecondary": {
          "background": "transparent",
          "textColor": "#FF6B35",
          "borderColor": "#FF6B35",
          "borderRadius": "8px"
        }
      },
      "images": {
        "logo": "https://firecrawl.dev/logo.svg",
        "favicon": "https://firecrawl.dev/favicon.ico",
        "ogImage": "https://firecrawl.dev/og-image.png"
      }
    }
  }
}
```

<div id="branding-profile-structure">
  ### ブランディングプロファイルの構造
</div>

`branding` オブジェクトには次のプロパティが含まれます:

* `colorScheme`: 検出された配色（`"light"` または `"dark"`）
* `logo`: メインロゴの URL
* `colors`: ブランドカラーを含むオブジェクト:
  * `primary`, `secondary`, `accent`: 主要なブランドカラー
  * `background`, `textPrimary`, `textSecondary`: UI カラー
  * `link`, `success`, `warning`, `error`: セマンティックカラー
* `fonts`: ページで使用されているフォントファミリーの配列
* `typography`: タイポグラフィの詳細情報:
  * `fontFamilies`: 基本、見出し、コード用のフォントファミリー
  * `fontSizes`: 見出しと本文のサイズ定義
  * `fontWeights`: ウェイトの定義（light、regular、medium、bold）
  * `lineHeights`: テキスト種別ごとの行の高さ
* `spacing`: 余白とレイアウト情報:
  * `baseUnit`: 基準となるスペーシング単位（px）
  * `borderRadius`: 既定の角丸半径
  * `padding`, `margins`: スペーシング値
* `components`: UI コンポーネントのスタイル:
  * `buttonPrimary`, `buttonSecondary`: ボタンスタイル
  * `input`: 入力フィールドのスタイル
* `icons`: アイコンのスタイル情報
* `images`: ブランド画像（ロゴ、favicon、og:image）
* `animations`: アニメーションおよびトランジション設定
* `layout`: レイアウト構成（グリッド、ヘッダー／フッターの高さ）
* `personality`: ブランドの特性（トーン、エネルギー、対象ユーザー）

<div id="combining-with-other-formats">
  ### 他のフォーマットとの併用
</div>

ブランディング用フォーマットを他のフォーマットと組み合わせることで、ページの包括的なデータを取得できます:

<CodeGroup>
  ```python Python theme={null}
  from firecrawl import Firecrawl

  firecrawl = Firecrawl(api_key='fc-YOUR_API_KEY')

  result = firecrawl.scrape(
      url='https://firecrawl.dev',
      formats=['markdown', 'branding', 'screenshot']
  )

  print(result['markdown'])
  print(result['branding'])
  print(result['screenshot'])
  ```

  ```js Node theme={null}
  import Firecrawl from '@mendable/firecrawl-js';

  const firecrawl = new Firecrawl({ apiKey: "fc-YOUR-API-KEY" });

  const result = await firecrawl.scrape('https://firecrawl.dev', {
      formats: ['markdown', 'branding', 'screenshot']
  });

  console.log(result.markdown);
  console.log(result.branding);
  console.log(result.screenshot);
  ```

  ```bash cURL theme={null}
  curl -s -X POST "https://api.firecrawl.dev/v2/scrape" \
    -H "Authorization: Bearer $FIRECRAWL_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "url": "https://firecrawl.dev",
      "formats": ["markdown", "branding", "screenshot"]
    }'
  ```
</CodeGroup>

<div id="interacting-with-the-page-with-actions">
  ## アクションを使ってページとやり取りする
</div>

Firecrawl を使うと、スクレイピングの前に Web ページ上でさまざまなアクションを実行できます。これは、動的コンテンツとのインタラクション、ページ遷移、ユーザー操作が必要なコンテンツへのアクセスに特に有効です。

以下は、アクションを使って google.com に移動し、Firecrawl を検索し、最初の結果をクリックしてスクリーンショットを取得する例です。

ページの読み込み時間を確保するため、他のアクションの前後には基本的に `wait` アクションを使用することが重要です。

<div id="example">
  ### 例
</div>

<CodeGroup>
  ```python Python theme={null}
  from firecrawl import Firecrawl

  firecrawl = Firecrawl(api_key="fc-YOUR-API-KEY")

  doc = firecrawl.scrape(
      url="https://example.com/login",
      formats=["markdown"],
      actions=[
          {"type": "write", "text": "john@example.com"},
          {"type": "press", "key": "Tab"},
          {"type": "write", "text": "secret"},
          {"type": "click", "selector": 'button[type="submit"]'},
          {"type": "wait", "milliseconds": 1500},
          {"type": "screenshot", "full_page": True},
      ],
  )

  print(doc.markdown, doc.screenshot)
  ```

  ```js Node theme={null}
  import Firecrawl from '@mendable/firecrawl-js';

  const firecrawl = new Firecrawl({ apiKey: "fc-YOUR-API-KEY" });

  const doc = await firecrawl.scrape('https://example.com/login', {
    formats: ['markdown'],
    actions: [
      { type: 'write', text: 'john@example.com' },
      { type: 'press', key: 'Tab' },
      { type: 'write', text: 'secret' },
      { type: 'click', selector: 'button[type="submit"]' },
      { type: 'wait', milliseconds: 1500 },
      { type: 'screenshot', fullPage: true },
    ],
  });

  console.log(doc.markdown, doc.screenshot);
  ```

  ```bash cURL theme={null}
  curl -X POST https://api.firecrawl.dev/v2/scrape \
      -H 'Content-Type: application/json' \
      -H 'Authorization: Bearer YOUR_API_KEY' \
      -d '{
        "url": "https://example.com/login",
        "formats": ["markdown"],
        "actions": [
          { "type": "write", "text": "john@example.com" },
          { "type": "press", "key": "Tab" },
          { "type": "write", "text": "secret" },
          { "type": "click", "selector": "button[type=\"submit\"]" },
          { "type": "wait", "milliseconds": 1500 },
          { "type": "screenshot", "fullPage": true },
        ],
    }'
  ```
</CodeGroup>

<div id="output">
  ### 出力
</div>

<CodeGroup>
  ```json JSON theme={null}
  {
    "success": true,
    "data": {
      "markdown": "初のローンチウィークが終了しました！ [まとめを見る 🚀](blog/firecrawl-launch-week-1-recap)...",
      "actions": {
        "screenshots": [
          "https://alttmdsdujxrfnakrkyi.supabase.co/storage/v1/object/public/media/screenshot-75ef2d87-31e0-4349-a478-fb432a29e241.png"
        ],
        "scrapes": [
          {
            "url": "https://www.firecrawl.dev/",
            "html": "<html><body><h1>Firecrawl</h1></body></html>"
          }
        ]
      },
      "metadata": {
        "title": "ホーム - Firecrawl",
        "description": "Firecrawlは、あらゆるウェブサイトをクリーンなMarkdownに変換します。",
        "language": "en",
        "keywords": "Firecrawl,Markdown,データ,Mendable,Langchain",
        "robots": "follow, index",
        "ogTitle": "Firecrawl",
        "ogDescription": "あらゆるウェブサイトをLLM対応のデータに変換。",
        "ogUrl": "https://www.firecrawl.dev/",
        "ogImage": "https://www.firecrawl.dev/og.png?123",
        "ogLocaleAlternate": [],
        "ogSiteName": "Firecrawl",
        "sourceURL": "http://google.com",
        "statusCode": 200
      }
    }
  }
  ```
</CodeGroup>

アクションのパラメーターの詳細は、[APIリファレンス](https://docs.firecrawl.dev/api-reference/endpoint/scrape)を参照してください。

<div id="location-and-language">
  ## ロケーションと言語
</div>

ターゲットの地域と言語設定に基づいて関連性の高いコンテンツを得るため、国と言語の優先順を指定します。

<div id="how-it-works">
  ### 仕組み
</div>

ロケーション設定を指定すると、Firecrawl は利用可能な場合は適切なプロキシを使用し、対応する言語とタイムゾーンをエミュレートします。指定がない場合、ロケーションのデフォルトは「US」です。

<div id="usage">
  ### 使い方
</div>

場所と言語の設定を使うには、リクエストボディに `location` オブジェクトを含め、次のプロパティを指定します:

* `country`: ISO 3166-1 alpha-2 の国コード（例: 'US', 'AU', 'DE', 'JP'）。既定値は 'US'。
* `languages`: 優先度順に並べた、リクエストで使用する希望言語およびロケールの配列。既定値は指定した location の言語。

<CodeGroup>
  ```python Python theme={null}
  from firecrawl import Firecrawl

  firecrawl = Firecrawl(api_key="fc-YOUR-API-KEY")

  doc = firecrawl.scrape('https://example.com',
      formats=['markdown'],
      location={
          'country': 'US',
          'languages': ['en']
      }
  )

  print(doc)
  ```

  ```js Node theme={null}
  import Firecrawl from '@mendable/firecrawl-js';

  const firecrawl = new Firecrawl({ apiKey: "fc-YOUR-API-KEY" });

  const doc = await firecrawl.scrape('https://example.com', {
    formats: ['markdown'],
    location: { country: 'US', languages: ['en'] },
  });

  console.log(doc.metadata);
  ```

  ```bash cURL theme={null}
  curl -X POST "https://api.firecrawl.dev/v2/scrape" \
    -H "Authorization: Bearer $FIRECRAWL_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "url": "https://example.com",
      "formats": ["markdown"],
      "location": { "country": "US", "languages": ["en"] }
    }'
  ```
</CodeGroup>

対応している地域の詳細は、[Proxies ドキュメント](/ja/features/proxies)を参照してください。

<div id="caching-and-maxage">
  ## キャッシュと maxAge
</div>

リクエストを高速化するため、Firecrawl は最近のコピーがある場合、デフォルトでキャッシュから結果を返します。

* **デフォルトの鮮度ウィンドウ**: `maxAge = 172800000` ms（2日）。キャッシュされたページがこの値より新しければ即時に返し、そうでなければスクレイプしてからキャッシュします。
* **パフォーマンス**: データが厳密な最新性を要さない場合、スクレイプを最大5倍高速化できます。
* **常に最新を取得**: `maxAge` を `0` に設定します。この設定ではキャッシュを完全にバイパスするため、すべてのリクエストがスクレイピングパイプライン全体を通過し、リクエストが完了するまでの時間が長くなり、失敗する可能性も高くなります。すべてのリクエストで厳密な最新性が必須でない場合は、0以外の `maxAge` を使用してください。
* **保存しない**: このリクエストの結果を Firecrawl にキャッシュ/保存させたくない場合は、`storeInCache` を `false` に設定します。
* **変更トラッキング**: `changeTracking` を含むリクエストはキャッシュをバイパスするため、`maxAge` は無視されます。

例（常に最新コンテンツを取得）:

<CodeGroup>
  ```python Python theme={null}
  from firecrawl import Firecrawl
  firecrawl = Firecrawl(api_key='fc-YOUR_API_KEY')

  doc = firecrawl.scrape(url='https://example.com', max_age=0, formats=['markdown'])
  print(doc)
  ```

  ```js Node theme={null}
  import Firecrawl from '@mendable/firecrawl-js';

  const firecrawl = new Firecrawl({ apiKey: "fc-YOUR-API-KEY" });

  const doc = await firecrawl.scrape('https://example.com', { maxAge: 0, formats: ['markdown'] });
  console.log(doc);
  ```

  ```bash cURL theme={null}
  curl -s -X POST "https://api.firecrawl.dev/v2/scrape" \
    -H "Authorization: Bearer $FIRECRAWL_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "url": "https://example.com",
      "maxAge": 0,
      "formats": ["markdown"]
    }'
  ```
</CodeGroup>

例（10分のキャッシュウィンドウを使用）:

<CodeGroup>
  ```python Python theme={null}
  from firecrawl import Firecrawl
  firecrawl = Firecrawl(api_key='fc-YOUR_API_KEY')

  doc = firecrawl.scrape(url='https://example.com', max_age=600000, formats=['markdown', 'html'])
  print(doc)
  ```

  ```js Node theme={null}

  const firecrawl = new Firecrawl({ apiKey: "fc-YOUR-API-KEY" });

  const doc = await firecrawl.scrape('https://example.com', { maxAge: 600000, formats: ['markdown', 'html'] });
  console.log(doc);
  ```

  ```bash cURL theme={null}
  curl -s -X POST "https://api.firecrawl.dev/v2/scrape" \
    -H "Authorization: Bearer $FIRECRAWL_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "url": "https://example.com",
      "maxAge": 600000,
      "formats": ["markdown", "html"]
    }'
  ```
</CodeGroup>

<div id="batch-scraping-multiple-urls">
  ## 複数のURLのバッチスクレイピング
</div>

複数のURLを同時にバッチスクレイピングできるようになりました。開始URLと任意のパラメータを引数として受け取ります。params引数では、出力フォーマットなど、バッチスクレイピングジョブの追加オプションを指定できます。

<div id="how-it-works">
  ### 仕組み
</div>

これは `/crawl` エンドポイントの動作に非常によく似ています。バッチスクレイプのジョブを送信し、進行状況を確認するためのジョブIDを返します。

SDK は同期型と非同期型の2つのメソッドを提供します。同期型はバッチスクレイプジョブの結果を返し、非同期型はバッチスクレイプのステータス確認に使えるジョブIDを返します。

<div id="usage">
  ### 使い方
</div>

<CodeGroup>
  ```python Python theme={null}
  from firecrawl import Firecrawl

  firecrawl = Firecrawl(api_key="fc-YOUR-API-KEY")

  job = firecrawl.batch_scrape([
      "https://firecrawl.dev",
      "https://docs.firecrawl.dev",
  ], formats=["markdown"], poll_interval=2, wait_timeout=120)

  print(job)
  ```

  ```js Node theme={null}
  import Firecrawl from '@mendable/firecrawl-js';

  const firecrawl = new Firecrawl({ apiKey: "fc-YOUR-API-KEY" });

  const job = await firecrawl.batchScrape([
    'https://firecrawl.dev',
    'https://docs.firecrawl.dev',
  ], { options: { formats: ['markdown'] }, pollInterval: 2, timeout: 120 });

  console.log(job);
  ```

  ```bash cURL theme={null}
  curl -s -X POST "https://api.firecrawl.dev/v2/batch/scrape" \
    -H "Authorization: Bearer $FIRECRAWL_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "urls": ["https://firecrawl.dev", "https://docs.firecrawl.dev"],
      "formats": ["markdown"]
    }'
  ```
</CodeGroup>

<div id="response">
  ### Response
</div>

SDK の同期メソッドを使用している場合は、バッチスクレイプジョブの結果が返ります。同期メソッド以外では、バッチスクレイプのステータス確認に使用できるジョブ ID が返ります。

<div id="synchronous">
  #### 同期処理
</div>

```json 完了 theme={null}
{
  "status": "completed",
  "total": 36,
  "completed": 36,
  "creditsUsed": 36,
  "expiresAt": "2024-00-00T00:00:00.000Z",
  "next": "https://api.firecrawl.dev/v2/batch/scrape/123-456-789?skip=26",
  "data": [
    {
      "markdown": "[Firecrawl Docs のホームページ![light logo](https://mintlify.s3-us-west-1.amazonaws.com/firecrawl/logo/light.svg)!...",
      "html": "<!DOCTYPE html><html lang=\"en\" class=\"js-focus-visible lg:[--scroll-mt:9.5rem]\" data-js-focus-visible=\"\">...",
      "metadata": {
        "title": "Groq Llama 3 で「ウェブサイトと会話できる」機能を構築する | Firecrawl",
        "language": "en",
        "sourceURL": "https://docs.firecrawl.dev/learn/rag-llama3",
        "description": "Firecrawl、Groq Llama 3、LangChain を使って「自分のウェブサイトと会話できる」ボットを構築する方法を学びます。",
        "ogLocaleAlternate": [],
        "statusCode": 200
      }
    },
    ...
  ]
}
```

<div id="asynchronous">
  #### 非同期
</div>

その後、ジョブIDを使って `/batch/scrape/{id}` エンドポイントを呼び出し、バッチスクレイプのステータスを確認できます。 このエンドポイントは、ジョブの実行中、または完了直後に使用することを想定しています。**バッチスクレイプのジョブは24時間で有効期限が切れるため**です。

```json theme={null}
{
  "success": true,
  "id": "123-456-789",
  "url": "https://api.firecrawl.dev/v2/batch/scrape/123-456-789"
}
```

<div id="enhanced-mode">
  ## 強化モード
</div>

複雑なウェブサイト向けに、Firecrawl はプライバシーを保護しながら成功率を向上させる強化モードを提供しています。

[強化モード](/ja/features/enhanced-mode)について詳しくはこちら。
