GET
/
llmstxt
/
{id}
curl --request GET \
  --url https://api.firecrawl.dev/v1/llmstxt/{id} \
  --header 'Authorization: Bearer <token>'
{
  "success": true,
  "status": "processing",
  "data": {
    "llmstxt": "<string>",
    "llmsfulltxt": "<string>"
  },
  "expiresAt": "2023-11-07T05:31:56Z"
}

获取 LLMs.txt 生成作业的状态和结果。此端点允许您检查生成是否完成并检索生成的内容。

响应结构

响应包括:

  • success: 布尔值,指示请求是否成功

  • status: 生成作业的当前状态:

    • processing: 作业仍在运行中
    • completed: 作业成功完成
    • failed: 作业遇到错误
  • data: 生成的内容(当状态为 completed 时):

    • llmstxt: 生成的 LLMs.txt 内容
    • llmsfulltxt: 完整文本内容(如果 showFullText 为 true)
  • expiresAt: 结果过期的 ISO 时间戳

状态示例

  1. 处理中状态

    {
      "success": true,
      "status": "processing",
      "data": {
        "llmstxt": "# Firecrawl.dev llms.txt
    
    

” }, “expiresAt”: “2025-03-03T23:19:18.000Z” }


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 生成作业未找到"
}

轮询建议

  1. 初始每 2-3 秒轮询一次
  2. 如果 30 秒后仍处理中,则增加间隔时间
  3. 如果状态为 completedfailed 则停止轮询
  4. 实现指数退避以避免速率限制

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id
string
required

The ID of the LLMs.txt generation job

Response

200
application/json

Successful response

The response is of type object.