add index endpoint
This commit is contained in:
@@ -46,6 +46,39 @@ Response:
|
||||
}
|
||||
```
|
||||
|
||||
Index request (all discovered stations):
|
||||
|
||||
```
|
||||
GET /api/pegel
|
||||
```
|
||||
|
||||
Index request with limit:
|
||||
|
||||
```
|
||||
GET /api/pegel?limit=5
|
||||
```
|
||||
|
||||
Index response shape:
|
||||
|
||||
```json
|
||||
{
|
||||
"count": 5,
|
||||
"total_available": 312,
|
||||
"items": [
|
||||
{
|
||||
"station_id": "560021",
|
||||
"station_title": "Golzern 1 / Vereinigte Mulde",
|
||||
"source": "https://www.umwelt.sachsen.de/umwelt/infosysteme/hwims/portal/web/feed/wasserstand-pegel-560021"
|
||||
}
|
||||
],
|
||||
"source": "https://www.umwelt.sachsen.de/umwelt/infosysteme/hwims/portal/web/wasserstand-uebersicht",
|
||||
"fetched_at": "2026-05-05T01:00:00+00:00",
|
||||
"warnings": [
|
||||
"optional, only present for partial failures"
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🚀 Local Development
|
||||
@@ -62,6 +95,7 @@ uvicorn api.app:app --reload
|
||||
Open:
|
||||
|
||||
```
|
||||
http://127.0.0.1:8000/api/pegel
|
||||
http://127.0.0.1:8000/api/pegel/560021
|
||||
```
|
||||
|
||||
@@ -109,6 +143,16 @@ Pegel ID is passed via URL:
|
||||
/api/pegel/<id>
|
||||
```
|
||||
|
||||
Index endpoint:
|
||||
|
||||
```
|
||||
/api/pegel
|
||||
```
|
||||
|
||||
Query params for index:
|
||||
|
||||
* `limit` (positive integer, optional; invalid values return HTTP 400)
|
||||
|
||||
---
|
||||
|
||||
## 📡 Data Source
|
||||
|
||||
Reference in New Issue
Block a user