Accedi ai dati dei rifugi in modo programmatico
L'API di Schutzraum fornisce accesso in sola lettura a tutti i dati dei rifugi. È necessaria una chiave API, che puoi richiedere nel tuo account.
https://schutzraum.appSi prega di utilizzare l'API in modo responsabile. Le richieste eccessive potrebbero essere limitate.
Tutte le richieste API richiedono una chiave API valida. Inviala come header o parametro di query:
Come header (consigliato):
X-API-Key: dein_api_keyCome parametro di query:
/api/shelters?api_key=dein_api_keyLe chiavi API possono essere richieste nel tuo account alla voce 'Chiavi API'. Dopo la revisione manuale, la chiave verrà attivata (di solito entro 48 ore).
Restituisce un elenco paginato di rifugi con filtro opzionale. Supporta anche il filtraggio geografico con i parametri lat, lng e radius — le richieste geografiche vengono ordinate automaticamente per distanza e includono un campo distanza.
| Parametro | Tipo | Obbligatorio | Predefinito | Descrizione |
|---|---|---|---|---|
page | number | No | 1 | Page number |
limit | number | No | 20 | Items per page (1–10000) |
type | string | No | – | Shelter type filter |
city | string | No | – | City name (partial match) |
search | string | No | – | Search name, city, address |
condition | string | No | – | gut, mittel, schlecht, unbekannt |
protection | string | No | – | hoch, mittel, niedrig, unbekannt |
wheelchair | boolean | No | – | Filter wheelchair accessible |
verified | boolean | No | – | Filter verified shelters |
minCapacity | number | No | – | Minimum capacity |
sort | string | No | name | name, city, capacity, type |
order | string | No | asc | asc or desc |
GET /api/shelters?type=bunker&city=Berlin&limit=10
{
"data": [{ "id": "...", "name": "...", "type": "bunker", ... }],
"total": 42,
"page": 1,
"limit": 10,
"totalPages": 5
}Restituisce un singolo rifugio tramite il suo ID.
GET /api/shelters/24b4e1f0-7723-45a7-bd1c-537a2ff02174
Restituisce i rifugi entro un raggio dato da un punto geografico, ordinati per distanza.
| Parametro | Tipo | Obbligatorio | Predefinito | Descrizione |
|---|---|---|---|---|
lat | number | Sì | – | Latitude (–90 to 90) |
lng | number | Sì | – | Longitude (–180 to 180) |
radius | number | No | 5000 | Radius in meters (100–50000) |
limit | number | No | 20 | Max results (1–100) |
type | string | No | – | Shelter type filter |
GET /api/shelters/nearby?lat=48.137&lng=11.576&radius=3000
Restituisce tutti i rifugi all'interno di un riquadro di delimitazione geografico.
| Parametro | Tipo | Obbligatorio | Predefinito | Descrizione |
|---|---|---|---|---|
west | number | Sì | – | West longitude |
south | number | Sì | – | South latitude |
east | number | Sì | – | East longitude |
north | number | Sì | – | North latitude |
type | string | No | – | Shelter type filter |
GET /api/shelters/bbox?west=11.4&south=48.0&east=11.7&north=48.2
Restituisce tutti i rifugi come FeatureCollection GeoJSON per il rendering sulla mappa.
| Parametro | Tipo | Obbligatorio | Predefinito | Descrizione |
|---|---|---|---|---|
type | string | No | – | Shelter type filter |
wheelchair | boolean | No | – | Filter accessible |
verified | boolean | No | – | Filter verified |
minCapacity | number | No | – | Minimum capacity |
GET /api/shelters/geojson?type=u_bahn_station&wheelchair=true
{
"type": "FeatureCollection",
"features": [{
"type": "Feature",
"geometry": { "type": "Point", "coordinates": [11.576, 48.137] },
"properties": { "id": "...", "name": "...", "type": "u_bahn_station", ... }
}]
}Il parametro tipo accetta questi valori:
| Value | Label |
|---|---|
bunker | Bunker |
tiefgarage | Parcheggio sotterraneo |
u_bahn_station | Stazione della metropolitana |
tunnel | Tunnel |
keller | Cantina |
hochbunker | Bunker di superficie |
tiefbunker | Bunker sotterraneo |
sonstige | Altro |