クロール
curl --request POST \
--url https://api.firecrawl.dev/v1/crawl \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"excludePaths": [
"<string>"
],
"includePaths": [
"<string>"
],
"regexOnFullURL": false,
"maxDepth": 10,
"maxDiscoveryDepth": 123,
"ignoreSitemap": false,
"ignoreQueryParameters": false,
"limit": 10000,
"allowBackwardLinks": false,
"crawlEntireDomain": false,
"allowExternalLinks": false,
"allowSubdomains": false,
"delay": 123,
"maxConcurrency": 123,
"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,
"storeInCache": true,
"formats": [
"markdown"
],
"changeTrackingOptions": {
"modes": [],
"schema": {},
"prompt": "<string>",
"tag": null
}
},
"zeroDataRetention": false
}
'import requests
url = "https://api.firecrawl.dev/v1/crawl"
payload = {
"url": "<string>",
"excludePaths": ["<string>"],
"includePaths": ["<string>"],
"regexOnFullURL": False,
"maxDepth": 10,
"maxDiscoveryDepth": 123,
"ignoreSitemap": False,
"ignoreQueryParameters": False,
"limit": 10000,
"allowBackwardLinks": False,
"crawlEntireDomain": False,
"allowExternalLinks": False,
"allowSubdomains": False,
"delay": 123,
"maxConcurrency": 123,
"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,
"storeInCache": True,
"formats": ["markdown"],
"changeTrackingOptions": {
"modes": [],
"schema": {},
"prompt": "<string>",
"tag": None
}
},
"zeroDataRetention": False
}
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({
url: '<string>',
excludePaths: ['<string>'],
includePaths: ['<string>'],
regexOnFullURL: false,
maxDepth: 10,
maxDiscoveryDepth: 123,
ignoreSitemap: false,
ignoreQueryParameters: false,
limit: 10000,
allowBackwardLinks: false,
crawlEntireDomain: false,
allowExternalLinks: false,
allowSubdomains: false,
delay: 123,
maxConcurrency: 123,
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,
storeInCache: true,
formats: ['markdown'],
changeTrackingOptions: {modes: [], schema: {}, prompt: '<string>', tag: null}
},
zeroDataRetention: false
})
};
fetch('https://api.firecrawl.dev/v1/crawl', 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/crawl",
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([
'url' => '<string>',
'excludePaths' => [
'<string>'
],
'includePaths' => [
'<string>'
],
'regexOnFullURL' => false,
'maxDepth' => 10,
'maxDiscoveryDepth' => 123,
'ignoreSitemap' => false,
'ignoreQueryParameters' => false,
'limit' => 10000,
'allowBackwardLinks' => false,
'crawlEntireDomain' => false,
'allowExternalLinks' => false,
'allowSubdomains' => false,
'delay' => 123,
'maxConcurrency' => 123,
'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,
'storeInCache' => true,
'formats' => [
'markdown'
],
'changeTrackingOptions' => [
'modes' => [
],
'schema' => [
],
'prompt' => '<string>',
'tag' => null
]
],
'zeroDataRetention' => false
]),
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/crawl"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"excludePaths\": [\n \"<string>\"\n ],\n \"includePaths\": [\n \"<string>\"\n ],\n \"regexOnFullURL\": false,\n \"maxDepth\": 10,\n \"maxDiscoveryDepth\": 123,\n \"ignoreSitemap\": false,\n \"ignoreQueryParameters\": false,\n \"limit\": 10000,\n \"allowBackwardLinks\": false,\n \"crawlEntireDomain\": false,\n \"allowExternalLinks\": false,\n \"allowSubdomains\": false,\n \"delay\": 123,\n \"maxConcurrency\": 123,\n \"scrapeOptions\": {\n \"onlyMainContent\": true,\n \"includeTags\": [\n \"<string>\"\n ],\n \"excludeTags\": [\n \"<string>\"\n ],\n \"maxAge\": 0,\n \"headers\": {},\n \"waitFor\": 0,\n \"mobile\": false,\n \"skipTlsVerification\": false,\n \"timeout\": 30000,\n \"parsePDF\": true,\n \"jsonOptions\": {\n \"schema\": {},\n \"systemPrompt\": \"<string>\",\n \"prompt\": \"<string>\"\n },\n \"actions\": [\n {\n \"type\": \"wait\",\n \"milliseconds\": 2,\n \"selector\": \"#my-element\"\n }\n ],\n \"location\": {\n \"country\": \"US\",\n \"languages\": [\n \"en-US\"\n ]\n },\n \"removeBase64Images\": true,\n \"blockAds\": true,\n \"storeInCache\": true,\n \"formats\": [\n \"markdown\"\n ],\n \"changeTrackingOptions\": {\n \"modes\": [],\n \"schema\": {},\n \"prompt\": \"<string>\",\n \"tag\": null\n }\n },\n \"zeroDataRetention\": false\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/crawl")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"excludePaths\": [\n \"<string>\"\n ],\n \"includePaths\": [\n \"<string>\"\n ],\n \"regexOnFullURL\": false,\n \"maxDepth\": 10,\n \"maxDiscoveryDepth\": 123,\n \"ignoreSitemap\": false,\n \"ignoreQueryParameters\": false,\n \"limit\": 10000,\n \"allowBackwardLinks\": false,\n \"crawlEntireDomain\": false,\n \"allowExternalLinks\": false,\n \"allowSubdomains\": false,\n \"delay\": 123,\n \"maxConcurrency\": 123,\n \"scrapeOptions\": {\n \"onlyMainContent\": true,\n \"includeTags\": [\n \"<string>\"\n ],\n \"excludeTags\": [\n \"<string>\"\n ],\n \"maxAge\": 0,\n \"headers\": {},\n \"waitFor\": 0,\n \"mobile\": false,\n \"skipTlsVerification\": false,\n \"timeout\": 30000,\n \"parsePDF\": true,\n \"jsonOptions\": {\n \"schema\": {},\n \"systemPrompt\": \"<string>\",\n \"prompt\": \"<string>\"\n },\n \"actions\": [\n {\n \"type\": \"wait\",\n \"milliseconds\": 2,\n \"selector\": \"#my-element\"\n }\n ],\n \"location\": {\n \"country\": \"US\",\n \"languages\": [\n \"en-US\"\n ]\n },\n \"removeBase64Images\": true,\n \"blockAds\": true,\n \"storeInCache\": true,\n \"formats\": [\n \"markdown\"\n ],\n \"changeTrackingOptions\": {\n \"modes\": [],\n \"schema\": {},\n \"prompt\": \"<string>\",\n \"tag\": null\n }\n },\n \"zeroDataRetention\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.firecrawl.dev/v1/crawl")
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 \"url\": \"<string>\",\n \"excludePaths\": [\n \"<string>\"\n ],\n \"includePaths\": [\n \"<string>\"\n ],\n \"regexOnFullURL\": false,\n \"maxDepth\": 10,\n \"maxDiscoveryDepth\": 123,\n \"ignoreSitemap\": false,\n \"ignoreQueryParameters\": false,\n \"limit\": 10000,\n \"allowBackwardLinks\": false,\n \"crawlEntireDomain\": false,\n \"allowExternalLinks\": false,\n \"allowSubdomains\": false,\n \"delay\": 123,\n \"maxConcurrency\": 123,\n \"scrapeOptions\": {\n \"onlyMainContent\": true,\n \"includeTags\": [\n \"<string>\"\n ],\n \"excludeTags\": [\n \"<string>\"\n ],\n \"maxAge\": 0,\n \"headers\": {},\n \"waitFor\": 0,\n \"mobile\": false,\n \"skipTlsVerification\": false,\n \"timeout\": 30000,\n \"parsePDF\": true,\n \"jsonOptions\": {\n \"schema\": {},\n \"systemPrompt\": \"<string>\",\n \"prompt\": \"<string>\"\n },\n \"actions\": [\n {\n \"type\": \"wait\",\n \"milliseconds\": 2,\n \"selector\": \"#my-element\"\n }\n ],\n \"location\": {\n \"country\": \"US\",\n \"languages\": [\n \"en-US\"\n ]\n },\n \"removeBase64Images\": true,\n \"blockAds\": true,\n \"storeInCache\": true,\n \"formats\": [\n \"markdown\"\n ],\n \"changeTrackingOptions\": {\n \"modes\": [],\n \"schema\": {},\n \"prompt\": \"<string>\",\n \"tag\": null\n }\n },\n \"zeroDataRetention\": false\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"id": "<string>",
"url": "<string>"
}{
"error": "Payment required to access this resource."
}{
"error": "Request rate limit exceeded. Please wait and try again later."
}{
"error": "An unexpected error occurred on the server."
}注記: 機能とパフォーマンスが向上した本 API の新しい v2 バージョンが利用可能です。
承認
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
ボディ
クロールを開始するためのベースURL
クロール対象からURLを除外するための URL パス名の正規表現パターンです。たとえば、ベース URL が firecrawl.dev の場合に "excludePaths": ["blog/.*"] を設定すると、https://www.firecrawl.dev/blog/firecrawl-launch-week-1-recap のように、そのパターンに一致する結果はすべて除外されます。
クロールに含めるURLを指定するための、URLパス名に対する正規表現パターンです。指定したパターンに一致するパスのみがレスポンスに含まれます。たとえば、ベースURLが firecrawl.dev の場合に "includePaths": ["blog/.*"] を設定すると、そのパターンに一致する結果のみが含まれます(例: https://www.firecrawl.dev/blog/firecrawl-launch-week-1-recap)。
true の場合、includePaths および excludePaths の正規表現パターンは、URL のパス名だけでなく、クエリパラメータを含む URL 全体に対して照合されます。クエリ文字列に基づいて URL をフィルタリングしたい場合に便利です。
入力されたURLのベースからクロールできる最大の絶対深度です。基本的には、スクレイピング対象となるURLのパス名に含めることができるスラッシュの最大数を指します。
発見順序に基づいてクロールする最大の深さです。ルートサイトおよびサイトマップに含まれるページの発見深度は 0 です。例えば、これを 1 に設定し、かつ ignoreSitemap を有効にした場合、入力した URL と、そのページ上からリンクされているすべての URL のみをクロールします。
クロール時にサイトマップを無視する
同じパスを、クエリパラメータを変えて(または付けずに)再度スクレイピングしないでください
クロールするページの最大数です。デフォルトの上限は 10,000 です。
⚠️ 非推奨: 代わりに 'crawlEntireDomain' を使用してください。クローラーが子パスだけでなく、同一階層や親のURLへの内部リンクもたどれるようにします。
クローラーがたどるリンクの範囲を、子パスだけでなく同一階層や親階層の内部リンクにも広げます。
false: より深い(子)URL だけをクロールします。 → 例: /features/feature-1 → /features/feature-1/tips ✅ → /pricing や / には移動しない ❌
true: 同一階層や親階層のパスを含む、あらゆる内部リンクをクロールします。 → 例: /features/feature-1 → /pricing、/ など ✅
ネストされたパスだけでなく、サイト内部全体を広くカバーしたい場合は true に設定します。
クローラーが外部サイトへのリンクをたどることを許可します。
クロール時に、クローラーがメインドメイン配下のサブドメインへのリンクをたどれるようにします。
スクレイピング実行間の待機時間(秒)。ウェブサイトのレート制限を遵守するのに役立ちます。
同時に実行するスクレイプの最大数。このパラメータで、このクロールに対する同時実行数の上限を設定できます。指定しない場合は、チームの同時実行数上限が適用されます。
Webhook仕様オブジェクト。
Show child attributes
Show child attributes
Show child attributes
Show child attributes
true の場合、このクロールではデータを一切保持しないゼロデータ保持モードが有効になります。この機能を有効にするには、help@firecrawl.dev までお問い合わせください。
curl --request POST \
--url https://api.firecrawl.dev/v1/crawl \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"excludePaths": [
"<string>"
],
"includePaths": [
"<string>"
],
"regexOnFullURL": false,
"maxDepth": 10,
"maxDiscoveryDepth": 123,
"ignoreSitemap": false,
"ignoreQueryParameters": false,
"limit": 10000,
"allowBackwardLinks": false,
"crawlEntireDomain": false,
"allowExternalLinks": false,
"allowSubdomains": false,
"delay": 123,
"maxConcurrency": 123,
"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,
"storeInCache": true,
"formats": [
"markdown"
],
"changeTrackingOptions": {
"modes": [],
"schema": {},
"prompt": "<string>",
"tag": null
}
},
"zeroDataRetention": false
}
'import requests
url = "https://api.firecrawl.dev/v1/crawl"
payload = {
"url": "<string>",
"excludePaths": ["<string>"],
"includePaths": ["<string>"],
"regexOnFullURL": False,
"maxDepth": 10,
"maxDiscoveryDepth": 123,
"ignoreSitemap": False,
"ignoreQueryParameters": False,
"limit": 10000,
"allowBackwardLinks": False,
"crawlEntireDomain": False,
"allowExternalLinks": False,
"allowSubdomains": False,
"delay": 123,
"maxConcurrency": 123,
"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,
"storeInCache": True,
"formats": ["markdown"],
"changeTrackingOptions": {
"modes": [],
"schema": {},
"prompt": "<string>",
"tag": None
}
},
"zeroDataRetention": False
}
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({
url: '<string>',
excludePaths: ['<string>'],
includePaths: ['<string>'],
regexOnFullURL: false,
maxDepth: 10,
maxDiscoveryDepth: 123,
ignoreSitemap: false,
ignoreQueryParameters: false,
limit: 10000,
allowBackwardLinks: false,
crawlEntireDomain: false,
allowExternalLinks: false,
allowSubdomains: false,
delay: 123,
maxConcurrency: 123,
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,
storeInCache: true,
formats: ['markdown'],
changeTrackingOptions: {modes: [], schema: {}, prompt: '<string>', tag: null}
},
zeroDataRetention: false
})
};
fetch('https://api.firecrawl.dev/v1/crawl', 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/crawl",
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([
'url' => '<string>',
'excludePaths' => [
'<string>'
],
'includePaths' => [
'<string>'
],
'regexOnFullURL' => false,
'maxDepth' => 10,
'maxDiscoveryDepth' => 123,
'ignoreSitemap' => false,
'ignoreQueryParameters' => false,
'limit' => 10000,
'allowBackwardLinks' => false,
'crawlEntireDomain' => false,
'allowExternalLinks' => false,
'allowSubdomains' => false,
'delay' => 123,
'maxConcurrency' => 123,
'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,
'storeInCache' => true,
'formats' => [
'markdown'
],
'changeTrackingOptions' => [
'modes' => [
],
'schema' => [
],
'prompt' => '<string>',
'tag' => null
]
],
'zeroDataRetention' => false
]),
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/crawl"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"excludePaths\": [\n \"<string>\"\n ],\n \"includePaths\": [\n \"<string>\"\n ],\n \"regexOnFullURL\": false,\n \"maxDepth\": 10,\n \"maxDiscoveryDepth\": 123,\n \"ignoreSitemap\": false,\n \"ignoreQueryParameters\": false,\n \"limit\": 10000,\n \"allowBackwardLinks\": false,\n \"crawlEntireDomain\": false,\n \"allowExternalLinks\": false,\n \"allowSubdomains\": false,\n \"delay\": 123,\n \"maxConcurrency\": 123,\n \"scrapeOptions\": {\n \"onlyMainContent\": true,\n \"includeTags\": [\n \"<string>\"\n ],\n \"excludeTags\": [\n \"<string>\"\n ],\n \"maxAge\": 0,\n \"headers\": {},\n \"waitFor\": 0,\n \"mobile\": false,\n \"skipTlsVerification\": false,\n \"timeout\": 30000,\n \"parsePDF\": true,\n \"jsonOptions\": {\n \"schema\": {},\n \"systemPrompt\": \"<string>\",\n \"prompt\": \"<string>\"\n },\n \"actions\": [\n {\n \"type\": \"wait\",\n \"milliseconds\": 2,\n \"selector\": \"#my-element\"\n }\n ],\n \"location\": {\n \"country\": \"US\",\n \"languages\": [\n \"en-US\"\n ]\n },\n \"removeBase64Images\": true,\n \"blockAds\": true,\n \"storeInCache\": true,\n \"formats\": [\n \"markdown\"\n ],\n \"changeTrackingOptions\": {\n \"modes\": [],\n \"schema\": {},\n \"prompt\": \"<string>\",\n \"tag\": null\n }\n },\n \"zeroDataRetention\": false\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/crawl")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"excludePaths\": [\n \"<string>\"\n ],\n \"includePaths\": [\n \"<string>\"\n ],\n \"regexOnFullURL\": false,\n \"maxDepth\": 10,\n \"maxDiscoveryDepth\": 123,\n \"ignoreSitemap\": false,\n \"ignoreQueryParameters\": false,\n \"limit\": 10000,\n \"allowBackwardLinks\": false,\n \"crawlEntireDomain\": false,\n \"allowExternalLinks\": false,\n \"allowSubdomains\": false,\n \"delay\": 123,\n \"maxConcurrency\": 123,\n \"scrapeOptions\": {\n \"onlyMainContent\": true,\n \"includeTags\": [\n \"<string>\"\n ],\n \"excludeTags\": [\n \"<string>\"\n ],\n \"maxAge\": 0,\n \"headers\": {},\n \"waitFor\": 0,\n \"mobile\": false,\n \"skipTlsVerification\": false,\n \"timeout\": 30000,\n \"parsePDF\": true,\n \"jsonOptions\": {\n \"schema\": {},\n \"systemPrompt\": \"<string>\",\n \"prompt\": \"<string>\"\n },\n \"actions\": [\n {\n \"type\": \"wait\",\n \"milliseconds\": 2,\n \"selector\": \"#my-element\"\n }\n ],\n \"location\": {\n \"country\": \"US\",\n \"languages\": [\n \"en-US\"\n ]\n },\n \"removeBase64Images\": true,\n \"blockAds\": true,\n \"storeInCache\": true,\n \"formats\": [\n \"markdown\"\n ],\n \"changeTrackingOptions\": {\n \"modes\": [],\n \"schema\": {},\n \"prompt\": \"<string>\",\n \"tag\": null\n }\n },\n \"zeroDataRetention\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.firecrawl.dev/v1/crawl")
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 \"url\": \"<string>\",\n \"excludePaths\": [\n \"<string>\"\n ],\n \"includePaths\": [\n \"<string>\"\n ],\n \"regexOnFullURL\": false,\n \"maxDepth\": 10,\n \"maxDiscoveryDepth\": 123,\n \"ignoreSitemap\": false,\n \"ignoreQueryParameters\": false,\n \"limit\": 10000,\n \"allowBackwardLinks\": false,\n \"crawlEntireDomain\": false,\n \"allowExternalLinks\": false,\n \"allowSubdomains\": false,\n \"delay\": 123,\n \"maxConcurrency\": 123,\n \"scrapeOptions\": {\n \"onlyMainContent\": true,\n \"includeTags\": [\n \"<string>\"\n ],\n \"excludeTags\": [\n \"<string>\"\n ],\n \"maxAge\": 0,\n \"headers\": {},\n \"waitFor\": 0,\n \"mobile\": false,\n \"skipTlsVerification\": false,\n \"timeout\": 30000,\n \"parsePDF\": true,\n \"jsonOptions\": {\n \"schema\": {},\n \"systemPrompt\": \"<string>\",\n \"prompt\": \"<string>\"\n },\n \"actions\": [\n {\n \"type\": \"wait\",\n \"milliseconds\": 2,\n \"selector\": \"#my-element\"\n }\n ],\n \"location\": {\n \"country\": \"US\",\n \"languages\": [\n \"en-US\"\n ]\n },\n \"removeBase64Images\": true,\n \"blockAds\": true,\n \"storeInCache\": true,\n \"formats\": [\n \"markdown\"\n ],\n \"changeTrackingOptions\": {\n \"modes\": [],\n \"schema\": {},\n \"prompt\": \"<string>\",\n \"tag\": null\n }\n },\n \"zeroDataRetention\": false\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"id": "<string>",
"url": "<string>"
}{
"error": "Payment required to access this resource."
}{
"error": "Request rate limit exceeded. Please wait and try again later."
}{
"error": "An unexpected error occurred on the server."
}