API

LocationBox API

Reverse Geocoding

Reverse Geocoding Service gives you address information about geographical data that you send.

A Reverse Geocode request must look like this:

http://www.locationbox.com.tr/locationbox/services?Key=key&Cmd=Geocode&Typ=output_format&Latitude=latitude&Longitude=longitude


Request Parameters


Key: LocationBox user key. (Register for user key)
Cmd: LocationBox service name. (Geocode)
Typ: Response format. (XML or JSON)
Latitude: Latitude value. (8 digits max.)
Longitude: Longitude value. (8 digits max.)
What3Words: Three words that describe the desired coordinates. e.g. What3Words=ayna.balk.kuma
(Click more information What3Words service.)

Response Parameters


ADRESKODU package must be defined for your API key in order to retrieve "addresscode" fields.

WHAT3WORDS package must be defined for your API key in order to retrieve what3words.

XML Response

Reverse Geocoding response returns in XML format when the Typ parameter is set as "XML".

Below is an example for a geocoding request which is expected to return a response in XML format .

http://www.locationbox.com.tr/locationbox/services?Key=key&Cmd=Geocode&Typ=XML&Latitude=40.93351&Longitude=29.13095

The response will be as following:

<response>
 <transactionid>LBS_155037206</transactionid>
 <status>0</status>
 <adrcleanver>v5.01</adrcleanver>
 <dataversion>15Q4</dataversion>
 <errno />
 <errdesc />
 <geocode>
  <address />
  <latitude>40.93351</latitude>
  <longitude>29.13095</longitude>
  <zone>2</zone>
  <resaddress>ALTAYÇEŞME MAH. KİRAZ SOKAK FATİH APARTMANI NO: 15 MALTEPE 34843 İSTANBUL</resaddress>
  </adrresaddress>
  <reslevel>1</reslevel>
  <vfylevel>0</vfylevel>
  <geolevel>6</geolevel>
  <extra></extra>
  <ilid>34000000000</ilid>
  <iladreskodu>0</iladreskodu>
  <iladi>STANBUL</iladi>
  <ilceid>34000019000</ilceid>
  <ilceadreskodu>0</ilceadreskodu>
  <ilceadi>MALTEPE</ilceadi>
  <mahalleid>34000019004</mahalleid>
  <mahalleadreskodu>0</mahalleadreskodu>
  <mahalleadi>ALTAYEME</mahalleadi>
  <koyid>0</koyid>
  <koyadreskodu>0</koyadreskodu>
  <koyadi></koyadi>
  <semtid>0</semtid>
  <semtadi></semtadi>
  <caddeid>0</caddeid>
  <caddeadreskodu>0</caddeadreskodu>
  <caddeadi></caddeadi>
  <sokakid>15931349</sokakid>
  <sokakadreskodu>0</sokakadreskodu>
  <sokakadi>KRAZ</sokakadi>
  <siteid>0</siteid>
  <siteadi></siteadi>
  <kapiid>515499</kapiid>
  <kapino>15</kapino>
  <kapiadreskodu>0</kapiadreskodu>
  <kapiadi></kapiadi>
  <kurumid>0</kurumid>
  <kurumadi></kurumadi>
  <kat></kat>
  <daireadreskodu>0</daireadreskodu>
  <daireno></daireno>
  <postakodu></postakodu>
  <subtype>0</subtype>
  <what3words>vg.atk.kaz</what3words>
  <adr>
   <iladi>STANBUL</iladi>
   <ilceadi>MALTEPE</ilceadi>
   <mahalleadi>ALTAYEME</mahalleadi>
   <koyadi></koyadi>
   <semtadi></semtadi>
   <caddeadi></caddeadi>
   <sokakadi>KRAZ SOKAK</sokakadi>
   <siteadi></siteadi>
   <kapino>15</kapino>
   <kapiadi>FATH APARTMANI</kapiadi>
   <kurumadi></kurumadi>
   <kat></kat>
   <daireno></daireno>
   <postakodu>34843</postakodu>
  </adr>
 </geocode>
</response>

JSON Response

Reverse Geocode response returns in JSON format when the Typ parameter is set as "JSON".

Below is an example for a geocoding request which is expected to return a response in JSON format .

http://www.locationbox.com.tr/locationbox/services?Key=key&Cmd=Geocode&Typ=JSON&Latitude=40.93351&Longitude=29.13095

The response will be as following:

{ "transactionid": "LBS_155011592", "status": 0, "adrcleanver": "v5.01", "dataversion": "15Q4", "geocode": { "address": "", "latitude": 40.93348, "longitude": 29.13102, "zone": 2, "resaddress": "ALTAYEME MAH. KRAZ SOKAK FATH APARTMANI NO: 15 34843 MALTEPE STANBUL", "adrresaddress": "", "reslevel": 6, "vfylevel": 6, "geolevel": 6, "extra": "", "ilId": 34, "ilAdresKodu": 0, "ilAdi": "stanbul", "ilceId": 34000019000, "ilceAdresKodu": 0, "ilceAdi": "Maltepe", "mahalleId": 34000019004, "mahalleAdresKodu": 0, "mahalleAdi": "Altayeme", "koyId": 0, "koyAdresKodu": 0, "koyAdi": "", "semtId": 0, "semtAdi": "", "caddeId": 0, "caddeAdresKodu": 0, "caddeAdi": "", "sokakId": 27310008, "sokakAdresKodu": 0, "sokakAdi": "Kiraz Sokak", "siteId": 0, "siteAdi": "", "kapiId": 7771042, "kapiAdresKodu": 0, "kapiNo": "15", "kapiAdi": "Fatih Apartman", "kurumId": 0, "kurumAdi": "", "kat": "", "daireAdresKodu": 0, "daireNo": "", "postaKodu": "34843", "subtype": 0, "what3words": "vg.atk.kaz", "adr": { "ilAdi": "stanbul", "ilceAdi": "Maltepe", "mahalleAdi": "Altayeme", "koyAdi": "", "semtAdi": "", "caddeAdi": "", "sokakAdi": "Kiraz Sokak", "siteAdi": "", "kapiNo": "15", "kapiAdi": "Fatih Apartman", "kurumAdi": "", "kat": "", "daireNo": "", "postaKodu": "34843" } } }

transactionid: The id of response given by LocationBox Service. Every response can be tracked using transactionid when necessary.
status: Response format. (XML or JSON)

Status Codes
0 -- Success
1 -- Fail

errno: Error code
errdesc: Error definition

Error Codes
10001 Error processing your request. Please try again soon.
Cmd parameter is misspelled/not found.
10011 Error processing your request. Please check the Cmd parameter.
Cmd is not specified.
10012 Error processing your request. Please check the Key parameter.
Key is not specified.
10013 Error processing your request. Please check the Key parameter.
Key is invalid.
20018 Parameter error.
Latitude and/or longitude values are not specified.

Geocode
address: Returns empty in Reverse Geocode service.
latitude: Latitude value.
longitude: Longitude value.
resaddress: Reverse geocoded and verified address text.
reslevel: Geocoding level. Returns -1 in Reverse Geocode service.
vfylevel: Verify level in our address database.
geolevel: Geocoding level of that address in our database.

Common Levels
1 City
2 Town
3 District
4 Village
5 Road
6 Door
7 Site/Institution
8 Poi
9 Neighborhood
0 Not geocoded