搜索 Government Index
curl --request GET \
--url https://api.firecrawl.dev/v2/search/gov \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.firecrawl.dev/v2/search/gov"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.firecrawl.dev/v2/search/gov', 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/v2/search/gov",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.firecrawl.dev/v2/search/gov"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.firecrawl.dev/v2/search/gov")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.firecrawl.dev/v2/search/gov")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"web": [
{
"description": "所有供人食用的产品均应提供食品营养标签……",
"position": 1,
"title": "21 CFR Part 101 -- Food Labeling",
"url": "https://www.ecfr.gov/current/title-21/chapter-I/subchapter-B/part-101"
}
]
},
"success": true
}政府索引接口
搜索 Firecrawl 政府索引
GET
/
search
/
gov
搜索 Government Index
curl --request GET \
--url https://api.firecrawl.dev/v2/search/gov \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.firecrawl.dev/v2/search/gov"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.firecrawl.dev/v2/search/gov', 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/v2/search/gov",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.firecrawl.dev/v2/search/gov"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.firecrawl.dev/v2/search/gov")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.firecrawl.dev/v2/search/gov")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"web": [
{
"description": "所有供人食用的产品均应提供食品营养标签……",
"position": 1,
"title": "21 CFR Part 101 -- Food Labeling",
"url": "https://www.ecfr.gov/current/title-21/chapter-I/subchapter-B/part-101"
}
]
},
"success": true
}搜索来自美国联邦、州和地方政府来源的基础法律与监管资料,包括成文法、法规、法典、法院判决及其他政府出版物。结果以标准的
工作流概览请参见政府索引指南。
web 分组返回,结构与 /search 返回的网页结果相同。
同一路径也支持 POST,字段相同,以 JSON 请求体传入。包含未知字段的请求将被拒绝,并返回 400。
# 无需 API 密钥即可开始使用;添加 -H "Authorization: Bearer $FIRECRAWL_API_KEY" 可获得更高的限流额度:
curl -s "https://api.firecrawl.dev/v2/search/gov?query=food%20labeling%20requirements%20for%20allergens&k=10"
curl -X POST https://api.firecrawl.dev/v2/search/gov \
-H "Authorization: Bearer $FIRECRAWL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "food labeling requirements for allergens",
"k": 10
}'

