---
url: https://docs.geo.admin.ch/preview/feat-pb-2457-test-codebuild-with-nodejs-v26/explore-data/get-layer-attribute-values.md
---
# Get Layer Attribute Values

The attribute values endpoint provides a preview of possible values for a specific attribute (field) of a given vector layer.
This is useful for building filter UIs, dropdowns, or for understanding the data distribution in a layer.

## Request Details

To interact with the Layer Attribute Values service, you need to provide specific parameters in your request.
This endpoint only has **Path Parameters** which are mandatory.

### Path Parameters

| Parameters                   | Description                                             |
| ---------------------------- | ------------------------------------------------------- |
| **layerBodId (required)**    | The technical name or the layer ID.                     |
| **attributeName (required)** | The name of the attribute for which to retrieve values. |

## Response Details

The endpoint returns a **JSON** with information about the attribute values for the specified layer and attribute. The response includes an array of values. For attributes of type `DATE`, `INTEGER`, `NUMERIC` the endpoint returns the minimum and maximum values as a two-element array. For other attribute types the endpoint returns up to 50 distinct values, sorted alphabetically.

Here is a description of the data contained in the response.

| **Field** | **Description**           |
| --------- | ------------------------- |
| `values`  | Array of attribute values |

## Examples

Get distinct values for the `egid` attribute from layer `ch.bfs.gebaeude_wohnungs_register`:

Get the min and max value for the `garea` attribute from layer `ch.bfs.gebaeude_wohnungs_register`:
