Open Swiss Data Datasets API

The Datasets API from Open Swiss Data — 2 operation(s) for datasets.

GitHub OpenAPI

Operations 2

GET /api/v1/datasets Catalogue of approved open datasets (generic engine) #
GET /api/v1/datasets/{id} Rows of one approved open dataset, filtered and paginated #

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-datasets-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-datasets-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: OpenSwissData — public read-only Datasets 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: Datasets
paths:
  /api/v1/datasets:
    get:
      summary: Catalogue of approved open datasets (generic engine)
      description: 'One entry per dataset approved and collected by the generic open-datasets engine (docs/data-status/datasets-approved.json, collected weekly by scripts/sync-datasets.ts): id, title, publisher, licence, attribution (present only when the licence requires one — terms_by or cc-by — and the registry carries a non-empty text, null otherwise), source URL, edition, row count of the whole dataset, kept columns, and filters: the subset of the five normalised keys (canton, commune_bfs, postal_code, noga, year) this SPECIFIC dataset can be filtered on — filters are listed per dataset here, never a fixed set for the whole API. No score, no ranking between datasets.'
      responses:
        '200':
          description: Dataset catalogue
          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, /cantons and /sources)
      tags:
      - Datasets
      operationId: getApiV1Datasets
      x-operation-id-source: derived
  /api/v1/datasets/{id}:
    get:
      summary: Rows of one approved open dataset, filtered and paginated
      description: 'Rows filtered by EXACT equality on whichever of the five normalised keys (canton, commune_bfs, postal_code, noga, year) this dataset declares in its catalogue entry’s filters array (see /api/v1/datasets). A filter query parameter naming a key this dataset does not have, or an invalid value for its key, is a 400 error (unknown_filter_key: or invalid_filter_value:) — never a silently ignored filter. limit defaults to 100, maximum 1000; offset defaults to 0; both reject an out-of-range or non-integer value with a 400 error (invalid_limit/invalid_offset) rather than silently clamping it. total is the row count after filtering, before pagination — distinct from the whole-dataset row count shown in the catalogue entry. attribution is present only when the licence requires one and the registry carries a non-empty text, null otherwise. The response also echoes this dataset’s filters array, identical to its catalogue entry.'
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
          pattern: ^[a-z][a-z0-9-]{2,63}$
        description: Dataset id, e.g. gr-finances-communes
      - name: canton
        in: query
        required: false
        schema:
          type: string
        description: Filter on the canton key, when this dataset declares it (2-letter abbreviation)
      - name: commune_bfs
        in: query
        required: false
        schema:
          type: string
        description: Filter on the commune_bfs key, when this dataset declares it (official municipality number)
      - name: postal_code
        in: query
        required: false
        schema:
          type: string
        description: Filter on the postal_code key, when this dataset declares it (4 digits)
      - name: noga
        in: query
        required: false
        schema:
          type: string
        description: Filter on the noga key, when this dataset declares it
      - name: year
        in: query
        required: false
        schema:
          type: string
        description: Filter on the year key, when this dataset declares it (4 digits)
      - name: limit
        in: query
        required: false
        schema:
          type: integer
          minimum: 1
          maximum: 1000
          default: 100
        description: Maximum rows returned
      - name: offset
        in: query
        required: false
        schema:
          type: integer
          minimum: 0
          default: 0
        description: Rows to skip, after filtering
      responses:
        '200':
          description: Filtered, paginated rows of this dataset, with its catalogue metadata
          headers:
            Cache-Control:
              schema:
                type: string
              description: public, max-age=3600
        '400':
          description: Unknown filter key for this dataset, invalid filter value, or out-of-range/non-integer limit or offset
        '404':
          description: Unknown dataset id
        '429':
          description: Rate limit exceeded for this network address (600 requests/hour, shared with /localities, /communes, /cantons and /sources)
      tags:
      - Datasets
      operationId: getApiV1DatasetsById
      x-operation-id-source: derived