Skip to content
GuidesBlogPlaygroundDashboard

Get feature by type and ID

$client->elements->lookup(): GeoJsonFeature
POST/api/v1/features/lookup

Get feature by type and ID

ReturnsExpand Collapse

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

array<string,mixed> properties

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 type

Always Feature

?string id

Compound identifier in type/osm_id format

Get feature by type and ID

<?php

require_once dirname(__DIR__) . '/vendor/autoload.php';

$client = new Client(apiKey: 'My API Key', environment: 'local');

$geoJsonFeature = $client->elements->lookup();

var_dump($geoJsonFeature);
{
  "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"
}