POST
/
search
Search and optionally scrape search results
curl --request POST \
  --url https://api.firecrawl.dev/v2/search \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "query": "<string>",
  "limit": 5,
  "sources": [
    "web"
  ],
  "categories": [
    {
      "type": "github"
    }
  ],
  "tbs": "<string>",
  "location": "<string>",
  "timeout": 60000,
  "ignoreInvalidURLs": 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
  }
}'
{
  "success": true,
  "data": {
    "web": [
      {
        "title": "<string>",
        "description": "<string>",
        "url": "<string>",
        "markdown": "<string>",
        "html": "<string>",
        "rawHtml": "<string>",
        "links": [
          "<string>"
        ],
        "screenshot": "<string>",
        "metadata": {
          "title": "<string>",
          "description": "<string>",
          "sourceURL": "<string>",
          "statusCode": 123,
          "error": "<string>"
        }
      }
    ],
    "images": [
      {
        "title": "<string>",
        "imageUrl": "<string>",
        "imageWidth": 123,
        "imageHeight": 123,
        "url": "<string>",
        "position": 123
      }
    ],
    "news": [
      {
        "title": "<string>",
        "snippet": "<string>",
        "url": "<string>",
        "date": "<string>",
        "imageUrl": "<string>",
        "position": 123,
        "markdown": "<string>",
        "html": "<string>",
        "rawHtml": "<string>",
        "links": [
          "<string>"
        ],
        "screenshot": "<string>",
        "metadata": {
          "title": "<string>",
          "description": "<string>",
          "sourceURL": "<string>",
          "statusCode": 123,
          "error": "<string>"
        }
      }
    ]
  },
  "warning": "<string>"
}

v2の新機能

複数ソースを検索

Web、画像、ニュースをまとめて検索:
{
  "query": "firecrawl web scraping",
  "sources": [ "web", "images", "news" ]
}

レスポンス形式の変更

v1: 結果はフラットなリスト。v2: ソースタイプ別に整理:
{
  "success": true,
  "data": {
    "web": [/* ウェブ検索結果 */],
    "images": [/* 画像検索結果 */],
    "news": [/* ニュース検索結果 */]
  }
}

新機能

  • 期間でフィルタ(「past week」「past month」)
  • 特定の国や地域を指定してターゲット
  • カテゴリで絞り込み:GitHub リポジトリや研究サイト内を検索
  • アルファ期間中は結果を最大500件に制限
/search エンドポイントは、Web 検索(SERP)と Firecrawl のスクレイピング機能を組み合わせ、任意のクエリに対してページ全体のコンテンツを返します。 各検索結果の完全な Markdown コンテンツを取得するには、scrapeOptionsformats: [{"type": "markdown"}] を指定してください。指定しない場合は、SERP の結果(url、title、description)がデフォルトで返されます。要約コンテンツには {"type": "summary"} など他のフォーマットも使用できます。

サポートされているクエリ演算子

検索をより的確に絞り込むための各種クエリ演算子をサポートしています。
演算子機能
""テキストを厳密一致で検索する"Firecrawl"
-特定のキーワードを除外、または他の演算子を否定する-bad, -site:firecrawl.dev
site:指定したサイトの結果のみを返すsite:firecrawl.dev
inurl:URL に特定の語を含む結果のみを返すinurl:firecrawl
allinurl:URL に複数の語を含む結果のみを返すallinurl:git firecrawl
intitle:ページタイトルに特定の語を含む結果のみを返すintitle:Firecrawl
allintitle:ページタイトルに複数の語を含む結果のみを返すallintitle:firecrawl playground
related:特定のドメインに関連する結果のみを返すrelated:firecrawl.dev
imagesize:指定した寸法と完全一致の画像のみを返すimagesize:1920x1080
larger:指定した寸法より大きい画像のみを返すlarger:1920x1080

Location パラメータ

location パラメータで地域ターゲットの検索結果を取得します。形式: "string"。例: "Germany""San Francisco,California,United States" 利用可能な国と言語の一覧は、サポート対象ロケーションの全リストをご覧ください。

categories パラメータ

categories パラメータを使って、特定のカテゴリで検索結果をフィルタリングします:
  • github: GitHub のリポジトリ、コード、Issue、ドキュメントを対象に検索
  • research: 学術・研究系のウェブサイト(arXiv、Nature、IEEE、PubMed など)を対象に検索

使い方の例

{
  "query": "機械学習",
  "categories": ["github", "research"],
  "limit": 10
}

カテゴリ応答

各結果には、出所を示す category フィールドが含まれます。
{
  "success": true,
  "data": {
    "web": [
      {
        "url": "https://github.com/example/ml-project",
        "title": "Machine Learning Project",
        "description": "MLアルゴリズムの実装",
        "category": "github"
      },
      {
        "url": "https://arxiv.org/abs/2024.12345",
        "title": "ML研究論文",
        "description": "機械学習の最新動向",
        "category": "research"
      }
    ]
  }
}
tbs パラメータを使用すると、カスタム日付範囲を含む期間で結果を絞り込めます。詳しい例や対応フォーマットは、Search 機能のドキュメントを参照してください。

Authorizations

Authorization
string
header
required

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

Body

application/json
query
string
required

The search query

limit
integer
default:5

Maximum number of results to return

Required range: 1 <= x <= 100
sources
(Web · object | Images · object | News · object)[]

Sources to search. Will determine the arrays available in the response.

categories
(GitHub · object | Research · object)[]

Categories to filter results by

tbs
string

Time-based search parameter. Supports predefined time ranges (qdr:h, qdr:d, qdr:w, qdr:m, qdr:y) and custom date ranges (cdr:1,cd_min:MM/DD/YYYY,cd_max:MM/DD/YYYY)

location
string

Location parameter for search results

timeout
integer
default:60000

Timeout in milliseconds

ignoreInvalidURLs
boolean
default:false

Excludes URLs from the search results that are invalid for other Firecrawl endpoints. This helps reduce errors if you are piping data from search into other Firecrawl API endpoints.

scrapeOptions
object

Options for scraping search results

Response

Successful response

success
boolean
data
object

The search results. The arrays available will depend on the sources you specified in the request. By default, the web array will be returned.

warning
string | null

Warning message if any issues occurred