---
title: "Building volume statistics within a bounding box"
description: "Aggregates building footprint count, volume and density within a circular bounding box around a coordinate."
---

> 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/bldg_vol_bbox`

Aggregates building footprint count, volume and density within a circular bounding box around a coordinate.

## Authentication

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

## Request body

_Required._

- `lat` (`getBuildingVolumeBbox.lat`; number, required): WGS84 latitude.
- `lng` (`getBuildingVolumeBbox.lng`; number, required): WGS84 longitude.
- `bbox_radius` (`getBuildingVolumeBbox.bbox_radius`; number, optional): Bounding-box radius, in metres. Must be positive.
  - default `100`

## Example request

```json
{
  "lat": 0,
  "lng": 0,
  "bbox_radius": 100
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url https://res.aireon.ch/res_api/bldg_vol_bbox \
  --header 'Content-Type: application/json' \
  --header 'token: <token>' \
  --data '
{
  "lat": 0,
  "lng": 0,
  "bbox_radius": 100
}
'
```

### TypeScript

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

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/bldg_vol_bbox"

payload = {
    "lat": 0,
    "lng": 0,
    "bbox_radius": 100
}
headers = {
    "Content-Type": "application/json",
    "token": "<token>"
}

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

print(response.text)
```

## Responses

### 200

Building volume statistics.

#### Example

```json
{
  "success": true,
  "input": {
    "lat": 0,
    "lng": 0,
    "bbox_radius_m": 0
  },
  "statistics": {
    "total_building_count": 0,
    "buildings_with_volume": 0,
    "buildings_without_volume": 0,
    "total_volume_m3": 0,
    "avg_volume_m3": 0,
    "min_volume_m3": 0,
    "max_volume_m3": 0,
    "total_footprint_area_m2": 0
  },
  "density": {
    "bbox_area_m2": 0,
    "volume_density_bbox_m3_per_m2": 0,
    "volume_density_footprint_m3_per_m2": 0
  }
}
```

- `success` (`getBuildingVolumeBbox.response.200.success`; boolean, optional)
- `input` (`getBuildingVolumeBbox.response.200.input`; object, optional)
  - `lat` (`getBuildingVolumeBbox.response.200.input.lat`; number, optional)
  - `lng` (`getBuildingVolumeBbox.response.200.input.lng`; number, optional)
  - `bbox_radius_m` (`getBuildingVolumeBbox.response.200.input.bbox_radius_m`; number, optional)
- `statistics` (`getBuildingVolumeBbox.response.200.statistics`; object, optional)
  - `total_building_count` (`getBuildingVolumeBbox.response.200.statistics.total_building_count`; integer, optional)
  - `buildings_with_volume` (`getBuildingVolumeBbox.response.200.statistics.buildings_with_volume`; integer, optional)
  - `buildings_without_volume` (`getBuildingVolumeBbox.response.200.statistics.buildings_without_volume`; integer, optional)
  - `total_volume_m3` (`getBuildingVolumeBbox.response.200.statistics.total_volume_m3`; number, optional)
  - `avg_volume_m3` (`getBuildingVolumeBbox.response.200.statistics.avg_volume_m3`; number | null, optional)
  - `min_volume_m3` (`getBuildingVolumeBbox.response.200.statistics.min_volume_m3`; number | null, optional)
  - `max_volume_m3` (`getBuildingVolumeBbox.response.200.statistics.max_volume_m3`; number | null, optional)
  - `total_footprint_area_m2` (`getBuildingVolumeBbox.response.200.statistics.total_footprint_area_m2`; number, optional)
- `density` (`getBuildingVolumeBbox.response.200.density`; object, optional)
  - `bbox_area_m2` (`getBuildingVolumeBbox.response.200.density.bbox_area_m2`; number, optional)
  - `volume_density_bbox_m3_per_m2` (`getBuildingVolumeBbox.response.200.density.volume_density_bbox_m3_per_m2`; number, optional)
  - `volume_density_footprint_m3_per_m2` (`getBuildingVolumeBbox.response.200.density.volume_density_footprint_m3_per_m2`; number, optional)

### 400

Missing or invalid token / parameters.

#### Example

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

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

### 401

Wrong token.

#### Example

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

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

### 500

Server error.

#### Example

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

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


Source: https://docs.aireon.ch/res/get-building-volume-bbox/index.md
