Dwelling (Wohnung) records for one or more buildings, by EGID or by parcel EGRID
Every row of the federal dwelling register (gwr_dwelling, loaded monthly by the AV enrichment run's load_gwr_dwellings.sh) for the requested buildings, grouped per EGID. This is the only public source of per-dwelling floor/area/room data: geo.admin's GWR layer stops at the building, and housing-stat.ch forbids automated use.
Pass EXACTLY ONE of egid (1..25 comma-separated building ids - preferred, callers that already read the building register have them) or egrid (every EXISTING building on the parcel via gwr_register, which holds GSTAT = 1004 only, so a demolished building is reachable by EGID but not by EGRID). Rows are ordered egid, floor ASC NULLS LAST, ewid; a requested building with no dwellings still gets an entry with count: 0.
Caps → truncated. One 2,000-row cap across the whole answer (the largest building carries 460 dwellings), and 25 buildings per egrid (718 parcels carry more; the largest 586). Either cut sets truncated: true; never sum a truncated answer and present it as the parcel total. Every dwelling state is returned; filter wstat = 3004 for existing dwellings only.
Caching. Redis gwr:/res_api/gwr/dwellings?<sorted query> for 6 h with an X-Cache: HIT|MISS header. Unlike the other /gwr routes this key is NOT flushed by the loader (a shell script with no Redis client), so a monthly reload becomes visible within 6 h.
Auth: token header or ?token= (router-wide, before every /gwr route); real status codes, no X-RES-API-Version needed. CORS *.
https://res.aireon.ch/res_api/gwr/dwellingsAuthorization
Query parameters
Returns
200
Dwellings grouped by building.