Lodapi für KI-Coding-Agenten
Wenn du Lodapi mit einem KI-Coding-Agent (Cursor, Claude Code, Aider, ChatGPT mit Tool-Use, OpenAI Codex) anbinden willst, sind drei Roh-Artefakte deine Eingangstür — kein HTML-Crawling nötig.
1. llms.txt — Index für Discovery
https://lodapi.de/llms.txt
Sektionierter Index nach llmstxt.org. Enthält alle Endpoints gruppiert nach Tag, plus Links zu Guides und Reference-Material. Klein genug, um permanent im LLM-System-Prompt zu liegen.
Verwendung in Claude Code:
# Lade Lodapi-Kontext in eine neue Session
curl -s https://lodapi.de/llms.txt | claude --append-system
2. llms-full.txt — Volle Doku im Context-Window
https://lodapi.de/llms-full.txt
Maschinell konkatenierte Doku aller Endpoints + Guides. Drop diese Datei in den LLM-Context — der Agent hat vollen API-Kontext für einen Roundtrip.
# Beispiel: ChatGPT/Claude mit vollständigem Lodapi-Kontext
import httpx, anthropic
docs = httpx.get("https://lodapi.de/llms-full.txt").text
client = anthropic.Anthropic()
msg = client.messages.create(
model="claude-opus-4-7",
max_tokens=2048,
system=f"Du kennst die Lodapi-API. Doku:\n\n{docs}",
messages=[{"role": "user", "content": "Wie hole ich Gebäude für Frankfurt-Innenstadt?"}],
)
3. .well-known/lodapi.json — Discovery-Manifest
https://lodapi.de/.well-known/lodapi.json
Maschinenlesbares JSON mit:
api.openapi_url— Live-OpenAPI-3.1api.openapi_snapshot_url— committed Snapshotdocs.url— Doku-Sitellms.index+llms.full— die zwei Files obendata_products[]— alle 6 Datenprodukte mit Status (live / beta / planned)auth— Modell + Headers + Status
Das ist das Format, das AI-Tool-Use-Discovery erwartet (name, description, homepage Felder sind Standard-kompatibel).
4. Markdown-Roh-Konsum pro Endpoint
Jede Endpoint-Page hat einen .md-Suffix für Roh-Markdown:
| HTML-View | Markdown-View (für LLM) |
|---|---|
https://lodapi.de/docs/endpoints/list-datasets | https://lodapi.de/docs/endpoints/list-datasets.md |
https://lodapi.de/docs/endpoints/get-terrain-elevation | https://lodapi.de/docs/endpoints/get-terrain-elevation.md |
Content-Type: text/markdown; charset=utf-8. Frontmatter + Body verbatim.
5. OpenAPI 3.1 für SDK-Generierung
https://lodapi.de/openapi.json (committed Snapshot)
https://api.lodapi.de/openapi.json (live)
https://api.lodapi.de/docs (Swagger-UI)
https://api.lodapi.de/redoc (ReDoc)
Standard-OpenAPI-3.1 — funktioniert mit jedem Generator (openapi-typescript, openapi-python-client, swagger-codegen).
6. MCP-Server (geplant Phase 2)
Ein Model-Context-Protocol-Server unter mcp.lodapi.de ist für Q3 2026 in Planung. Dann werden alle Lodapi-Endpoints direkt als MCP-Tools nutzbar — Claude Desktop, Cursor und MCP-fähige IDEs binden Lodapi ohne Custom-Integration an.
Status-Update: data_products[].mcp_server in .well-known/lodapi.json wird gesetzt, sobald live.
Stolperdrähte für KI-Agenten
- Cursor-Pagination ist opak — der
lodapi.next-String darf nicht aufgebrochen werden. Der Agent sollte ihn als Token behandeln. features[].properties.bundeslandist der unprefixte 2-Buchstaben-Code ("he","nrw"). Manche LLMs raten “Hessen” — kommunizieren Sie den Code-Stil explizit.- bbox-Reihenfolge ist
minLon,minLat,maxLon,maxLat(West, Süd, Ost, Nord), nicht GeoJSON-Bbox-Konvention. /v1/terrain/elevationliefert 404 für Wasserflächen, nicht0.0. Das ist Absicht — siehe Endpoint-Doku.- Lizenz-Attribution ist kein optional Step — bei DL-DE BY 2.0 oder CC BY 4.0 muss der Quell-String sichtbar bleiben. Der
lodapi.attribution[]-Block der Response gibt den exakten Text.