Skip to content
GuidesBlogPlaygroundDashboard

Get feature by type and ID

POST/api/v1/features/lookup

Get feature by type and ID

ReturnsExpand Collapse
GeoJsonFeature = object { geometry, properties, type, id }

GeoJSON Feature representing an OSM element. Tags from the original OSM element are flattened directly into properties (not nested under a tags key). Metadata fields @type and @id identify the OSM element type and ID within properties.

geometry: GeoJsonGeometry { coordinates, type }

GeoJSON Geometry object per RFC 7946. Coordinates use [longitude, latitude] order. 3D coordinates [lng, lat, elevation] are used for elevation endpoints.

coordinates: array of number or array of array of number or array of array of array of number or array of array of array of array of number

Coordinates array. Nesting depth varies by geometry type: Point = [lng, lat], LineString = [[lng, lat], ...], Polygon = [[[lng, lat], ...], ...], etc.

One of the following:
Point = array of number

[longitude, latitude] or [longitude, latitude, elevation]

LineStringOrMultiPoint = array of array of number

Array of [lng, lat] positions

PolygonOrMultiLineString = array of array of array of number

Array of linear rings / line strings

MultiPolygon = array of array of array of array of number

Array of polygons

type: "Point" or "LineString" or "Polygon" or 3 more

Geometry type

One of the following:
"Point"
"LineString"
"Polygon"
"MultiPoint"
"MultiLineString"
"MultiPolygon"
properties: map[unknown]

OSM tags flattened as key-value pairs, plus @type (node/way/relation) and @id (OSM ID) metadata fields. May include distance_m for proximity queries.

type: "Feature"

Always Feature

id: optional string

Compound identifier in type/osm_id format

Get feature by type and ID

curl https://plaza.fyi/api/v1/features/lookup \
    -X POST \
    -H "Authorization: Bearer $PLAZA_API_KEY"
{
  "geometry": {
    "coordinates": [
      2.3522,
      48.8566
    ],
    "type": "Point"
  },
  "properties": {
    "@id": "bar",
    "@type": "bar",
    "amenity": "bar",
    "cuisine": "bar",
    "name": "bar"
  },
  "type": "Feature",
  "id": "node/21154906"
}
Returns Examples
{
  "geometry": {
    "coordinates": [
      2.3522,
      48.8566
    ],
    "type": "Point"
  },
  "properties": {
    "@id": "bar",
    "@type": "bar",
    "amenity": "bar",
    "cuisine": "bar",
    "name": "bar"
  },
  "type": "Feature",
  "id": "node/21154906"
}