---
url: https://docs.geo.admin.ch/preview/chore/bgdidic-698/diemo-json-eol/access-data/get-html-popup.md
---
# Get HTML Popup

Get metadata for a feature formatted as an HTML popup.

:::tip
The [map viewer](https://map.geo.admin.ch/) displays the same popup when you click on a feature by hand.
No CSS styling is provided per default so that you can use your own.
:::

## Request Details

To interact with the HTML popup service, you need to provide specific parameters in your request.
These parameters are divided into path parameters, which are required and part of the URL, and query parameters, which are optional and modify the behavior of the request.

### Path Parameters

| Parameters                | Description                                               |
| ------------------------- | --------------------------------------------------------- |
| **layerBodId (required)** | The id of the layer                                       |
| **featureId (required)**  | The object’s Id (separated by comma for multiple objects) |

### Query Parameters

| Parameters                  | Description                                                                                                                                                                                                                     |
| --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **lang (optional)**         | The language. Supported values: de, fr, it , rm, en. Defaults to "de".                                                                                                                                                          |
| **sr (optional)**           | The spatial reference. Supported values: 21781 (LV03), 2056 (LV95), 4326 (WGS84) and 3857 (Web Pseudo-Mercator). Defaults to "21781".                                                                                           |
| **time (optional)**         | Time (YYYY) to filter out time enabled layers, e.g. LUBIS. Defaults to "none".                                                                                                                                                  |
| **mapExtent (optional)**    | The extent of the map. (minx, miny, maxx, maxy).                                                                                                                                                                                |
| **imageDisplay (optional)** | The screen image display parameters (width, height, and dpi) of the map. The combination of *mapExtent* and *imageDisplay* are used to compute a *resolution* or *scale*. Some layer have *scale* dependant htmlpopup responses |
| **coord (optional)**        | The coordinates of interest (x, y). Some layers with external datasource need to know the cooridnates of the click on the map (p.e. ch.bafu.gefahren-aktuelle_erdbeben)                                                         |
| **callback (optional)**     | The name of the callback function.                                                                                                                                                                                              |

## Examples

Get the HTML popup with the feature ID `RIG` belonging to layer `ch.bafu.nabelstationen`:

\<ExampleCodeBlock
request='$ curl https://api3.geo.admin.ch/rest/services/ech/MapServer/ch.bafu.nabelstationen/RIG/htmlPopup'
exampleLang='html'
example='

This request retrieves the HTML for the popup, displaying the same content as the map viewer below:
