REST API Documentation

Programmatic llms.txt generation for Agency customers. Crawl websites and generate structured AI files – fully automated via API call.

📋 At a Glance

The API takes a website URL, automatically crawls the sitemap, collects metadata from all pages and delivers a ready-made llms.txt and llms-full.txt as a JSON response. Authentication via API key (= your Agency license key). Limit: 100 requests/day, max. 500 URLs per request. Requirement: Agency plan (from €29/month).

🏢 For Agency Owners

Use the API to automatically create llms.txt files for all your client websites – without manual copy & paste. Ideal for monthly SEO reports or GEO onboarding of new clients.

👩‍💻 For Developers

Standard REST API with JSON responses. No SDK needed – a simple POST with curl, Python, JavaScript or any HTTP library. Full error handling with HTTP status codes.

1. Authentication

Every API request must be authenticated. Your API key is identical to your Agency License key (format: LLMS-XXXX-XXXX-XXXX-XXXX).

⚡ Summary

Send your license key as an X-API-Key header. That's it. No OAuth, no token refresh, no separate API key.

There are three ways to pass the key (in priority order):

MethodeExampleEmpfohlen
HTTP-Header X-API-Key: LLMS-XXXX-XXXX-XXXX-XXXX ✅ Ja
JSON-Body {"key": "LLMS-XXXX-..."} Alternativ
Query-Parameters ?key=LLMS-XXXX-... GET only

Pro and Free keys will receive a 403 error with a note about the Agency upgrade path.

2. Endpointe

All endpoints are located under the base URL:

https://www.llmstxtgenerator.de/api/generate.php
POST/api/generate.php

Crawl a website and generate llms.txt. The main endpoint.

GET/api/generate.php?action=status

Check current daily quota and license status.

GET/api/generate.php?action=docs

Machine-readable API documentation as JSON.

3. Website generate (POST)

📋 Summary

Send a URL → the API crawls the sitemap, fetches metadata → you receive llms_txt and llms_full_txt as ready-to-use text in the JSON response.

Request-Body (JSON)

ParametersTypRequiredDescription
url string ✅ Ja Target URL of the website (with https://)
max_urls integer No Max. number of URLs (1–500, default: 50)
format string No "txt" (default) or "json" – with json all page details are included
key string No API key, if not in header

Ablauf im Detail

After receiving your request, the API goes through the following steps:

1. Sitemap-Suche – The API checks /sitemap.xml, /sitemap_index.xml, /wp-sitemap.xml and also parses /robots.txt for sitemap entries. Sitemap indexes are resolved recursively.

2. Fallback to Homepage Links – If no sitemap is found, all internal links from the homepage are extracted.

3. Metadata Crawling – For each URL, <title>, <meta description>, <h1> and Schema.org @type annotations are extracted.

4. Categorization – Each URL is automatically categorized (main pages, products, categories, blog, guides, FAQ, about us, legal) based on URL paths and Schema.org types.

5. Generation – A structured llms.txt and an extended llms-full.txt are generated from the metadata.

4. Status & Kontingent (GET)

⚡ Summary

Call ?action=status to see how many requests you have left today. Useful for monitoring and dashboard integration.

GET /api/generate.php?action=status
Header: X-API-Key: LLMS-XXXX-XXXX-XXXX-XXXX

Response

{
  "status": "active",
  "plan": "agency-monthly",
  "expires": "2026-04-22",
  "usage_today": {
    "requests": 12,
    "limit": 100,
    "remaining": 88,
    "urls_crawled": 340
  }
}

5. Response-Struktur

Eine erfolgreiche Generierung liefert folgende JSON-Struktur:

{
  "success": true,
  "url": "https://example.com",
  "pages_found": 87,
  "pages_crawled": 50,
  "duration_seconds": 14.3,
  "llms_txt": "# Example.com\n> Description...\n\n## Hauptseiten\n...",
  "llms_full_txt": "# example.com – Complete page overview\n...",
  "generated_at": "2026-02-22T15:30:00+01:00",
  "warnings": ["https://example.com/old-page: HTTP 404"]
}
FeldTypDescription
successbooleanAlways true on success
urlstringDie gecrawlte Basis-URL
pages_foundintegerURLs found in sitemap
pages_crawledintegerSuccessfully crawled (minus errors/timeouts)
duration_secondsfloatTotal duration in seconds
llms_txtstringThe finished llms.txt (ready to deploy)
llms_full_txtstringExtended version with all page details
generated_atstringISO 8601 Zeitstempel
warningsarrayOptional warnings (404s, timeouts, etc.)
pagesarrayOnly with format=json: Details per page (URL, Title, Description, H1, Schema Types)
💡 Tip for Agencies

The llms_txt and llms_full_txt fields can be saved directly as files and uploaded to the webroot to the customer's webroot. No post-processing needed – the files are ready to use immediately.

6. Code-Examplee

⚡ Summary

A simple HTTP POST with JSON body. No library, no SDK needed. Works with any HTTP-Client.

curl -X POST https://www.llmstxtgenerator.de/api/generate.php \
  -H "Content-Type: application/json" \
  -H "X-API-Key: LLMS-XXXX-XXXX-XXXX-XXXX" \
  -d '{"url": "https://example.com", "max_urls": 100}'
import requests

response = requests.post(
    "https://www.llmstxtgenerator.de/api/generate.php",
    headers={"X-API-Key": "LLMS-XXXX-XXXX-XXXX-XXXX"},
    json={"url": "https://example.com", "max_urls": 100}
)

data = response.json()

# Save llms.txt directly as a file
with open("llms.txt", "w") as f:
    f.write(data["llms_txt"])

print(f"{data['pages_crawled']} pages crawled in {data['duration_seconds']}s")
const response = await fetch(
  "https://www.llmstxtgenerator.de/api/generate.php",
  {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      "X-API-Key": "LLMS-XXXX-XXXX-XXXX-XXXX"
    },
    body: JSON.stringify({
      url: "https://example.com",
      max_urls: 100
    })
  }
);

