> ## Documentation Index
> Fetch the complete documentation index at: https://docs.llmgenerator.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 获取发现任务状态

> 查询 URL 发现任务的进度。

## GET /discovery/{discoveryId}

返回指定 URL 发现任务的当前状态与详情。

### 路径参数

<ParamField path="discoveryId" type="string" required>
  发现任务 ID。
</ParamField>

### 响应

<ResponseField name="id" type="string">
  任务唯一标识。
</ResponseField>

<ResponseField name="url" type="string">
  目标 URL。
</ResponseField>

<ResponseField name="type" type="string">
  发现方式：`full`、`sitemap` 或 `crawl`。
</ResponseField>

<ResponseField name="status" type="string">
  当前状态：`pending`、`processing`、`completed` 或 `failed`。
</ResponseField>

<ResponseField name="urlsFound" type="number">
  当前已发现的 URL 数量。
</ResponseField>

<ResponseField name="createdAt" type="string">
  创建时间（ISO 8601）。
</ResponseField>

<ResponseField name="completedAt" type="string">
  完成时间（ISO 8601，未完成时为 null）。
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X GET https://api.llmgenerator.com/api/v1/discovery/550e8400-e29b-41d4-a716-446655440000 \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```

  ```javascript Node.js theme={null}
  const response = await fetch(
    'https://api.llmgenerator.com/api/v1/discovery/550e8400-e29b-41d4-a716-446655440000',
    {
      headers: { 'Authorization': 'Bearer YOUR_API_KEY' }
    }
  );

  const status = await response.json();
  ```
</RequestExample>

<ResponseExample>
  ```json Processing theme={null}
  {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "url": "https://example.com",
    "type": "full",
    "status": "processing",
    "urlsFound": 23,
    "createdAt": "2026-01-20T10:00:00.000Z",
    "completedAt": null
  }
  ```

  ```json Completed theme={null}
  {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "url": "https://example.com",
    "type": "sitemap",
    "status": "completed",
    "urlsFound": 47,
    "createdAt": "2026-01-20T10:00:00.000Z",
    "completedAt": "2026-01-20T10:05:00.000Z"
  }
  ```
</ResponseExample>
