列出 /parse 支持的文件格式
curl --request GET \
--url https://api.firecrawl.dev/v2/parse/formats \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.firecrawl.dev/v2/parse/formats"
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/parse/formats', 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/parse/formats",
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/parse/formats"
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/parse/formats")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.firecrawl.dev/v2/parse/formats")
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": {
"formats": [
{
"available": true,
"extensions": [
".docx"
],
"format": "docx",
"kind": "document",
"mimeTypes": [
"application/vnd.openxmlformats-officedocument.wordprocessingml.document"
]
}
]
},
"success": true
}{
"error": "Unauthorized: Invalid token",
"success": false
}解析端点
解析格式
GET
/
parse
/
formats
列出 /parse 支持的文件格式
curl --request GET \
--url https://api.firecrawl.dev/v2/parse/formats \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.firecrawl.dev/v2/parse/formats"
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/parse/formats', 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/parse/formats",
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/parse/formats"
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/parse/formats")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.firecrawl.dev/v2/parse/formats")
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": {
"formats": [
{
"available": true,
"extensions": [
".docx"
],
"format": "docx",
"kind": "document",
"mimeTypes": [
"application/vnd.openxmlformats-officedocument.wordprocessingml.document"
]
}
]
},
"success": true
}{
"error": "Unauthorized: Invalid token",
"success": false
}列出
/parse 支持的所有文件格式,及其对应的文件扩展名和 MIME 类型。该列表基于 /parse 校验上传文件时所用的同一套规则生成,因此你可以在发送文件前先行检查,无需自行维护一份支持类型清单。
每个条目都包含 kind 字段,取值为 document 或 image。图像格式会经过 OCR 处理;若未启用图像 OCR,这些格式会标记为 available: false,在启用之前,上传此类格式的文件将被拒绝并返回 UNSUPPORTED_FILE_TYPE。
该列表很少变动。响应带有 Cache-Control: private, max-age=3600 头,因此可以放心地将其缓存最多一小时。