const data = await response.json();
console.log(data.llms_txt);
console.log(`${data.pages_crawled} pages in ${data.duration_seconds}s`);
$ch = curl_init("https://www.llmstxtgenerator.de/api/generate.php");
curl_setopt_array($ch, [
    CURLOPT_POST => true,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        "Content-Type: application/json",
        "X-API-Key: LLMS-XXXX-XXXX-XXXX-XXXX"
    ],
    CURLOPT_POSTFIELDS => json_encode([
        "url" => "https://example.com",
        "max_urls" => 100
    ])
]);

$response = curl_exec($ch);
curl_close($ch);

$data = json_decode($response, true);

// Save llms.txt directly as a file
file_put_contents("llms.txt", $data["llms_txt"]);

echo $data["pages_crawled"] . " pages crawled\n";

Practical example: Batch generation for multiple clients

🏢 Agency Workflow

Managing 20 clients and want to generate a fresh llms.txt monthly for all of them? Put the URLs in a Liste and let a small script process them one by one. 100 requests/day is more than enough for most agencies.

#!/bin/bash
# Monthly llms.txt generation for all clients
API_KEY="LLMS-XXXX-XXXX-XXXX-XXXX"

KUNDEN=(
  "https://kunde1-shop.de"
  "https://kunde2-agentur.com"
  "https://kunde3-handwerk.de"
)

for url in "${KUNDEN[@]}"; do
  DOMAIN=$(echo "$url" | sed 's|https://||;s|/.*||')
  echo "Generiere: $DOMAIN ..."

  curl -s -X POST https://www.llmstxtgenerator.de/api/generate.php \
    -H "Content-Type: application/json" \
    -H "X-API-Key: $API_KEY" \
    -d "{\"url\": \"$url\", \"max_urls\": 200}" \
    | jq -r '.llms_txt' > "${DOMAIN}-llms.txt"

  echo "  → ${DOMAIN}-llms.txt saved"
  sleep 2  # Fair-Use-Pause
done
import requests, time

API_KEY = "LLMS-XXXX-XXXX-XXXX-XXXX"

kunden = [
    "https://kunde1-shop.de",
    "https://kunde2-agentur.com",
    "https://kunde3-handwerk.de",
]

for url in kunden:
    domain = url.replace("https://", "").replace("/", "")
    print(f"Generiere: {domain} ...")

    r = requests.post(
        "https://www.llmstxtgenerator.de/api/generate.php",
        headers={"X-API-Key": API_KEY},
        json={"url": url, "max_urls": 200},
        timeout=120
    )

    data = r.json()
    if data.get("success"):
        with open(f"{domain}-llms.txt", "w") as f:
            f.write(data["llms_txt"])
        print(f"  → {data['pages_crawled']} pages, {data['duration_seconds']}s")
    else:
        print(f"  → Error: {data.get('error')}")

    time.sleep(2)  # Fair-Use-Pause

7. Limits & Fair Use

LimitValueNote
Requests per day100Resets at 00:00 CET
URLs per requestmax. 500Default: 50, adjustable via max_urls
Timeout per page10 secondsUnreachable pages are skipped
Max. total runtime120 secondsAfter that, crawled results are returned
Response sizeUnlimitedTypical: 20–200 KB JSON
💡 Pro Tip

With 100 requests/day you can easily generate for 100 different websites daily. For a typical agency workflow (20 clients, monthly updates) you only need 20 requests per month. For higher volume, contact us.

8. Error Codes

Error responses always follow this format:

{
  "error": "Error description",
  "code": 422,
  "detail": "Optional additional information"
}
CodeBedeutungTypische Ursache
401Not authenticatedAPI key missing or invalid format
403No accessPro key instead of Agency, or license expired
405Wrong methodGET instead of POST for generation
422Invalid parametersURL missing or invalid URL format
429Rate limit100 requests/day exceeded
500Server errorWebsite unreachable, no pages found

9. FAQ

Brauche ich einen separaten API-Key?

No. Your Agency license key is also your API key. No separate developer account, no additional registration.

Does the API work for websites without a sitemap?

Yes. If the API finds no sitemap, it automatically extracts all internal links from the homepage. However, a sitemap delivers significantly better and more complete results.

Welche Programmiersprache brauche ich?

No specific one. Anything that can send HTTP requests works: Python, JavaScript, PHP, Ruby, Go, Java, C#, Bash/cURL – or even Zapier and Make (Integromat). The API speaks standard REST with JSON.

Can I use the generated files for my clients?

The generated files contain a subtle reference to the generator. You can freely use the files for your Kunden verwenden.

What happens when my daily limit is reached?

You receive a 429 error. The limit resets daily at midnight (CET). Via the Status-Endpoint (?action=status) you can check your remaining quota at any time.

Do I need Python or Node.js on my server?

No. The API runs entirely on our infrastructure. You simply send an HTTP request and receive the finished llms.txt as text. This works even with plain PHP on shared hosting – including via cron job.

Ready for automated GEO optimization?

The Agency plan with API access starts at €29/month.

🏢 View Agency plan