> ## 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 발견 시작

> 웹사이트에 대한 URL 발견 작업을 시작하는 엔드포인트입니다.

## POST /discovery

웹사이트 URL 발견 작업을 시작합니다. 진행 상황 추적과 발견된 URL 조회를 위해 `discoveryId`가 반환됩니다.

### 요청 본문

<ParamField body="url" type="string" required>
  발견할 웹사이트 URL입니다. http/https 프로토콜이 있는 유효한 URL이어야 합니다.
</ParamField>

<ParamField body="maxUrls" type="number" default="50">
  발견할 최대 URL 수입니다. 범위: 1–1000.
</ParamField>

<ParamField body="discoveryType" type="string" default="full">
  발견 방법:

  * `full`: 사이트맵 분석과 크롤을 결합한 포괄적 발견
  * `sitemap`: sitemap.xml만 파싱
  * `crawl`: 링크를 따라 페이지만 크롤
</ParamField>

### 응답

<ResponseField name="id" type="string">
  발견 작업 고유 식별자입니다.
</ResponseField>

<ResponseField name="url" type="string">
  발견 대상 URL입니다.
</ResponseField>

<ResponseField name="status" type="string">
  작업 상태: `started`, `processing`, `completed`, 또는 `failed`입니다.
</ResponseField>

<ResponseField name="discoveryType" type="string">
  사용 중인 발견 방식입니다.
</ResponseField>

<ResponseField name="maxUrls" type="number">
  발견할 최대 URL 수입니다.
</ResponseField>

<ResponseField name="progress" type="string">
  진행률(퍼센트)입니다.
</ResponseField>

<ResponseField name="totalUrlsFound" type="number">
  지금까지 발견된 URL 수입니다.
</ResponseField>

<ResponseField name="createdAt" type="string">
  작업 생성 시각(ISO 8601)입니다.
</ResponseField>

<ResponseField name="estimatedCompletion" type="string">
  예상 완료 시각입니다.
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://api.llmgenerator.com/api/v1/discovery \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
          "url": "https://www.example.com",
          "maxUrls": 100,
          "discoveryType": "full"
        }'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://api.llmgenerator.com/api/v1/discovery', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      url: 'https://www.example.com',
      maxUrls: 100
    })
  });

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

<ResponseExample>
  ```json Success (201) theme={null}
  {
    "id": "disc_1706540000_abc123xyz",
    "url": "https://www.example.com",
    "status": "started",
    "discoveryType": "full",
    "maxUrls": 100,
    "progress": "0",
    "totalUrlsFound": 0,
    "createdAt": "2026-01-29T12:00:00.000Z",
    "estimatedCompletion": "2026-01-29T12:05:00.000Z"
  }
  ```
</ResponseExample>
