Hello Kenny,
OK, it's not easy to navigate within the various services, but bear in mind they were developed for a web map application. So you have identify with is basically a click on a map (searching by position), find searching by layer attribute and search, a full-text search, but not returning any geometries.
1/ So, for your need, you may try the find on the layer ch.swisstopo.swissboundaries3d-gemeinde-flaeche.fill :
Unfortunately, the result is a GeoJSON encapsulated in a results field.
{
"results": [
{
"geometry": {
"type": "MultiPolygon",
"coordinates": [
[
[
[
650938.6,
250654.6
],
},
"layerBodId": "ch.swisstopo.swissboundaries3d-gemeinde-flaeche.fill",
"bbox": [
644378.4,
246716.8,
650938.6,
251485.6
],
"featureId": 4001,
"layerName": "Gemeindegrenzen",
"type": "Feature",
"id": 4001,
"properties": {
"perimeter": 23587.84544979814,
"gemflaeche": 1234,
"label": "Aarau",
"objektart": 0,
"kanton": "AG",
"gemname": "Aarau"
}
}
]
}
2/ For any given layer, you may find what attributes are available, their type,and example value with:
curl 'https://api3.geo.admin.ch/rest/services/api/MapServer/ch.swisstopo.swissboundaries3d-gemeinde-flaeche.fill' | jq -r '.'
{
"fields": [
{
"values": [
"Chéserex",
"Ferpicloz",
"Randa",
"Scuol",
"Tuggen"
],
"alias": "Name",
"type": "VARCHAR",
"name": "gemname"
},
{
"values": [
1347,
2194,
3762,
5709,
6287
],
"alias": "BFS-Nummer",
"type": "INTEGER",
"name": "id"
}
],
"id": "ch.swisstopo.swissboundaries3d-gemeinde-flaeche.fill",
"name": "Gemeindegrenzen"
}
Regards,
Marc