API

LocationBox API

Geocoding

Geocoding Service gives geographical information about address that you send.(In Turkey)

A Geocode request must look like this:

http://www.locationbox.com.tr/locationbox/services?Key=key&Cmd=Geocode&Typ=output_format&Address=address


Request Parameters


Key: LocationBox user key. (Register for user key)
Cmd: LocationBox service name. (Geocode)
Typ: Response format. (XML or JSON)
Address: Input address for geocoding. Address input is used as free text (with all the spaces) and no additional formatting is needed.

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

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&Address=Altayeme Mah. Kiraz Sok. No:15 Maltepe stanbul

The response will be as following:

<response>
 <transactionid>LBS_155032818</transactionid>
 <status>0</status>
 <adrcleanver>v5.01</adrcleanver>
 <dataversion>15Q4</dataversion>
 <errno />
 <errdesc />
 <geocode>
  <address>Altayçeşme Mah. Kiraz Sok. No:15 Maltepe İstanbul</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>ALTAYÇEŞME MAH. KİRAZ SOKAK FATİH APARTMANI NO: 15 MALTEPE 34843 İSTANBUL</adrresaddress>
  <reslevel>6</reslevel>
  <vfylevel>6</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

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&Address=Altayeme Mah. Kiraz Sok. No:15 Maltepe stanbul

The response will be as following:

{ "transactionid": "LBS_37831787", "status": 0, "adrcleanver": "v5.01", "dataversion": "15Q4", "geocode": { "address": "Altayeme Mah. Kiraz Sok. No:15 Maltepe stanbul", "latitude": 40.93351, "longitude": 29.13095, "zone": 2, "resaddress": " ALTAYEME MAH. KRAZ SOKAK NO: 15 MALTEPE 34843 STANBUL", "adrresaddress": "", "reslevel": 6, "vfylevel": 0, "geolevel": 6, "extra": " ", "ilId": 34000000000, "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": 15931349, "sokakAdresKodu": 0, "sokakAdi": "KRAZ", "siteId": 0, "siteAdi": "", "kapiId": 515499, "kapiAdresKodu": 0, "kapiNo": "15", "kapiAdi": "", "kurumId": 0, "kurumAdi": "", "kat": "", "daireAdresKodu": 0, "daireNo": "", "postaKodu": "", "subtype": 0, "what3words": "vg.atk.kaz", "adr": { "ilAdi": "STANBUL", "ilceAdi": "MALTEPE", "mahalleAdi": "ALTAYEME", "koyAdi": "", "semtAdi": "", "caddeAdi": "", "sokakAdi": "KRAZ SOKAK", "siteAdi": "", "kapiNo": "15", "kapiAdi": "FATH APARTMANI", "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.
20012 No data found.

Geocode
address: The address text to be geocoded.
latitude: The latitude value of the point found.
longitude: The longitude value of the point found.
resaddress: The geocoded and verified address text.
reslevel: Address level that customer requested.
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
16 Door Range
17 Closest Door
0 Not geocoded

Global Geocoding

Global Geocoding Service gives geographical information about address that you send.(All Around World)

A Global Geocode request must look like this:

http://www.locationbox.com.tr/locationbox/services?Key=key&Cmd=GlobalGeocode&Typ=output_format&Address=address



Request Parameters


Key: LocationBox user key. (Register for user key)
Cmd: LocationBox service name. (Geocode)
Typ: Response format. (XML or JSON)
Address: Input address for geocoding. Address input is used as free text (with all the spaces) and no additional formatting is needed.

Response Parameters


XML Response

Global 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=GlobalGeocode&Typ=XML&Address=Lodz,Gdanska Street, 106-8, Poland

The response will be as following:

<response>
 <transactionid>LBS_53476882</transactionid>
 <status>0</status>
 <errno />
 <errdesc />
 <geocode>
  <address></address>
  <latitude>51.9667915</latitude>
  <longitude>19.9496937</longitude>
  <resaddress>Gdańska, 90-507, Lodz, PL</resaddress>
  <reslevel></reslevel>
  <geolevel></geolevel>
  <extra></extra>
  <ilid></ilid>
  <iladi></iladi>
  <ilceid></ilceid>
  <ilceadi></ilceadi>
  <mahalleid></mahalleid>
  <mahalleadi></mahalleadi>
  <koyid></koyid>
  <koyadi></koyadi>
  <semtid></semtid>
  <semtadi></semtadi>
  <caddeid></caddeid>
  <caddeadi></caddeadi>
  <sokakid></sokakid>
  <sokakadi></sokakadi>
  <siteid></siteid>
  <siteadi></siteadi>
  <kapiid></kapiid>
  <kapino></kapino>
  <kapiadi></kapiadi>
  <kurumid></kurumid>
  <kurumadi></kurumadi>
  <kat></kat>
  <daireno></daireno>
  <postakodu></postakodu>
  <adr>
   <iladi>Lodz Province, Poland</iladi>
   <ilceadi>Lodz</ilceadi>
   <mahalleadi></mahalleadi>
   <koyadi></koyadi>
   <semtadi></semtadi>
   <caddeadi>Gdańska</caddeadi>
   <sokakadi></sokakadi>
   <siteadi></siteadi>
   <kapino></kapino>
   <kapiadi></kapiadi>
   <kurumadi></kurumadi>
   <kat></kat>
   <daireno></daireno>
   <postakodu>90-507</postakodu>
  </adr>
 </geocode>
</response>

JSON Response

Global 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=GlobalGeocode&Typ=JSON&Address=Lodz,Gdanska Street, 106-8, Poland

The response will be as following:

{ "transactionid": "LBS_53476883", "status": 0, "geocode": { "address": "", "latitude": 51.7667915, "longitude": 19.4496937, "resaddress": "Gda?ska, 90-507, Lodz, PL", "reslevel": "" , "vfylevel": "" , "geolevel": "" , "extra": "", "ilId": "" , "ilAdi": "", "ilceId": "" , "ilceAdi": "", "mahalleId": "" , "mahalleAdi": "", "koyId": "" , "koyAdi": "", "semtId": "" , "semtAdi": "", "caddeId": "" , "caddeAdi": "", "sokakId": "" , "sokakAdi": "", "siteId": "" , "siteAdi": "", "kapiId": "" , "kapiNo": "", "kapiAdi": "", "kurumId": "" , "kurumAdi": "", "kat": "", "daireNo": "", "postaKodu": "", "adr": { "ilAdi": "Lodz Province, Poland", "ilceAdi": "Lodz", "mahalleAdi": "", "koyAdi": "", "semtAdi": "", "caddeAdi": "Gdańska", "sokakAdi": "", "siteAdi": "", "kapiNo": "", "kapiAdi": "", "kurumAdi": "", "kat": "", "daireNo": "", "postaKodu": "90-507" } } }

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.
20012 No data found.

Global Geocode
address: The address text to be geocoded.
latitude: The latitude value of the point found.
longitude: The longitude value of the point found.
resaddress: The geocoded and verified address text.
reslevel: Address level that customer requested.
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
16 Door Range
17 Closest Door
0 Not geocoded

Notes

The city must be specified in the address input for geocoding service to perform.