---
title: "Generic bounding-box query filtered by a single OSM tag"
method: GET
path: "/api/v1/environment/osm/bbox"
tags: ["Environment"]
---

# Generic bounding-box query filtered by a single OSM tag

`GET /api/v1/environment/osm/bbox`

Return OpenStreetMap nodes, ways, and relations inside a bounding box that match a single tag filter (`tag_key=tag_value`). Bounding box area is capped at 1 square degree (~110 km x 110 km at the equator) to stay within Overpass resource budgets. The `tag_key` is restricted to a curated allowlist of top-level OSM keys; `tag_value` must match `[A-Za-z0-9_-]{1,64}`. Data is (C) OpenStreetMap contributors (ODbL 1.0) - attribution is required on any surface that renders this data.

## Query parameters

- `min_lat` number, required — South latitude of the bounding box (decimal degrees, WGS84).
- `min_lon` number, required — West longitude of the bounding box (decimal degrees, WGS84).
- `max_lat` number, required — North latitude of the bounding box (decimal degrees, WGS84).
- `max_lon` number, required — East longitude of the bounding box (decimal degrees, WGS84).
- `tag_key` string, required — OSM top-level tag key. Accepted values: amenity, boundary, building, craft, highway, historic, landuse, leisure, man_made, natural, office, power, public_transport, railway, shop, tourism, waterway.
- `tag_value` string, required — OSM tag value (1-64 chars, [A-Za-z0-9_-] only).
- `limit` integer — Maximum number of elements to return (1-2000).

## Response `200`

Matching OSM elements within the bounding box, (C) OpenStreetMap contributors (ODbL 1.0).

- EnvelopeOverpassBboxPayload
  - `data` OverpassBboxPayload, required — Response payload for `/api/v1/environment/osm/bbox`.
    - `min_lat` number, required — South latitude of the bounding box echoed from the request.
    - `min_lon` number, required — West longitude of the bounding box echoed from the request.
    - `max_lat` number, required — North latitude of the bounding box echoed from the request.
    - `max_lon` number, required — East longitude of the bounding box echoed from the request.
    - `tag_key` string, required — OSM tag key filter echoed from the request.
    - `tag_value` string, required — OSM tag value filter echoed from the request.
    - `count` integer, required — Number of matching elements returned.
    - `elements` OsmElement[], required — Matching elements across nodes, ways, and relations. Data is (C) OpenStreetMap contributors (ODbL 1.0).
      - `type` string, nullable — Element type: `node`, `way`, or `relation`.
      - `id` integer, nullable — OSM stable element identifier (unique within its type namespace).
      - `lat` number, nullable — Node latitude in decimal degrees (WGS84). Present only on `node` elements.
      - `lon` number, nullable — Node longitude in decimal degrees (WGS84). Present only on `node` elements.
      - `center` OsmElementCenter — Centroid coordinates attached by the `out center` output mode.
        - `lat` number, nullable — Centroid latitude in decimal degrees (WGS84). (C) OpenStreetMap contributors (ODbL 1.0).
        - `lon` number, nullable — Centroid longitude in decimal degrees (WGS84). (C) OpenStreetMap contributors (ODbL 1.0).
      - `nodes` integer[], nullable — Ordered list of child node identifiers. Present on `way` elements.
      - `members` OsmRelationMember[], nullable — Ordered list of member references with roles. Present on `relation` elements.
        - `type` string, nullable — Member element type: `node`, `way`, or `relation`.
        - `ref` integer, nullable — OSM identifier of the referenced element.
        - `role` string, nullable — Role of the member within the parent relation (e.g. `inner`, `outer`, `stop`).
      - `tags` object, nullable — Flat string-to-string map of OSM tags (e.g. `name`, `amenity`, `operator`, `plant:source`).
    - `timestamp_osm_base` string, nullable — ISO 8601 UTC timestamp of the OSM snapshot the query ran against.
    - `attribution` string — ODbL 1.0 attribution required on every surface that displays this data.
  - `meta` SugraMeta, required — Metadata attached to every /api/v1/* response envelope.
    - `endpoint` string, required — Requested endpoint path.
    - `data_time` string, required — ISO 8601 UTC timestamp of the source data, not of the request.
    - `response_time` string, required — ISO 8601 UTC timestamp when this response was produced.
    - `provider` string, required — API name and version.
    - `source` string, nullable — Identifier of the primary upstream source used for this response.
    - `attribution` string, nullable — Human-readable attribution mandated by an upstream source (e.g. a securities regulator or self-regulatory organization). Present only on responses whose source requires the owner and source to be clearly identified. Do not remove or alter it when using the response.
    - `fallback_used` boolean, nullable — True when the primary source failed and a fallback produced the data.
    - `fallback_chain` string[], nullable — Ordered list of sources attempted, in the order they were tried.
    - `cached` boolean, nullable — True when this response was served from the internal cache.
    - `stale` boolean, nullable — True when the cached response was returned after the upstream rate-limited or errored. Clients can use this to detect degraded data.

## Other responses

- `401` — Missing or invalid `x-api-key` header.
- `422` — Validation Error
- `429` — Daily rate limit exceeded. Check `X-RateLimit-Reset` for the next window.
- `503` — Upstream source is temporarily unavailable. Retry after a short delay.

---

[API](https://skmtc.net/sugra/apis/sugra-api.md) · [All operations](https://skmtc.net/sugra/apis/sugra-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/sugra/sugra-api/versions/4e2740743eb4/schema)
