メインコンテンツへスキップ
POST
/
extract
LLM を使ってページから構造化データを抽出
curl --request POST \
  --url https://api.firecrawl.dev/v2/extract \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "urls": [
    "<string>"
  ],
  "prompt": "<string>",
  "schema": {},
  "enableWebSearch": false,
  "ignoreSitemap": false,
  "includeSubdomains": true,
  "showSources": false,
  "scrapeOptions": {
    "formats": [
      "markdown"
    ],
    "onlyMainContent": true,
    "includeTags": [
      "<string>"
    ],
    "excludeTags": [
      "<string>"
    ],
    "maxAge": 172800000,
    "headers": {},
    "waitFor": 0,
    "mobile": false,
    "skipTlsVerification": true,
    "timeout": 123,
    "parsers": [
      "pdf"
    ],
    "actions": [
      {
        "type": "wait",
        "milliseconds": 2,
        "selector": "#my-element"
      }
    ],
    "location": {
      "country": "US",
      "languages": [
        "en-US"
      ]
    },
    "removeBase64Images": true,
    "blockAds": true,
    "proxy": "auto",
    "storeInCache": true
  },
  "ignoreInvalidURLs": true
}
'
{
  "success": true,
  "id": "<string>",
  "invalidURLs": [
    "<string>"
  ]
}

承認

Authorization
string
header
必須

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

ボディ

application/json
urls
string<uri>[]
必須

データを抽出する対象のURLです。URLはグロブ形式で指定してください。

prompt
string

抽出プロセスをガイドするプロンプト

schema
object

抽出されたデータの構造を定義するためのスキーマ。JSON Schema に準拠する必要があります。

true の場合、抽出処理で Web 検索を使用して追加データを取得します

ignoreSitemap
boolean
デフォルト:false

true の場合、サイトのスキャン時に sitemap.xml ファイルは無視されます

includeSubdomains
boolean
デフォルト:true

true の場合、指定した URL のサブドメインもスキャンされます

showSources
boolean
デフォルト:false

true の場合、データ抽出に使用されたソースがレスポンスの sources キーに含まれます

scrapeOptions
object
ignoreInvalidURLs
boolean
デフォルト:true

urls 配列に無効な URL が含まれている場合、それらは無視されます。無効な URL が原因でリクエスト全体が失敗するのではなく、有効な URL のみを使用して抽出が実行され、無効な URL はレスポンスの invalidURLs フィールドで返されます。

レスポンス

抽出が成功しました

success
boolean
id
string
invalidURLs
string[] | null

ignoreInvalidURLs が true の場合、このフィールドはリクエストで指定された無効な URL を含む配列です。無効な URL がない場合、この配列は空になります。ignoreInvalidURLs が false の場合、このフィールドは undefined になります。