Skip to content
GuidesPlaygroundDashboard

Forward geocode an address

$client->geocode->forward(string q, ?string bbox, ?string countryCode, ?string lang, ?float lat, ?string layer, ?int limit, ?float lng): GeocodeResult
GET/api/v1/geocode

Forward geocode an address

ParametersExpand Collapse
q: string

Address or place name

bbox?:optional string

Bounding box filter: south,west,north,east

countryCode?:optional string

ISO 3166-1 alpha-2 country code filter

lang?:optional string

Language code for localized names (e.g. en, de, fr)

lat?:optional float

Focus latitude

layer?:optional string

Filter by layer: address, poi, or admin

limit?:optional int

Maximum results (default 20, max 100)

lng?:optional float

Focus longitude

ReturnsExpand Collapse
list<GeocodingFeature> features
Type type

Forward geocode an address

<?php

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

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

$geocodeResult = $client->geocode->forward(
  q: 'q',
  bbox: 'bbox',
  countryCode: 'country_code',
  lang: 'lang',
  lat: 0,
  layer: 'layer',
  limit: 0,
  lng: 0,
);

var_dump($geocodeResult);
Returns Examples