Open Swiss Data Localities API

The Localities API from Open Swiss Data — 1 operation(s) for localities.

GitHub OpenAPI

Operations 1

GET /api/v1/localities Official localities directory (swisstopo) #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/openswissdata-com:openswissdata-com-localities-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

openswissdata-com-localities-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: OpenSwissData — public read-only Localities API
  version: 1.0.0
  description: 'Read-only JSON endpoints over the official localities and streets directories (swisstopo), the combined commune and canton profiles (including the BFE one-time photovoltaic remuneration), a catalogue of approved open Swiss datasets (generic engine, filterable by canton, commune, postal code, NOGA code or year), the Swiss company fiche (company_check) and the public source registry. Free, no key, limited per network address. The company fiche is also available over MCP (`company_check`, see /mcp) without a key; the commune and canton profiles, the BFE data and the open datasets catalogue are REST-only. Unofficial copies: binding decisions belong to the official sources named in each `sources`/`source` entry.'
  contact:
    url: https://www.openswissdata.com/en/
servers:
- url: https://www.openswissdata.com
tags:
- name: Localities
paths:
  /api/v1/localities:
    get:
      summary: Official localities directory (swisstopo)
      description: Rows of the official swisstopo directory of localities (postal code, locality, municipality, canton), exactly one of the two query parameters required.
      parameters:
      - name: postal_code
        in: query
        schema:
          type: string
        description: 4-digit Swiss postal code, e.g. 8400
      - name: municipality_bfs_id
        in: query
        schema:
          type: string
        description: Official BFS municipality number, e.g. 230
      responses:
        '200':
          description: Matching rows, directory edition and source
          headers:
            Cache-Control:
              schema:
                type: string
              description: public, max-age=3600
        '400':
          description: Neither or both query parameters given
        '503':
          description: Directory not currently available on this service
        '429':
          description: Rate limit exceeded for this network address (600 requests/hour, shared with /communes, /sources and /cantons)
      tags:
      - Localities
      operationId: getApiV1Localities
      x-operation-id-source: derived