We used the open data repository published by the Swiss Building Register (also known as the Eidgenƶssisches GebƤude- und Wohnungsregister - GWR), but the data accessible through a dedicated set of APIs or as a spreadsheet did not meet our needs in terms of querying and data analysis features.
As an example: how can we search for buildings in a specific municipality and close to green areas, and then return a ranked list of these buildings?
The raw data provided by the Swiss Buildings Registry had that information, but was not in a format that allowed a quick and immediate use to solve our needs.
This was a great use case to build an advanced set of APIs on top of the federal data. We were able to make use of the lessons learned from 10+ years of performant API engineering and development for one of the largest Swiss retailerās product data, among other projects.
The tool we built implements, among other features, the following functionalities:
- API-first design, making for a very simple workflow to process data;
- live and multilingual full-text search on the whole building addresses dataset;
- autocomplete and predictive address suggestions;
- geospatial matching and retrieval of building data;
- clean-up and normalization of the federal repository data, as well as building filtering;
- asynchronous data integration from building information within multiple matching strategies (more on that later).
The Application
The OpenSwissBuildings-API application implements a JSON REST API which can be then used to retrieve and perform matching/searching activities on the data provided by the Swiss Building Registry.
The API returns data according to the Schema.org internet structured format, in particular the Postal Address schema definition. This semantic interoperability makes it possible to re-use existing tools for data parsing.
The application is composed of three parts:
- Data Ingestion: the component responsible to regularly fetch the data from the Swiss Building Registry, and to keep both the geospatial storage and the search engine up to date with the building data;
- Search Engine: this component provides both the full-text search and the autocomplete features on the building addresses, including typo tolerant and text similarity matching;
- Geospatial Storage/Matching: this component processes a user-defined data search and computes the relevant building data. This process is later described as a Resolving activity.
The most relevant components are the Search Engine and the Geospatial Storage/Matching, which provide the features missing in the Swiss Building Registry APIs.
Both components are able to store all data related to the buildings in the publicly available dataset, such as: their identifier (EGID), addresses (in some case multilanguage), spatial position as latitude-longitude pair (expressed in the Swiss Coordinates system standard LV95) and additional information.
While the address is used in the full-text and autocomplete search, the whole set of building data is used to perform the Building Resolving. This feature allows us to identify and attach user-defined metadata to the matched buildings.

Building Resolving
This is the core feature of the application.
It allows, given a matching criteria, to retrieve the relevant buildings (together with their details) in addition to some user-defined metadata.
This feature is better explained with a couple of examples.
Use case: finding the perfect apartment
Let's imagine that an imaginary project is aimed at finding buildings which are suitable for living in. The buildings therefore must fulfill the following criteria:
- having a nice neighborhood;
- close to a green area;
- in a 30 km/h drive speed street.
These criteria need to be translated into spatial boundaries expressed as polygons on a map. These polygons can then be provided to the OpenSwissBuildings-API in the GeoJSON format.
The API will return a list of building data that matches the polygon.
The polygons inside the GeoJSON can have custom metadata attached. This metadata will be attached to the corresponding building data in the result. The result can be then used by our imaginary project to mark the buildings on a map.
Using multiple polygons with different metadata, additional information can be displayed, e.g. the probability of likeness for our user, by the increasing number of fulfilled criteria
Use case: listing all buildings given an address list
Another use case of the API could be processing an address list. Such a list can contain exact addresses, typos or even house number ranges. The result will include all the buildings for the provided addresses, including their coordinates.
Another example used by our project was to identify and list all addresses for a given municipality or street name. The application implements an interface to explicitly allow such a list to be extracted from our repository, with the additional support for house-number ranges, or handling typos in the provided street names.
These are a few just examples of the possibilities offered by the application. The OpenSwissBuildings-API makes it possible to process address lists, municipalities and spatial boundaries (GeoJSON), and includes some advanced fixes and matching strategies for some edge-cases we identified on the streets-to-municipality boundaries.
Open Source for Open Data
The application implements the standard and widely adopted Open-API Specification for the API definition. This allowed us to rapidly provide clean documentation of the API and its data formats, and to drastically reduce the time to implement 3rd-party consumers of the API itself.
The Association of Swiss Electricity Companies (VSE) and 90+ of its members co-financed the development of this tool. They decided to open source it under an MIT license, thus allowing its re-use and further development by anyone, including for commercial purposes.
The application source code is available in the Liip OpenSwissBuildings-API
GitHub Repository.

Running your own instance of the application is straightforward as we included the support of container-based deployments via Docker.
You can give it a try with our the online demo.
If you have questions or want to check if this application can also solve your needs do not hesitate to let me know via the contact form.