---
operation_id: list_datasets
method: GET
path: /v1/datasets
summary: Status pro Bundesland (Snapshot, Coverage, Lizenz)
tags: [datasets]
stability: stable
since_version: 0.1.0
auth: none
data_product: buildings
snapshot_aware: true
attribution_block: false
rate_limit_tier: public
related:
  - /v1/tilesets
  - /v1/buildings
  - /v1/terrain/datasets
---
# `GET /v1/datasets` — Verfügbare LoD2-Datensätze

Listet alle Bundesländer, für die Lodapi LoD2-Gebäude bereitstellt. Eine Zeile pro Bundesland, je mit dem aktuellsten Snapshot-Datum, Building-Count, Lizenz und Quell-URL. Dies ist der **Discovery-Endpoint** — typischerweise der erste Call jeder Lodapi-Integration.

## Wann verwenden

- Frontend zeigt eine BL-Auswahl an und braucht „welche sind live"-Information.
- Pipeline-Code prüft, ob ein Snapshot-Update verfügbar ist (Compare `snapshot_date`).
- Compliance-Sicht: welche Lizenzen liegen pro BL an (relevant für eigene Attribution-Strings).

## Examples

### curl

```bash
curl -s https://api.lodapi.de/v1/datasets | jq
```

### Python

```python
import httpx

r = httpx.get("https://api.lodapi.de/v1/datasets")
r.raise_for_status()
for ds in r.json()["datasets"]:
    print(f'{ds["bundesland_code"]:3s}  {ds["snapshot_date"]}  {ds["building_count"]:>10,}  {ds["license_id"]}')
```

### TypeScript (fetch)

```ts
const r = await fetch("https://api.lodapi.de/v1/datasets");
const { datasets } = await r.json() as { datasets: Dataset[] };
const live = datasets.filter(d => d.snapshot_date);
console.log(`${live.length} Bundesländer live`);
```

### Caching

`/v1/datasets` setzt **keinen `ETag`** — Conditional GET via `If-None-Match`/`304` greift hier nicht. Caching läuft ausschließlich über `Cache-Control: public, max-age=300` (5 min Browser-/CDN-Cache).

## Parameters

Keine. Der Endpoint nimmt keine Query- oder Path-Parameter entgegen.

## Response

`200 OK · application/json` — Schema-Quelle [`openapi.json`](../openapi/openapi.json) (`#/components/schemas/DatasetListResponse`).

```json
{
  "datasets": [
    {
      "id": "he",
      "bundesland_code": "he",
      "name": "© HLBG (DL-DE/Zero 2.0)",
      "license_id": "dl-de-zero-2.0",
      "source_url": "https://gds.hessen.de/INTERMET/Geodaten/3D-Gebaeudemodelle/",
      "snapshot_date": "2026-04-15",
      "building_count": 4934236,
      "validation_pass_pct": 99.7,
      "last_sync": "2026-05-13T09:42:18Z"
    }
  ],
  "count": 3
}
```

### Antwort-Header

| Header | Wert | Verwendung |
|---|---|---|
| `Cache-Control` | `public, max-age=300` | 5 min Browser-/CDN-Cache |

## Stolperdrähte

- **`validation_pass_pct: null`** ist legitim — manche BL haben noch keinen `val3dity`-Run gemacht. Frontend muss null-tolerant sein.
- **`snapshot_date`** ist das Datum des **Quell-Downloads**, nicht das Veröffentlichungsdatum der BL-Behörde. Manchmal liegen 6+ Monate dazwischen (z.B. ST liefert halbjährlich).
- **Welche BL fehlt**: ein BL erscheint nur, wenn `import_finished_at IS NOT NULL` in `lodapi_meta.dataset`. Bei laufendem Voll-Run fehlt der BL bis zum Abschluss — keine Teil-Daten in der API.

## Verwandte Endpoints

- [`GET /v1/tilesets`](./list-tilesets-bbox.md) — räumliche Tileset-Suche.
- [`GET /v1/buildings`](./list-buildings-bbox.md) — föderierte Building-Query.
- [`GET /v1/terrain/datasets`](./list-terrain-datasets.md) — Pendant für DGM1-Terrain.