Switzerland city, canton, zip search - free api access Share:

For projects with Switzerland cities, cantons, zip codes with search or autocomplete feature

On immocosmos.ch we are using API to access data in autocomplete on front of website. It is free if you have less then 20 000 requests per day.

If you need more please send us email to support@immocosmos.ch.

A) For city only without cantons and zip codes:

URL: https://www.immocosmos.ch/api/geo?city_only=

response JSON :


B) For city/cantons/zip codes:

URL: https://www.immocosmos.ch/api/geo?city=

return JSON :


C) For all of data without any query on database:

URL: https://www.immocosmos.ch/api/geo

response JSON :


URL's A) and B) support accents. You can have one or more letters in query parameter. 


https://www.immocosmos.ch/api/geo?city=Zürich will return JSON:


Complete javascript example with http://easyautocomplete.com lib:

var options = {

    minCharNumber: 3,

    url: function(phrase) {
        return "https://www.immocosmos.ch/api/geo?city=" + phrase;

    getValue: function(element) {

        return element.Name+ ", "+element.TypeLabel;

    list: {
        match: {
            enabled: false
        onSelectItemEvent: function() {
            var item = $("#location").getSelectedItemData();


    theme: "square"


Happy coding :)