GET /api/v1/cities/{slug}/population-structure
Population age structure as a time series (Wegweiser, Tier A)
110 indicators on the age structure per city from Wegweiser Kommune (CC0): count and share per age group (0-2 up to 80+), by gender, by generation, old-age and youth dependency ratio. Actuals from 2006, forecast values to 2040. Unfiltered the response weighs about 90 KB; for a single snapshot use ?from=2023&to=2023. Every metric carries its TIME SERIES plus latest_year and latest_value; years without a value are absent from the series (never an invented zero). Toggle off -> 200 source_status="disabled"; no snapshot or an empty year window -> 200 source_status="not_ingested".
Parameters
| Name | In | Required | Type | Example | Description |
|---|---|---|---|---|---|
slug | path | yes | string | ||
from | query | no | integer | 2020 | Erstes Jahr der Reihe (inklusive, 2006-2040). Ohne Angabe kommt die volle Reihe. Keine Zahl oder ausserhalb des Bestands -> 400. |
to | query | no | integer | 2023 | Letztes Jahr der Reihe (inklusive, 2006-2040). Muss groesser oder gleich from sein, sonst 400. |
Code samples
curl "https://infranode.dev/api/v1/cities/hamburg/population-structure"const res = await fetch("https://infranode.dev/api/v1/cities/hamburg/population-structure");
const data = await res.json();
console.log(data);import httpx
res = httpx.get("https://infranode.dev/api/v1/cities/hamburg/population-structure")
res.raise_for_status()
print(res.json())