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

# Markdown 내보내기

> 사이트 콘텐츠를 Markdown 파일로 내보내는 엔드포인트입니다.

## GET /sites/{siteId}/markdown/export

사이트의 모든 URL과 콘텐츠를 Markdown 형태로 내보냅니다. 유료 플랜에서만 사용할 수 있습니다.

<Note>
  이 기능은 유료 구독이 필요합니다. 무료 플랜에서는 오류가 반환됩니다.
</Note>

### 경로 매개변수

<ParamField path="siteId" type="string" required>
  내보낼 사이트 ID입니다.
</ParamField>

### 쿼리 매개변수

<ParamField query="format" type="string" default="individual">
  내보내기 형식:

  * `individual`: URL별로 분리된 Markdown을 JSON으로 반환
  * `combined`: 하나의 결합 Markdown 파일로 반환
</ParamField>

<ParamField query="fresh" type="boolean" default="false">
  `true`이면 캐시된 Markdown 대신 새로 가져온 콘텐츠를 사용합니다.
</ParamField>

### 응답

`format=individual`인 경우 JSON을 반환합니다:

<ResponseField name="success" type="boolean">
  내보내기 성공 여부입니다.
</ResponseField>

<ResponseField name="format" type="string">
  내보내기 형식(`individual`)입니다.
</ResponseField>

<ResponseField name="files" type="array">
  Markdown 파일 객체 배열입니다.

  <Expandable title="파일 속성">
    <ResponseField name="url" type="string">
      원본 URL입니다.
    </ResponseField>

    <ResponseField name="title" type="string">
      페이지 제목입니다.
    </ResponseField>

    <ResponseField name="markdown" type="string">
      Markdown 본문입니다.
    </ResponseField>
  </Expandable>
</ResponseField>

`format=combined`인 경우 일반 Markdown 텍스트와 다운로드용 `Content-Disposition` 헤더가 반환됩니다.

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

  ```bash cURL (Combined Markdown) theme={null}
  curl -X GET "https://api.llmgenerator.com/api/v1/sites/550e8400-e29b-41d4-a716-446655440000/markdown/export?format=combined" \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -o site-export.md
  ```

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

  const markdown = await response.text();
  ```
</RequestExample>

<ResponseExample>
  ```json Individual Format theme={null}
  {
    "success": true,
    "format": "individual",
    "files": [
      {
        "url": "https://example.com/",
        "title": "Example Domain - Home",
        "markdown": "# Example Domain\n\nWelcome to Example Domain...\n"
      },
      {
        "url": "https://example.com/about",
        "title": "About Us",
        "markdown": "# About Us\n\nLearn more about Example Domain...\n"
      }
    ]
  }
  ```

  ```markdown Combined Format theme={null}
  # Site Export: example.com

  ---

  ## Home

  URL: https://example.com/

  Welcome to Example Domain. This is the main landing page...

  ---

  ## About Us

  URL: https://example.com/about

  Learn more about our company and mission...
  ```
</ResponseExample>
