検索を行い、必要に応じて検索結果をスクレイピングする
curl --request POST \
--url https://api.firecrawl.dev/v1/search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"query": "<string>",
"ignoreInvalidURLs": false,
"limit": 5,
"location": "<string>",
"scrapeOptions": {},
"tbs": "<string>",
"threatProtection": {
"blacklist": [
"<string>"
],
"blockedTlds": [
"<string>"
],
"riskScoreThreshold": 75,
"whitelist": [
"<string>"
]
},
"timeout": 60000
}
'import requests
url = "https://api.firecrawl.dev/v1/search"
payload = {
"query": "<string>",
"ignoreInvalidURLs": False,
"limit": 5,
"location": "<string>",
"scrapeOptions": {},
"tbs": "<string>",
"threatProtection": {
"blacklist": ["<string>"],
"blockedTlds": ["<string>"],
"riskScoreThreshold": 75,
"whitelist": ["<string>"]
},
"timeout": 60000
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
query: '<string>',
ignoreInvalidURLs: false,
limit: 5,
location: '<string>',
scrapeOptions: {},
tbs: '<string>',
threatProtection: {
blacklist: ['<string>'],
blockedTlds: ['<string>'],
riskScoreThreshold: 75,
whitelist: ['<string>']
},
timeout: 60000
})
};
fetch('https://api.firecrawl.dev/v1/search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.firecrawl.dev/v1/search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'query' => '<string>',
'ignoreInvalidURLs' => false,
'limit' => 5,
'location' => '<string>',
'scrapeOptions' => [
],
'tbs' => '<string>',
'threatProtection' => [
'blacklist' => [
'<string>'
],
'blockedTlds' => [
'<string>'
],
'riskScoreThreshold' => 75,
'whitelist' => [
'<string>'
]
],
'timeout' => 60000
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.firecrawl.dev/v1/search"
payload := strings.NewReader("{\n \"query\": \"<string>\",\n \"ignoreInvalidURLs\": false,\n \"limit\": 5,\n \"location\": \"<string>\",\n \"scrapeOptions\": {},\n \"tbs\": \"<string>\",\n \"threatProtection\": {\n \"blacklist\": [\n \"<string>\"\n ],\n \"blockedTlds\": [\n \"<string>\"\n ],\n \"riskScoreThreshold\": 75,\n \"whitelist\": [\n \"<string>\"\n ]\n },\n \"timeout\": 60000\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.firecrawl.dev/v1/search")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"<string>\",\n \"ignoreInvalidURLs\": false,\n \"limit\": 5,\n \"location\": \"<string>\",\n \"scrapeOptions\": {},\n \"tbs\": \"<string>\",\n \"threatProtection\": {\n \"blacklist\": [\n \"<string>\"\n ],\n \"blockedTlds\": [\n \"<string>\"\n ],\n \"riskScoreThreshold\": 75,\n \"whitelist\": [\n \"<string>\"\n ]\n },\n \"timeout\": 60000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.firecrawl.dev/v1/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"query\": \"<string>\",\n \"ignoreInvalidURLs\": false,\n \"limit\": 5,\n \"location\": \"<string>\",\n \"scrapeOptions\": {},\n \"tbs\": \"<string>\",\n \"threatProtection\": {\n \"blacklist\": [\n \"<string>\"\n ],\n \"blockedTlds\": [\n \"<string>\"\n ],\n \"riskScoreThreshold\": 75,\n \"whitelist\": [\n \"<string>\"\n ]\n },\n \"timeout\": 60000\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"description": "<string>",
"html": "<string>",
"links": [
"<string>"
],
"markdown": "<string>",
"metadata": {
"description": "<string>",
"error": "<string>",
"numPages": 123,
"sourceURL": "<string>",
"statusCode": 123,
"title": "<string>",
"totalPages": 123
},
"rawHtml": "<string>",
"screenshot": "<string>",
"title": "<string>",
"url": "<string>"
}
],
"id": "<string>",
"success": true,
"warning": "<string>"
}{
"error": "Request timed out",
"success": false
}{
"error": "An unexpected error occurred on the server.",
"success": false
}検索エンドポイント
Search
POST
/
search
検索を行い、必要に応じて検索結果をスクレイピングする
curl --request POST \
--url https://api.firecrawl.dev/v1/search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"query": "<string>",
"ignoreInvalidURLs": false,
"limit": 5,
"location": "<string>",
"scrapeOptions": {},
"tbs": "<string>",
"threatProtection": {
"blacklist": [
"<string>"
],
"blockedTlds": [
"<string>"
],
"riskScoreThreshold": 75,
"whitelist": [
"<string>"
]
},
"timeout": 60000
}
'import requests
url = "https://api.firecrawl.dev/v1/search"
payload = {
"query": "<string>",
"ignoreInvalidURLs": False,
"limit": 5,
"location": "<string>",
"scrapeOptions": {},
"tbs": "<string>",
"threatProtection": {
"blacklist": ["<string>"],
"blockedTlds": ["<string>"],
"riskScoreThreshold": 75,
"whitelist": ["<string>"]
},
"timeout": 60000
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
query: '<string>',
ignoreInvalidURLs: false,
limit: 5,
location: '<string>',
scrapeOptions: {},
tbs: '<string>',
threatProtection: {
blacklist: ['<string>'],
blockedTlds: ['<string>'],
riskScoreThreshold: 75,
whitelist: ['<string>']
},
timeout: 60000
})
};
fetch('https://api.firecrawl.dev/v1/search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.firecrawl.dev/v1/search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'query' => '<string>',
'ignoreInvalidURLs' => false,
'limit' => 5,
'location' => '<string>',
'scrapeOptions' => [
],
'tbs' => '<string>',
'threatProtection' => [
'blacklist' => [
'<string>'
],
'blockedTlds' => [
'<string>'
],
'riskScoreThreshold' => 75,
'whitelist' => [
'<string>'
]
],
'timeout' => 60000
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.firecrawl.dev/v1/search"
payload := strings.NewReader("{\n \"query\": \"<string>\",\n \"ignoreInvalidURLs\": false,\n \"limit\": 5,\n \"location\": \"<string>\",\n \"scrapeOptions\": {},\n \"tbs\": \"<string>\",\n \"threatProtection\": {\n \"blacklist\": [\n \"<string>\"\n ],\n \"blockedTlds\": [\n \"<string>\"\n ],\n \"riskScoreThreshold\": 75,\n \"whitelist\": [\n \"<string>\"\n ]\n },\n \"timeout\": 60000\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.firecrawl.dev/v1/search")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"<string>\",\n \"ignoreInvalidURLs\": false,\n \"limit\": 5,\n \"location\": \"<string>\",\n \"scrapeOptions\": {},\n \"tbs\": \"<string>\",\n \"threatProtection\": {\n \"blacklist\": [\n \"<string>\"\n ],\n \"blockedTlds\": [\n \"<string>\"\n ],\n \"riskScoreThreshold\": 75,\n \"whitelist\": [\n \"<string>\"\n ]\n },\n \"timeout\": 60000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.firecrawl.dev/v1/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"query\": \"<string>\",\n \"ignoreInvalidURLs\": false,\n \"limit\": 5,\n \"location\": \"<string>\",\n \"scrapeOptions\": {},\n \"tbs\": \"<string>\",\n \"threatProtection\": {\n \"blacklist\": [\n \"<string>\"\n ],\n \"blockedTlds\": [\n \"<string>\"\n ],\n \"riskScoreThreshold\": 75,\n \"whitelist\": [\n \"<string>\"\n ]\n },\n \"timeout\": 60000\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"description": "<string>",
"html": "<string>",
"links": [
"<string>"
],
"markdown": "<string>",
"metadata": {
"description": "<string>",
"error": "<string>",
"numPages": 123,
"sourceURL": "<string>",
"statusCode": 123,
"title": "<string>",
"totalPages": 123
},
"rawHtml": "<string>",
"screenshot": "<string>",
"title": "<string>",
"url": "<string>"
}
],
"id": "<string>",
"success": true,
"warning": "<string>"
}{
"error": "Request timed out",
"success": false
}{
"error": "An unexpected error occurred on the server.",
"success": false
}注意: 機能とパフォーマンスが向上した new v2 version of this API が利用可能です。search エンドポイントは、ウェブ検索と Firecrawl のスクレイピング機能を組み合わせ、任意のクエリに対してページ全体のコンテンツを返します。 各検索結果の完全な Markdown コンテンツを取得するには、
scrapeOptions に formats: ["markdown"] を指定してください。指定しない場合は、既定で結果 (url、title、description) のみが返されます。
サポートされているクエリ演算子
| Operator | Functionality | Examples |
|---|---|---|
"" | 文字列を厳密一致させる | "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 パラメータを使うと、カスタムの日付範囲を含む期間で結果を絞り込めます。具体例や対応フォーマットは、検索機能のドキュメントを参照してください。承認
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
ボディ
application/json
検索クエリ
他の Firecrawl エンドポイントでは無効となる URL を検索結果から除外します。検索結果のデータを他の Firecrawl API エンドポイントにパイプで渡す場合のエラー削減に役立ちます。
返す結果の最大件数
必須範囲:
1 <= x <= 100検索結果の location パラメーター
検索結果スクレイピングのオプション
Show child attributes
Show child attributes
時間指定の検索パラメータ。事前定義された時間範囲(qdr:h、qdr:d、qdr:w、qdr:m、qdr:y)と、カスタム日付範囲(cdr:1,cd_min:MM/DD/YYYY,cd_max:MM/DD/YYYY)をサポートします
リクエスト単位の脅威保護オーバーライドです。指定したフィールドは、このリクエストに限り、組織のポリシー内の対応するフィールドを上書きします。省略したフィールドには組織レベルの値がそのまま使用されます。利用するには、チームで脅威保護(エンタープライズ機能)が有効になっている必要があります。そうでない場合、リクエストは 403 で拒否されます。組織でリクエストのオーバーライドが無効になっている場合、このオブジェクトを含むリクエストはすべて 403 で拒否されます。チームで脅威保護の適用が必須になっている場合、mode に off は設定できません。
Show child attributes
Show child attributes
タイムアウト(ミリ秒)
⌘I

