API Search : ch.swisstopo-vd.ortschaftenverzeichnis_plz Lowercase

31 views
Skip to first unread message

John-David Deubl

unread,
May 18, 2026, 11:55:18 AMMay 18
to GeoAdminCh API
Hello,

For a web form, I’d like to retrieve the ZIP code and location, which works so far. However, in the `key: detail` field, the place names are in lowercase. Is there a parameter in the query that returns the place names in the “correct” format—in this case, 2502 Biel/Bienne ?


I couldn’t find anything about this in the documentation. Thanks for reading.


Best regards


Request:
https://api3.geo.admin.ch/rest/services/api/SearchServer?features=ch.swisstopo-vd.ortschaftenverzeichnis_plz&type=featuresearch&searchText=2502

Result:

results: [
{
attrs: {
detail: "2502 biel/bienne",
featureId: "1428",
feature_id: "1428",
geom_quadindex: "02103",
geom_st_box2d: "BOX(583719.6198324268 220091.3495902172,587014.4520041236 224073.13084328157)",
label: "2502",
lat: 47.149532318115234,
layer: "ch.swisstopo-vd.ortschaftenverzeichnis_plz",
lon: 7.253011703491211,
origin: "feature"
},
id: 1428,
weight: 10009
}
]
}

GeoAdminCh API

unread,
May 26, 2026, 4:57:00 AMMay 26
to GeoAdminCh API
Hello,

Thank you for your question.

Indeed, when doing a featuresearch, the "detail" returns everything in lowercase. This is standard and cannot be changed
In order to get your wanted return, you have 3 possibilities:
1. Add yourself the uppercase: Take the "detail" return and internally add a parameter that ensures the first letter after the ZIP code to be in upper-case.
2. Second query: The first return must be supplemented with a second query to the feature endpoint using the resulted feature id. The wanted result would be visible in the "langtext" parameter.
3. Download the data: This alternative depends on the user case - You have the possibility to download all the data from here in different formats. They are updated every month and could therefore be easily replaced automatically updated internally.

For forther information, don't hesitate to visit our TechDocs

We hope this could be helpful.

Best regards,
Help Desk federal geoportal
Reply all
Reply to author
Forward
0 new messages