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.)


Response Parameters


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

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>ALTAYÇEÞME</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>KÝRAZ</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></what3words>
  <adr>
   <iladi>ÝSTANBUL</iladi>
   <ilceadi>MALTEPE</ilceadi>
   <mahalleadi>ALTAYÇEÞME</mahalleadi>
   <koyadi></koyadi>
   <semtadi></semtadi>
   <caddeadi></caddeadi>
   <sokakadi>KÝRAZ SOKAK</sokakadi>
   <siteadi></siteadi>
   <kapino>15</kapino>
   <kapiadi>FATÝH 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": "ALTAYÇEÞME MAH. KÝRAZ SOKAK FATÝH 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": "Altayçeþme", "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": "", "adr": { "ilAdi": "Ýstanbul", "ilceAdi": "Maltepe", "mahalleAdi": "Altayçeþme", "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