跳转到主要内容
POST
/
search
Search and optionally scrape search results
curl --request POST \
  --url https://api.firecrawl.dev/v1/search \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "query": "<string>",
  "limit": 5,
  "tbs": "<string>",
  "location": "<string>",
  "timeout": 60000,
  "ignoreInvalidURLs": false,
  "scrapeOptions": {
    "onlyMainContent": true,
    "includeTags": [
      "<string>"
    ],
    "excludeTags": [
      "<string>"
    ],
    "maxAge": 0,
    "headers": {},
    "waitFor": 0,
    "mobile": false,
    "skipTlsVerification": false,
    "timeout": 30000,
    "parsePDF": true,
    "jsonOptions": {
      "schema": {},
      "systemPrompt": "<string>",
      "prompt": "<string>"
    },
    "actions": [
      {
        "type": "wait",
        "milliseconds": 2,
        "selector": "#my-element"
      }
    ],
    "location": {
      "country": "US",
      "languages": [
        "en-US"
      ]
    },
    "removeBase64Images": true,
    "blockAds": true,
    "proxy": "basic",
    "storeInCache": true,
    "formats": []
  }
}'
{
  "success": true,
  "data": [
    {
      "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>"
      }
    }
  ],
  "warning": "<string>"
}
注意:现已推出该 API 的全新 v2 版本,功能与性能均有升级。
该 /search 端点将网页搜索(SERP)与 Firecrawl 的抓取能力相结合,可为任意查询返回完整页面内容。 在请求中包含 scrapeOptions 并设置 formats: ["markdown"],即可为每个搜索结果获取完整的 markdown 内容;否则将默认仅返回 SERP 结果(url、title、description)。

支持的查询运算符

我们提供多种查询运算符,帮助你更精准地筛选搜索结果。
运算符功能示例
""对一段文本进行精确匹配"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

Location 参数

使用 location 参数获取按地理位置定向的搜索结果。格式:“string”。示例:“Germany”、“San Francisco,California,United States”。 请参阅完整的支持位置列表,了解所有可用的国家和语言。 使用 tbs 参数按时间范围筛选结果,支持自定义日期区间。详见搜索功能文档,其中包含详细示例和支持的 formats。

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
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[]
warning
string | null

Warning message if any issues occurred