swisstopo Layers API

Endpoints to list layers and their filters

Operations 4

GET /layers Get list of filterable layers for a WebMap #
GET /layers/{layerId}/filters Get enabled filters for a specific layer #
GET /layers/{layerId}/defaultFilters Get default filters for a layer and a vocabulary term #
GET /layers/{layerId}/attributeList Get available attributes for filter by attribute on a specific layer #

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/swisstopo:swisstopo-layers-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

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. See our Privacy Policy and Terms.

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

OpenAPI Specification

swisstopo-layers-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Swisstopo Layers API
  version: 1.6.2
  description: 'Operations tagged Layers across 2 of this provider''s published API definitions: swissgeol-lexic-webmap-api.yaml, swisstopo-openapi.yml. Each path carries the servers of the definition it was published in.'
servers:
- url: https://webmap-api.swissgeol.ch
  description: Swisstopo Production Server
- url: https://int-webmap-api.swissgeol.ch
  description: Swisstopo INT Server
- url: https://dev-webmap-api.swissgeol.ch
  description: Swisstopo DEV Server
security:
- ApiKeyAuth: []
tags:
- name: Layers
  description: Endpoints to list layers and their filters
paths:
  /layers:
    get:
      tags:
      - Layers
      summary: Get list of filterable layers for a WebMap
      parameters:
      - name: lang
        in: query
        required: false
        schema:
          type: string
          enum:
          - en
          - it
          - de
          - fr
          default: en
        description: Language for filter labels and descriptions
      responses:
        '200':
          description: List of filterable layers
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_200'
              example:
                webmapId: SwissTopoMap
                layers:
                - id: tecto_units_augm
                  name: Tectonic Units
                  filterable: true
                  availableFilters:
                  - id: f-chronostrat-term
                    name: Chronostratigraphy
                    title: Filter by Chronostratigraphy term
                    description: Filter by chronostratigraphy terms
                  - id: f-tectonic-term
                    name: Tectonic Units
                    title: Filter by Tectonic Units term
                    description: Filter by tectonic unit terms
                  - id: f-byAttribute
                    name: Attribute
                    title: Filter by Attribute
                    description: Filter by attributes
                - id: gc_bedrock
                  name: GC_BEDROCK
                  filterable: true
                  availableFilters:
                  - id: f-chronostrat-term
                    name: Chronostratigraphy
                    title: Filter by Chronostratigraphy term
                    description: Filter by chronostratigraphy terms
                  - id: f-tectonic-term
                    name: Tectonic Units
                    title: Filter by Tectonic Units term
                    description: Filter by tectonic unit terms
                  - id: f-lithostrat-term
                    name: Lithostratigraphy
                    title: Filter by Lithostratigraphy term
                    description: Filter by lithostratigraphy terms
                  - id: f-lithology-term
                    name: Lithology
                    title: Filter by Lithology term
                    description: Filter by lithology terms
                  - id: f-byAttribute
                    name: Attribute
                    title: Filter by Attribute
                    description: Filter by attributes
                - id: gc_unco_deposits
                  name: GC_UNCO_DEPOSITS
                  filterable: true
                  availableFilters:
                  - id: f-chronostrat-term
                    name: Chronostratigraphy
                    title: Filter by Chronostratigraphy term
                    description: Filter by chronostratigraphy terms
                  - id: f-byAttribute
                    name: Attribute
                    title: Filter by Attribute
                    description: Filter by attributes
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
      operationId: getLayers
      x-operation-id-source: derived
    servers:
    - url: https://webmap-api.swissgeol.ch
      description: Swisstopo Production Server
    - url: https://int-webmap-api.swissgeol.ch
      description: Swisstopo INT Server
    - url: https://dev-webmap-api.swissgeol.ch
      description: Swisstopo DEV Server
  /layers/{layerId}/filters:
    get:
      tags:
      - Layers
      summary: Get enabled filters for a specific layer
      parameters:
      - name: layerId
        in: path
        required: true
        schema:
          type: string
      - name: lang
        in: query
        required: false
        schema:
          type: string
          enum:
          - en
          - it
          - de
          - fr
          default: en
        description: Language for filter labels and descriptions
      responses:
        '200':
          description: Enabled filters for the specified layer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_200_1'
              examples:
                gc_bedrock:
                  summary: Filters for gc_bedrock layer
                  value:
                    layerId: gc_bedrock
                    filters:
                    - id: f-chronostrat-term
                      name: Chronostratigraphy
                      title: Filter by Chronostratigraphy term
                      description: Filter by chronostratigraphy terms
                    - id: f-tectonic-term
                      name: Tectonic Units
                      title: Filter by Tectonic Units term
                      description: Filter by tectonic unit terms
                    - id: f-lithostrat-term
                      name: Lithostratigraphy
                      title: Filter by Lithostratigraphy term
                      description: Filter by lithostratigraphy terms
                    - id: f-lithology-term
                      name: Lithology
                      title: Filter by Lithology term
                      description: Filter by lithology terms
                    - id: f-byAttribute
                      name: Attribute
                      title: Filter by Attribute
                      description: Filter by attributes
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
      operationId: getLayersByLayerIdFilters
      x-operation-id-source: derived
    servers:
    - url: https://webmap-api.swissgeol.ch
      description: Swisstopo Production Server
    - url: https://int-webmap-api.swissgeol.ch
      description: Swisstopo INT Server
    - url: https://dev-webmap-api.swissgeol.ch
      description: Swisstopo DEV Server
  /layers/{layerId}/defaultFilters:
    get:
      tags:
      - Layers
      summary: Get default filters for a layer and a vocabulary term
      description: Returns the default filters that should be applied to visualize the provided vocabulary term on the selected layer. The vocabulary is inferred from the term URI. If the layer does not support the inferred vocabulary, the endpoint returns an error.
      parameters:
      - name: layerId
        in: path
        required: true
        schema:
          type: string
      - name: term
        in: query
        required: true
        schema:
          type: string
          format: uri
        description: Vocabulary term URI used to infer the vocabulary and build the default filter
      responses:
        '200':
          description: Default filters for the specified layer and term
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DefaultFiltersResponse'
              examples:
                ChronostratigraphyTerm:
                  summary: Example with a Chronostratigraphy term and no default filters
                  value:
                    layerId: gc_bedrock
                    filters: []
                LithologyTerm:
                  summary: Example with a Lithology term and one default filter
                  value:
                    layerId: gc_bedrock
                    filters:
                    - filterId: f-lithology-term
                      parameters:
                        term: https://dev-lexic.swissgeol.ch/Lithology/Amphibolite
                        includeNarrowers: true
                TectonicUnitsTerm:
                  summary: Example with a Tectonic Units term and one default filter
                  value:
                    layerId: tecto_units_augm
                    filters:
                    - filterId: f-tectonic-term
                      parameters:
                        term: https://dev-lexic.swissgeol.ch/TectonicUnits/UpperRhineGraben
                        includeNarrowers: true
        '400':
          description: The layer does not support the vocabulary inferred from the provided term URI
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: 400
                message: Layer does not support the vocabulary inferred from the provided term
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
      operationId: getLayersByLayerIdDefaultFilters
      x-operation-id-source: derived
    servers:
    - url: https://webmap-api.swissgeol.ch
      description: Swisstopo Production Server
    - url: https://int-webmap-api.swissgeol.ch
      description: Swisstopo INT Server
    - url: https://dev-webmap-api.swissgeol.ch
      description: Swisstopo DEV Server
  /layers/{layerId}/attributeList:
    get:
      tags:
      - Layers
      summary: Get available attributes for filter by attribute on a specific layer
      parameters:
      - name: layerId
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Attribute list for the specified layer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_200_2'
              examples:
                gc_bedrock:
                  summary: Attributes for gc_bedrock layer
                  value:
                    layerId: gc_bedrock
                    attributes:
                    - uuid
                    - fmat_litstrat
                    - objectid
                    - kind
                    - rbed_orig_descr
                    - form_att
                    - fmat_litstrat_code
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
      operationId: getLayersByLayerIdAttributeList
      x-operation-id-source: derived
    servers:
    - url: https://webmap-api.swissgeol.ch
      description: Swisstopo Production Server
    - url: https://int-webmap-api.swissgeol.ch
      description: Swisstopo INT Server
    - url: https://dev-webmap-api.swissgeol.ch
      description: Swisstopo DEV Server
components:
  schemas:
    ChronostratigraphyFilterParameter:
      type: object
      required:
      - type
      properties:
        type:
          type: string
          enum:
          - Younger
          - From-To
          - Older
        from:
          type: string
          description: From term (required if type is From-To or Older)
        to:
          type: string
          description: To term (required if type is From-To or Younger)
    inline_response_200_2:
      type: object
      properties:
        layerId:
          type: string
        attributes:
          type: array
          items:
            type: string
    DefaultFiltersResponse:
      type: object
      required:
      - layerId
      - filters
      properties:
        layerId:
          type: string
        filters:
          type: array
          description: Default filters to apply when visualizing the selected vocabulary term on the map
          items:
            $ref: '#/components/schemas/WmsRequest_filters'
    Filter:
      type: object
      properties:
        id:
          type: string
          enum:
          - f-chronostrat-term
          - f-tectonic-term
          - f-lithostrat-term
          - f-lithology-term
          - f-byAttribute
        name:
          type: string
        title:
          type: string
        description:
          type: string
    inline_response_200:
      type: object
      properties:
        webmapId:
          type: string
        layers:
          type: array
          items:
            $ref: '#/components/schemas/Layer'
    ByAttributeFilterParameter:
      type: object
      required:
      - attribute
      - value
      properties:
        attribute:
          type: string
          description: Attribute key available from /layers/{layerId}/attributeList
        value:
          oneOf:
          - type: string
          - type: number
          - type: boolean
          description: Attribute value to match
    WmsRequest_filters:
      type: object
      properties:
        filterId:
          type: string
          enum:
          - f-chronostrat-term
          - f-tectonic-term
          - f-lithostrat-term
          - f-lithology-term
          - f-byAttribute
        parameters:
          oneOf:
          - $ref: '#/components/schemas/ChronostratigraphyFilterParameter'
          - $ref: '#/components/schemas/TermFilterParameter'
          - $ref: '#/components/schemas/ByAttributeFilterParameter'
    TermFilterParameter:
      type: object
      required:
      - term
      properties:
        term:
          type: string
          description: Selected term from vocabulary
        includeNarrowers:
          type: boolean
          description: Whether to include narrower terms
          default: true
    Error:
      type: object
      properties:
        code:
          type: integer
        message:
          type: string
    Layer_availableFilters:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        title:
          type: string
        description:
          type: string
    Layer:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        filterable:
          type: boolean
        availableFilters:
          type: array
          items:
            $ref: '#/components/schemas/Layer_availableFilters'
    inline_response_200_1:
      type: object
      properties:
        layerId:
          type: string
        filters:
          type: array
          items:
            $ref: '#/components/schemas/Filter'
  responses:
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    BadRequest:
      description: Bad Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      name: X-API-Key
      in: header
      description: 'API key required to access all endpoints of the SwissTopo WebMap Semantic Filtering API.

        '
externalDocs:
  description: WebMap semantic filter architecture and usage
  url: https://virtserver.swaggerhub.com/epsilonitalia/SwissTopoWebmapAPI/1.0.1
x-refined-from:
- swissgeol-lexic-webmap-api.yaml
- swisstopo-openapi.yml