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

# Als Markdown exportieren

> Dieser Endpunkt exportiert den Inhalt einer Website als Markdown-Dateien.

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

Dieser Endpunkt erzeugt einen Markdown-Export aller URLs und Inhalte einer Website. Nur für kostenpflichtige Tarife verfügbar.

<Note>
  Diese Funktion erfordert ein kostenpflichtiges Abonnement. Nutzer des Free-Tarifs erhalten einen Fehler.
</Note>

### Pfadparameter

<ParamField path="siteId" type="string" required>
  Kennung der zu exportierenden Website.
</ParamField>

### Abfrageparameter

<ParamField query="format" type="string" default="individual">
  Exportformat:

  * `individual`: JSON mit separatem Markdown pro URL
  * `combined`: Eine zusammengeführte Markdown-Datei
</ParamField>

<ParamField query="fresh" type="boolean" default="false">
  Bei `true` werden aktuelle Inhalte geladen statt zwischengespeichertes Markdown zu verwenden.
</ParamField>

### Antwort

Bei `format=individual` wird JSON zurückgegeben:

<ResponseField name="success" type="boolean">
  Ob der Export erfolgreich war.
</ResponseField>

<ResponseField name="format" type="string">
  Exportformat (`individual`).
</ResponseField>

<ResponseField name="files" type="array">
  Array von Markdown-Dateiobjekten.

  <Expandable title="Eigenschaften eines file-Eintrags">
    <ResponseField name="url" type="string">
      Ursprüngliche URL.
    </ResponseField>

    <ResponseField name="title" type="string">
      Seitentitel.
    </ResponseField>

    <ResponseField name="markdown" type="string">
      Markdown-Inhalt.
    </ResponseField>
  </Expandable>
</ResponseField>

Bei `format=combined` wird Klartext-Markdown mit Header `Content-Disposition` zum Download zurückgegeben.

<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 Format „individual“ 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 Format „combined“ 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>
