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.
openapi: 3.2.0
info:
title: OpenSwissData — public read-only Cantons 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: Cantons
paths:
/api/v1/cantons:
get:
summary: List of Swiss canton abbreviations
description: 'The 26 Swiss canton abbreviations, alphabetical order. No metric, no ranking. `sources` is present but empty: a fixed list, not sourced data.'
responses:
'200':
description: Canton abbreviations
headers:
Cache-Control:
schema:
type: string
description: public, max-age=3600
'429':
description: Rate limit exceeded for this network address (600 requests/hour, shared with /localities, /communes and /sources)
tags:
- Cantons
operationId: getApiV1Cantons
x-operation-id-source: derived
/api/v1/cantons/{abbr}:
get:
summary: Canton profile (combined dataset)
description: Number of distinct communes and distinct localities of this canton (official localities directory), and number of official streets (official streets directory), summed over the communes attached to this canton. `finma.entities_with_seat_in_canton` counts FINMA authorisations (register rows, all authorisation categories, not filtered by entity_type) and `finma.distinct_entities_with_seat_in_canton` the distinct UIDs among them, both combining the FINMA register with the commercial register (LINDAS) for the EXACT registered seat by UID, legal persons only — whitelisted legal forms (see `finma.seat_matching`), the seat's commune then attached to its canton via the official localities/streets directories; never the FINMA register's own `canton` column, which is a GLEIF enrichment. These two counts are `null`, not zero, when the combined seats file or the FINMA register itself is unavailable. `pv.by_year` is the BFE (Swiss Federal Office of Energy) one-time remuneration for photovoltaic installations by year (installations count, installed capacity in kW, remuneration in CHF); this counts installations that received the one-time remuneration in a given year, not the canton's total installed PV capacity (`pv.scope_note`); a year/canton pair the BFE publishes as "NA" is rendered `null`, never a guessed zero. `editions.finma` is the FINMA register version; `editions.bfe_pv` is the date this exact BFE content was first collected (the BFE republishes this dataset yearly; the monthly collection keeps the same edition until the content actually changes), not the date of the last collection attempt. No score, no ranking between cantons.
parameters:
- name: abbr
in: path
required: true
schema:
type: string
pattern: ^[A-Za-z]{2}$
description: Canton abbreviation, e.g. ZH
responses:
'200':
description: Canton profile
headers:
Cache-Control:
schema:
type: string
description: public, max-age=3600
'400':
description: Not one of the 26 Swiss canton abbreviations
'429':
description: Rate limit exceeded for this network address (600 requests/hour, shared with /localities, /communes and /sources)
tags:
- Cantons
operationId: getApiV1CantonsByAbbr
x-operation-id-source: derived