---
title: "Get parcel data by coordinate or EGRID"
description: "Returns full parcel data for a Swiss parcel, located either by WGS84 coordinate (`lat`/`lng`) or by parcel `egrid`.\n\nWith `structure: \"default\"` the response is the raw GeoServer GeoJSON `FeatureCollection`, enriched with `owner`, `isSignal`, `image_urls` and `OEREB_url` on the first feature's properties. With `structure: \"tree\"` the response is a grouped, human-readable object."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.aireon.ch/llms.txt
> Use this file to discover all available pages before exploring further.

Path: RES API (public) › Parcel

`POST /res_api/parcel_data`

Returns full parcel data for a Swiss parcel, located either by WGS84 coordinate (`lat`/`lng`) or by parcel `egrid`.

With `structure: "default"` the response is the raw GeoServer GeoJSON `FeatureCollection`, enriched with `owner`, `isSignal`, `image_urls` and `OEREB_url` on the first feature's properties. With `structure: "tree"` the response is a grouped, human-readable object.

## Authentication

- `ResApiToken`, apiKey, in header, header `token`

## Request body

_Required._

- `lat` (`getParcelData.lat`; number, optional): WGS84 latitude.
- `lng` (`getParcelData.lng`; number, optional): WGS84 longitude.
- `egrid` (`getParcelData.egrid`; string, optional): Parcel EGRID identifier.
- `structure` (`getParcelData.structure`; string, optional): `default` returns the raw GeoJSON FeatureCollection; `tree` returns a grouped, human-readable object.
  - one of `"default"`, `"tree"`; default `"default"`

## Example requests

### By lat/lng

```json
{
  "lat": 47.3769,
  "lng": 8.5417,
  "structure": "tree"
}
```

### By EGRID

```json
{
  "egrid": "CH807318035875",
  "structure": "default"
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url https://res.aireon.ch/res_api/parcel_data \
  --header 'Content-Type: application/json' \
  --header 'token: <token>' \
  --data '
{
  "lat": 47.3769,
  "lng": 8.5417,
  "structure": "tree"
}
'
```

### TypeScript

```typescript
const url = 'https://res.aireon.ch/res_api/parcel_data';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', token: '<token>'},
  body: JSON.stringify({lat: 47.3769, lng: 8.5417, structure: 'tree'})
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://res.aireon.ch/res_api/parcel_data"

payload = {
    "lat": 47.3769,
    "lng": 8.5417,
    "structure": "tree"
}
headers = {
    "Content-Type": "application/json",
    "token": "<token>"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 200

Parcel data. Shape depends on the `structure` field. Note: a missing/invalid token or missing location produces a plain-text 200 body (see `description`).

#### Body (application/json)

One of:

- `GeoJSONFeatureCollection`
- `ParcelTree`

##### Example

```json
{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "id": "string",
      "geometry": {},
      "properties": {
        "ratio_v": 0,
        "free_v": 0,
        "ratio_s": 0,
        "gfz": 0,
        "bldg_height_m": 0,
        "bldg_floors_n": 0
      }
    }
  ]
}
```

#### Body (text/html)

##### Example

```text
Missing Token
```

### 401

Authentication missing or invalid.

#### Example

```json
{
  "error": "string",
  "message": "string"
}
```

- `error` (`getParcelData.response.401.error`; string, required): Human-readable error description.
- `message` (`getParcelData.response.401.message`; string, optional): Optional underlying error message.


Source: https://docs.aireon.ch/res/get-parcel-data/index.md
