swisstopo WMS API

Endpoints to obtain WMS links for filtered layers

Operations 3

POST /generateWmsRequest Generate a WMS Base URL for a filtered layer (semantic query applied) #
GET /wms Retrieve WMS service information #
POST /wms Retrieve WMS service information #

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-wms-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-wms-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Swisstopo WMS API
  version: 1.6.2
  description: 'Operations tagged WMS 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: WMS
  description: Endpoints to obtain WMS links for filtered layers
paths:
  /generateWmsRequest:
    post:
      tags:
      - WMS
      summary: Generate a WMS Base URL for a filtered layer (semantic query applied)
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WmsRequest'
            example:
              webmapId: SwissTopoMap
              layerId: tecto_units_augm
              filters:
              - filterId: f-tectonic-term
                parameters:
                  term: https://dev-lexic.swissgeol.ch/TectonicUnits/AutochthonousNorthAlpineForeland
                  includeNarrowers: true
        required: true
      responses:
        '200':
          description: WMS endpoint with filtered layer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WmsResponse'
              example:
                url: https://dev-webmap-api.swissgeol.ch/v1/wms
                body: REQUEST=GetMap&SERVICE=WMS&VERSION=1.3.0&FORMAT=image/png&STYLES=swisstopo:filtered&TRANSPARENT=true&LAYERS=tecto_units_augm&TILED=true&SEMANTIC_FILTER=calculate_semantic_constraint( "tecto_units_augm" , "f-tectonic-term" , "https://dev-lexic.swissgeol.ch/TectonicUnits/AutochthonousNorthAlpineForeland" , "true" )&CRS=EPSG:2056
                mimeType: image/png
                note: The WMS URL includes encoded semantic query parameters.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
      operationId: postGenerateWmsRequest
      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
  /wms:
    get:
      tags:
      - WMS
      summary: Retrieve WMS service information
      description: WMS endpoint that complies with the OGC WMS standard, see at https://www.ogc.org/it/standards/wms/. The request may include standard WMS parameters such as REQUEST, SERVICE, VERSION, LAYERS, CRS, BBOX, WIDTH, HEIGHT, and FORMAT. Clients may also provide the optional SEMANTIC_FILTER parameter generated from /generateWmsRequest. When SEMANTIC_FILTER is omitted, the request is proxied without semantic filtering.
      parameters:
      - in: query
        name: SEMANTIC_FILTER
        required: false
        schema:
          type: string
        description: Optional semantic filter expression generated from /generateWmsRequest.
      responses:
        '200':
          description: Successful WMS response
          content:
            image/png:
              schema:
                type: string
                format: binary
        '400':
          $ref: '#/components/responses/BadRequest'
        '500':
          $ref: '#/components/responses/InternalServerError'
      operationId: getWms
      x-operation-id-source: derived
    post:
      tags:
      - WMS
      summary: Retrieve WMS service information
      description: WMS endpoint that complies with the OGC WMS standard, see at https://www.ogc.org/it/standards/wms/. POST requests use the same WMS parameters as GET requests, encoded as application/x-www-form-urlencoded to support long WMS filter payloads. Clients may also provide the optional SEMANTIC_FILTER parameter generated from /generateWmsRequest. When SEMANTIC_FILTER is omitted, the request is proxied without semantic filtering.
      requestBody:
        required: false
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              additionalProperties:
                type: string
              properties:
                SEMANTIC_FILTER:
                  type: string
                  description: Optional semantic filter expression generated from /generateWmsRequest.
      responses:
        '200':
          description: Successful WMS response
          content:
            image/png:
              schema:
                type: string
                format: binary
        '400':
          $ref: '#/components/responses/BadRequest'
        '500':
          $ref: '#/components/responses/InternalServerError'
      operationId: postWms
      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)
    WmsResponse:
      type: object
      required:
      - url
      - body
      - mimeType
      - note
      properties:
        url:
          type: string
          format: uri
          description: WMS endpoint URL to call.
          example: https://dev-webmap-api.swissgeol.ch/v1/wms
        body:
          type: string
          description: WMS request parameter string generated by /generateWmsRequest.
          example: REQUEST=GetMap&SERVICE=WMS&VERSION=1.3.0&FORMAT=image/png&STYLES=swisstopo:filtered&TRANSPARENT=true&LAYERS=tecto_units_augm&TILED=true&SEMANTIC_FILTER=calculate_semantic_constraint( "tecto_units_augm" , "f-tectonic-term" , "https://dev-lexic.swissgeol.ch/TectonicUnits/AutochthonousNorthAlpineForeland" , "true" )&CRS=EPSG:2056
        mimeType:
          type: string
          example: image/png
        note:
          type: string
          example: WMS URL includes encoded semantic query parameters.
    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
    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
    WmsRequest:
      required:
      - webmapId
      - layerId
      type: object
      properties:
        webmapId:
          type: string
        layerId:
          type: string
        filters:
          type: array
          description: List of applied filters and their parameter values
          items:
            $ref: '#/components/schemas/WmsRequest_filters'
    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'
  responses:
    InternalServerError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            code: 500
            message: Internal server error
    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