---
title: "Contour lines from swissSURFACE3D around a point (GeoJSON / DXF / Shapefile), streamed"
description: "Proxy for the Contoor 3D API (`project_res_3D_api`, FastAPI, systemd unit `contoor-3d-api` on the RES box, published at contoor-api-contabo.gisjoe.com). RES adds the RES token, the request allowlist and RES-hosted artifact URLs so one contract and one credential cover parcels and meshes.\n\nBuilds a DEM from the LiDAR points in a square of ± `bbox_radius_m` (optionally filtered to `ground`, `trees`, `buildings`), extracts contours at `interval_m`, and streams the file. `format=geojson` streams GeoJSON (WGS84); `dxf` and `shapefile` stream a binary file (Shapefile as a ZIP). Proxy timeout 300 s."
---

> 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) › Building3D

`GET /res_api/3d/contour`

Proxy for the Contoor 3D API (`project_res_3D_api`, FastAPI, systemd unit `contoor-3d-api` on the RES box, published at contoor-api-contabo.gisjoe.com). RES adds the RES token, the request allowlist and RES-hosted artifact URLs so one contract and one credential cover parcels and meshes.

Builds a DEM from the LiDAR points in a square of ± `bbox_radius_m` (optionally filtered to `ground`, `trees`, `buildings`), extracts contours at `interval_m`, and streams the file. `format=geojson` streams GeoJSON (WGS84); `dxf` and `shapefile` stream a binary file (Shapefile as a ZIP). Proxy timeout 300 s.

## Authentication

Requires one of the following:

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

## Query parameters

- `lat` (`downloadContours.query.lat`; number, required)
- `lng` (`downloadContours.query.lng`; number, required)
- `format` (`downloadContours.query.format`; string, optional)
  - one of `"geojson"`, `"dxf"`, `"shapefile"`; default `"geojson"`
- `bbox_radius_m` (`downloadContours.query.bbox_radius_m`; number, optional)
  - min 10; max 1000; default `50`
- `interval_m` (`downloadContours.query.interval_m`; number, optional)
  - min 0.1; max 100; default `1`
- `resolution_m` (`downloadContours.query.resolution_m`; number, optional): DEM grid resolution.
  - min 0.1; max 10; default `0.5`
- `smooth` (`downloadContours.query.smooth`; boolean, optional)
  - default `true`
- `selected_pointcloud_class` (`downloadContours.query.selected_pointcloud_class`; string, optional): Comma-separated subset of ground, vegetation, tree, trees, buildings.
- `token` (`downloadContours.query.token`; string, optional)

## Code samples

### cURL

```bash
curl --request GET \
  --url 'https://res.aireon.ch/res_api/3d/contour?lat=0&lng=0' \
  --header 'token: <token>'
```

### TypeScript

```typescript
const url = 'https://res.aireon.ch/res_api/3d/contour?lat=0&lng=0';
const options = {method: 'GET', headers: {token: '<token>'}};

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/3d/contour?lat=0&lng=0"

headers = {"token": "<token>"}

response = requests.get(url, headers=headers)

print(response.text)
```

## Responses

### 200

The contour file.

#### Body (application/geo+json)

##### Example

```json
{}
```

#### Body (application/octet-stream)

##### Example

```text
string
```

### 400

Invalid request.

#### Example

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

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

### 401

Authentication missing or invalid.

#### Example

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

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

### 403

Authenticated but not permitted.

#### Example

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

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

### 502

The 3D service is unreachable or answered with an error (its status and body are relayed in `upstream_status` / `upstream`).

#### Example

```json
{
  "error": "string",
  "upstream_status": 0,
  "upstream": null,
  "detail": "string"
}
```

- `error` (`downloadContours.response.502.error`; string, optional)
- `upstream_status` (`downloadContours.response.502.upstream_status`; integer, optional)
- `upstream` (`downloadContours.response.502.upstream`; unknown, optional)
- `detail` (`downloadContours.response.502.detail`; string, optional)

### 504

The 3D service did not answer within the proxy timeout.

#### Example

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

- `error` (`downloadContours.response.504.error`; string, optional)
- `detail` (`downloadContours.response.504.detail`; string, optional)


Source: https://docs.aireon.ch/res/download-contours/index.md
