Get the status and results of an LLMs.txt generation job
curl --request GET \
--url https://api.firecrawl.dev/v1/llmstxt/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.firecrawl.dev/v1/llmstxt/{id}"
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/v1/llmstxt/{id}', 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/llmstxt/{id}",
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/v1/llmstxt/{id}"
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/v1/llmstxt/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.firecrawl.dev/v1/llmstxt/{id}")
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{
"success": true,
"status": "processing",
"data": {
"llmstxt": "<string>",
"llmsfulltxt": "<string>"
},
"expiresAt": "2023-11-07T05:31:56Z"
}{
"success": false,
"error": "LLMs.txt generation job not found"
}LLMs.txt 状态
GET
/
llmstxt
/
{id}
Get the status and results of an LLMs.txt generation job
curl --request GET \
--url https://api.firecrawl.dev/v1/llmstxt/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.firecrawl.dev/v1/llmstxt/{id}"
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/v1/llmstxt/{id}', 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/llmstxt/{id}",
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/v1/llmstxt/{id}"
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/v1/llmstxt/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.firecrawl.dev/v1/llmstxt/{id}")
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{
"success": true,
"status": "processing",
"data": {
"llmstxt": "<string>",
"llmsfulltxt": "<string>"
},
"expiresAt": "2023-11-07T05:31:56Z"
}{
"success": false,
"error": "LLMs.txt generation job not found"
}获取 LLMs.txt 生成作业的状态和结果。此端点允许您检查生成是否完成并检索生成的内容。
响应结构
响应包括:- success: 布尔值,指示请求是否成功
-
status: 生成作业的当前状态:
processing: 作业仍在运行中completed: 作业成功完成failed: 作业遇到错误
-
data: 生成的内容(当状态为
completed时):llmstxt: 生成的 LLMs.txt 内容llmsfulltxt: 完整文本内容(如果 showFullText 为 true)
- expiresAt: 结果过期的 ISO 时间戳
状态示例
-
处理中状态
{ "success": true, "status": "processing", "data": { "llmstxt": "# Firecrawl.dev llms.txt
- Web Data Extraction Tool…”, “llmsfulltxt”: ”# Firecrawl.dev llms-full.txt
2. **完成状态**
```json
{
"success": true,
"status": "completed",
"data": {
"llmstxt": "# http://firecrawl.dev llms.txt
- [Web Data Extraction Tool](https://www.firecrawl.dev/): Transform websites into clean, LLM-ready data effortlessly.
- [Flexible Web Scraping Pricing](https://www.firecrawl.dev/pricing): Flexible pricing plans for web scraping and data extraction.",
"llmsfulltxt": "# http://firecrawl.dev llms-full.txt
## Web Data Extraction Tool
Introducing /extract - Get web data with a prompt..."
},
"expiresAt": "2025-03-03T22:45:50.000Z"
}
错误处理
如果生成作业失败或找不到,您将收到相应的错误响应:{
"success": false,
"error": "LLMs.txt 生成作业未找到"
}
轮询建议
- 初始每 2-3 秒轮询一次
- 如果 30 秒后仍处理中,则增加间隔时间
- 如果状态为
completed或failed则停止轮询 - 实现指数退避以避免速率限制
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The ID of the LLMs.txt generation job