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

# Building Outlines

> Download the outlines of buildings inside a bounding box from a dataset derived from satellite imagery.

This API lets users download building outlines as detected by satellite imagery
for regions of the US, Canada, Australia, Uganda, Tanzania, and potentially more countries.

This dataset was generated as part of the [Daylight Map](https://daylightmap.org) project
and is traditionally hard to query because it requires converting between difficult file formats.

Downloading building outlines inside a bounding box can be useful in many GIS applications
including calculating rooftop area for evaluating solar installations, determining the
right dropoff location for logistics, and calculating frontages for development opportunities.

### Request Parameters

<ParamField query="bbox" type="string" default="None" placeholder="-97.45,37.59,-97.22,37.76">
  This is the bounding box for extracted features. The coordinates (in EPSG:4326) of
  the bounding box are required to be in (minimum longitude, minimum latitude,
  maximum longitude, maximum latitude) order. Coordinates are expressed as signed floats
  joined by commas.

  An example bounding box in the US could be `-108.984375,32.026706,-103.051758,37.195331`.

  You can create a bounding box [on bboxfinder](http://bboxfinder.com), or in shapely by
  invoking the `bounds` property on a geometry.
</ParamField>

<ParamField query="api_key" type="string" placeholder="demo" required>
  Your account's API key. You can create an API key by
  [registering for an account](https://buntinglabs.com/account/register)
  and copy and paste it from your [account dashboard](https://buntinglabs.com/dashboard).
</ParamField>

### Response

When the OSM feature extract is successfully created, a 200 OK response will be
issued, with `Content-Type: application/json`. The body will be a valid [GeoJSON
FeatureCollection](https://geojson.org/) with the building outlines.

In the event of an error, an error response will be issued, usually with a 5xx error code.
The error will be JSON-formatted, with an `error` field describing the cause.

<ResponseField name="error" type="string">
  The error message if the extract request parameters were incorrectly formatted.

  This response field will not be present if the extract succeeds.
</ResponseField>

### Data License

This API serves [Daylight](https://daylightmap.org) data, which is
open, freely available, and licensed under the
[Open Data Commons Open Database License (ODbL)](https://daylightmap.org/attribution.html).

Building data © OpenStreetMap contributors, Microsoft, Esri Community Maps contributors:

* [Australia Building Footprints](https://github.com/microsoft/AustraliaBuildingFootprints)
* [Canadian Building Footprints](https://github.com/microsoft/CanadianBuildingFootprints)
* [Uganda/Tanzania Building Footprints](https://github.com/microsoft/Uganda-Tanzania-Building-Footprints)
* [US Building Footprints](https://github.com/microsoft/USBuildingFootprints)

<RequestExample>
  ```bash Example Request
  curl --get 'https://osm.buntinglabs.com/v1/buildings/select' \
       --data "api_key=demo" \
       --data "bbox=-119.719970,39.523343,-119.718232,39.524452"
  ```
</RequestExample>

<ResponseExample>
  ```json Response
  {
    "type": "FeatureCollection",
    "features": [{
      "type": "Feature",
      "properties": {
        "release": 2,
        "capture_dates_range": "8/1/2018-10/1/2018"
      },
      "geometry": {
        "type": "Polygon",
        "coordinates": [[
          [-119.718713,39.523978],
          [-119.719321,39.523981],
          [-119.71932,39.524028],
          [-119.718715,39.523809],
          [-119.718713,39.523978]
        ]]
      }
    }]
  }
  ```
</ResponseExample>
