---
title: "Spare-space candidates inside a bounding box (GeoJSON)"
description: "Returns the spare-space (buildable reserve) candidate polygons from the `spare_space` table that intersect a WGS84 bounding box, restricted to the currently ACTIVE snapshot (`spare_space_snapshots.status = 'active'`). At most 5,000 features per call, in table order - narrow the bbox rather than paging; there is no offset.\n\n⚠ The usage audit listed `egrid` as a parameter: the code has no such filter. The only inputs are `bbox` (required) and `canton` (optional).\n\n**No authentication**, no cache headers, not Redis-cached (v1 layer; the refresh/build POSTs from the runbook are not implemented)."
---

> 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

`GET /res_api/spare_space`

Returns the spare-space (buildable reserve) candidate polygons from the `spare_space` table that intersect a WGS84 bounding box, restricted to the currently ACTIVE snapshot (`spare_space_snapshots.status = 'active'`). At most 5,000 features per call, in table order - narrow the bbox rather than paging; there is no offset.

⚠ The usage audit listed `egrid` as a parameter: the code has no such filter. The only inputs are `bbox` (required) and `canton` (optional).

**No authentication**, no cache headers, not Redis-cached (v1 layer; the refresh/build POSTs from the runbook are not implemented).

## Query parameters

- `bbox` (`getSpareSpace.query.bbox`; string, required): `minLng,minLat,maxLng,maxLat` in WGS84. Exactly four numbers or the call is a 400.
  - pattern `^-?[0-9.]+,-?[0-9.]+,-?[0-9.]+,-?[0-9.]+$`
- `canton` (`getSpareSpace.query.canton`; string, optional): Two-letter canton code; exact match on `spare_space.canton`. Not normalised (send uppercase).
  - pattern `^[A-Z]{2}$`

## Code samples

### cURL

```bash
curl --request GET \
  --url 'https://res.aireon.ch/res_api/spare_space?bbox=8.5%2C47.36%2C8.56%2C47.4'
```

### TypeScript

```typescript
const url = 'https://res.aireon.ch/res_api/spare_space?bbox=8.5%2C47.36%2C8.56%2C47.4';
const options = {method: 'GET'};

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/spare_space?bbox=8.5%2C47.36%2C8.56%2C47.4"

response = requests.get(url)

print(response.text)
```

## Responses

### 200

FeatureCollection of candidate polygons (empty when nothing intersects or no snapshot is active).

#### Example

```json
{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "geometry": {},
      "properties": {
        "id": 0,
        "kind": "string",
        "egrid": "string",
        "canton": "string",
        "confidence": 0,
        "area_m2": 0,
        "inscribed_diam_m": 0,
        "az_surplus_m2": 0
      }
    }
  ]
}
```

- `type` (`getSpareSpace.response.200.type`; string, required)
- `features` (`getSpareSpace.response.200.features`; array<object>, required)
  - `type` (`getSpareSpace.response.200.features.type`; string, optional)
  - `geometry` (`getSpareSpace.response.200.features.geometry`; object, optional): GeoJSON geometry of the candidate (`geom_4326`), WGS84.
  - `properties` (`getSpareSpace.response.200.features.properties`; object, optional)
    - `id` (`getSpareSpace.response.200.features.properties.id`; integer, optional)
    - `kind` (`getSpareSpace.response.200.features.properties.kind`; string, optional): Candidate kind as stored in `spare_space.kind`.
    - `egrid` (`getSpareSpace.response.200.features.properties.egrid`; string | null, optional): EGRID of the host parcel (`egrid_a`).
    - `canton` (`getSpareSpace.response.200.features.properties.canton`; string | null, optional)
    - `confidence` (`getSpareSpace.response.200.features.properties.confidence`; number | null, optional)
    - `area_m2` (`getSpareSpace.response.200.features.properties.area_m2`; integer, optional): Rounded to whole m².
    - `inscribed_diam_m` (`getSpareSpace.response.200.features.properties.inscribed_diam_m`; number | null, optional): Largest inscribed circle diameter, rounded to 0.1 m.
    - `az_surplus_m2` (`getSpareSpace.response.200.features.properties.az_surplus_m2`; integer | null, optional): Remaining floor-area allowance (Ausnützungsziffer surplus), rounded to whole m².

### 400

`bbox` missing or malformed - `{"error":"bbox=minLng,minLat,maxLng,maxLat required"}`.

#### Example

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

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

### 500

Query failed - `{"error":"query failed"}`.

#### Example

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

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


Source: https://docs.aireon.ch/res/get-spare-space/index.md
