> ## 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.

# Start URL Discovery

> This endpoint initiates a URL discovery job for a given website.

## POST /discovery

This endpoint starts a URL discovery job for a website. It returns a `discoveryId` that can be used to track the job's progress and retrieve discovered URLs.

### Request Body

<ParamField body="url" type="string" required>
  The URL of the website to discover. Must be a valid URL with http/https protocol.
</ParamField>

<ParamField body="maxUrls" type="number" default="50">
  The maximum number of URLs to discover. Range: 1-1000.
</ParamField>

<ParamField body="discoveryType" type="string" default="full">
  The method to use for discovery:

  * `full`: Combines sitemap parsing and crawling for comprehensive discovery
  * `sitemap`: Only parses sitemap.xml files
  * `crawl`: Only crawls pages by following links
</ParamField>

### Response

<ResponseField name="id" type="string">
  A unique identifier for the discovery job.
</ResponseField>

<ResponseField name="url" type="string">
  The URL being discovered.
</ResponseField>

<ResponseField name="status" type="string">
  The status of the job: `started`, `processing`, `completed`, or `failed`.
</ResponseField>

<ResponseField name="discoveryType" type="string">
  The discovery method being used.
</ResponseField>

<ResponseField name="maxUrls" type="number">
  Maximum URLs to discover.
</ResponseField>

<ResponseField name="progress" type="string">
  Progress percentage.
</ResponseField>

<ResponseField name="totalUrlsFound" type="number">
  Number of URLs discovered so far.
</ResponseField>

<ResponseField name="createdAt" type="string">
  ISO 8601 timestamp of job creation.
</ResponseField>

<ResponseField name="estimatedCompletion" type="string">
  Estimated completion time.
</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>
