Skip to content
GuidesPlaygroundDashboard

Get feature by type and ID

$client->elements->retrieve(int id, string type): GeoJsonFeature
GET/api/v1/features/{type}/{id}

Get feature by type and ID

ParametersExpand Collapse
type: string
id: int
ReturnsExpand Collapse
array<string,mixed> properties
Type type
?string id

Feature identifier (type/osm_id)

?int osmID

OpenStreetMap ID

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->retrieve(0, type: 'type');

var_dump($geoJsonFeature);
Returns Examples