BYTETOOLS

geo.admin.ch SearchServer API

Free official Swiss geodata API with no key: search places, addresses, cantons and cadastral parcels, and query hundreds of federal map layers. Tested example and live response.

No API key requiredCORS enabledHTTPSFree tier

Endpoint tested and returned HTTP 200 on 2026-08-21

What is the geo.admin.ch SearchServer API?

The geo.admin.ch REST API is Switzerland's federal geodata service, free and key-free. Its SearchServer resolves place names, addresses, postcodes and parcels to coordinates, and companion endpoints identify features on any of the several hundred official federal map layers.

Behind map.geo.admin.ch, the federal geoportal, sits this API, and it carries the same authoritative layers government offices use: cadastral boundaries, hazard zones, protected areas, historical maps and much else. The search endpoint is only the front door — once you have coordinates, `MapServer/identify` will tell you which features on any published layer cover that point, which is a genuinely unusual capability to get without a contract.

Two details catch people out. The `label` field arrives with HTML markup in it, because the portal uses it directly in an autocomplete dropdown, so strip the `<b>` tags before displaying it anywhere else. And the coordinate reference system is not assumed: without `sr=4326` the service answers in the Swiss LV95 projection, where a position looks like 2600000, 1200000 rather than a familiar latitude and longitude.

Quick facts

Base URL
https://api3.geo.admin.ch/rest/services
Authentication
No API key or account. Swiss federal open government data, free to reuse with attribution.
Rate limit
No published quota. Fair use is expected; the service is sized for interactive map traffic rather than bulk extraction.
Pricing
Free.
CORS
Enabled — callable directly from browser JavaScript
Official docs
Read the docs

How to use the geo.admin.ch SearchServer API

Every request below was executed against the live API on 2026-08-21, and the response shown is the real body it returned — not an illustration.

1. Search Swiss place names and get coordinates

GET https://api3.geo.admin.ch/rest/services/api/SearchServer?searchText=Bern&type=locations&sr=4326&limit=2

curl
curl 'https://api3.geo.admin.ch/rest/services/api/SearchServer?searchText=Bern&type=locations&sr=4326&limit=2'
JavaScript (fetch)
const res = await fetch("https://api3.geo.admin.ch/rest/services/api/SearchServer?searchText=Bern&type=locations&sr=4326&limit=2");
if (!res.ok) throw new Error(`Request failed: ${res.status}`);
const data = await res.json();
console.log(data);
Python (requests)
import requests

res = requests.get("https://api3.geo.admin.ch/rest/services/api/SearchServer?searchText=Bern&type=locations&sr=4326&limit=2", timeout=20)
res.raise_for_status()
print(res.json())
Response — HTTP 200
{
  "results": [
    {
      "attrs": {
        "detail": "bern be",
        "featureId": "351",
        "geom_quadindex": "021",
        "geom_st_box2d": "BOX(7.294133 46.918995,7.495609 46.990139)",
        "label": "<b>Bern (BE)</b>",
        "lat": 46.954559326171875,
        "lon": 7.420684814453125,
        "num": 1,
        "objectclass": "",
        "origin": "gg25",
        "rank": 2,
        "x": 7.420684814453125,
        "y": 46.954559326171875,
        "zoomlevel": 4294967295
      },
      "id": 195,
      "weight": 100
    },
    {
      "attrs": {
        "detail": "Bern-Mittelland",
        "featureId": "246",
        "geom_quadindex": "021",
        "geom_st_box2d": "BOX(7.111942 46.670403,7.73361 47.122327)",
        "label": "<b>Bern-Mittelland</b>",
        "lat": 46.896873474121094,
        "lon": 7.495893478393555,
        "num": 1,
        "objectclass": "",
        "origin": "district",
        "rank": 3,
        "x": 7.495893478393555,
        "y": 46.896873474121094,
        "zoomlevel": 4294967295
      },
      "id": 246,
      "weight": 1
    }
  ]
}

Parameters

ParameterTypeRequiredDescription
searchTextqueryRequiredThe text to search for: place, address, postcode or parcel number. Bern
typequeryRequiredWhat to search: `locations`, `layers` or `featuresearch`. locations
srqueryOptionalSpatial reference of the returned coordinates. `4326` gives WGS84; the default is Swiss LV95. 4326
limitqueryOptionalMaximum results to return. 2
originsqueryOptionalRestrict result kinds, for example `address`, `gg25` (municipality) or `parcel`. address
(identify)pathOptional`/api/MapServer/identify` returns features from a named layer at a given coordinate.

Response fields

resultsarray
Ranked matches, each wrapping its payload in an `attrs` object.
attrs.labelstring
Display label — and it contains HTML `<b>` tags, so strip them before using the text elsewhere.
attrs.detailstring
Plain-text form of the same label, usually lowercased. Often the easier field to use.
attrs.lat / attrs.lonfloat
Position in the requested spatial reference. With `sr=4326` these are ordinary WGS84 degrees.
attrs.x / attrs.yfloat
The same position again in the service's own axis order. Compare against lat/lon before assuming which is which.
attrs.geom_st_box2dstring
Bounding box as a `BOX(minx miny,maxx maxy)` string, handy for zooming a map to the result.
attrs.originstring
Which dataset produced the hit: `gg25` for municipalities, `district`, `address`, `parcel` and so on.
attrs.featureIdstring
Identifier within that source dataset, for follow-up queries.
weightinteger
Ranking weight. Higher is a stronger match.

What you can build with the geo.admin.ch SearchServer API

  • Add Swiss place and address autocomplete to a form or map
  • Resolve a Swiss postcode or municipality to coordinates
  • Look up cadastral parcels by number
  • Query official federal layers — hazard zones, land use, protected areas — at a point
  • Convert between WGS84 and the Swiss LV95 grid by requesting both

Common errors and how to fix them

Coordinates look like 2600000 / 1200000

You did not pass `sr=4326`, so the response is in Swiss LV95 metres.

Fix: Add `sr=4326` for WGS84 degrees, or reproject from EPSG:2056 yourself if you need the national grid.

HTML tags appear in the UI

`attrs.label` deliberately contains `<b>` markup for the portal's autocomplete.

Fix: Use `attrs.detail` instead, or strip the tags. Never inject the raw label into a page without sanitising it.

Empty results for a valid address

`type=locations` ranks municipalities and districts above street addresses.

Fix: Add `origins=address` to force address matching, and include the postcode in `searchText` to disambiguate.

400 Bad Request

`searchText` or `type` is missing.

Fix: Both are required. `type` must be one of `locations`, `layers` or `featuresearch` — anything else is rejected.

geo.admin.ch SearchServer API — frequently asked questions

Is the geo.admin.ch API free?

Yes, with no key or registration. It publishes Swiss federal open government geodata, free to reuse commercially provided the source is credited.

How do I get WGS84 latitude and longitude?

Pass `sr=4326`. Without it the service answers in LV95, Switzerland's national projection, where coordinates are metres in the millions rather than degrees.

Can I query map layers, not just search?

Yes. The `MapServer/identify` endpoint returns features from any published federal layer that intersect a given point or box, which covers cadastral parcels, hazard maps, land cover and hundreds of other datasets.

Does it cover Liechtenstein?

Partially. Some federal layers extend across the border for continuity, but the address and municipality search is Swiss. Treat Liechtenstein coverage as incidental rather than guaranteed.

Tools that pair with this API

geo.admin.ch SearchServer is an independent third-party service and is not affiliated with ByteTools or ByteVancer. Details on this page were verified on 2026-08-21; always check the official documentation before relying on this API in production, as terms and limits can change.