API

LocationBox API

Get Suggestions

Get Suggestions Service suggests full name of address elements about city, town, distinct and POI

Get Suggestions request must look like this:

http://www.locationbox.com.tr/locationbox/services?Key=key&Cmd=GetSuggestions&Typ=output_format&Latitude=latitude&Longitude=longitude
&Count=count&Keyword=keyword


Request Parameters


Key: LocationBox user key. (Register for user key)
Cmd: LocationBox service name. (GetSuggestions)
Typ: Response format. (XML or JSON)
Keyword: Keyword for suggestions.
Count: Number of response records.
Longitude (optional): Longitude value of POI.
Latitude (optional): Latitude value of POI.
SXT (optional): Set as 1 if you want to have suggestion end of the word. If not set as 0
DataSet (optional): You can get IL,ILCE,MAHALLE,POI dataset as writen here.

Response Parameters


XML Response

Get Suggestions response returns in XML format when the Typ parameter is set as "XML".

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

http://www.locationbox.com.tr/locationbox/services?Key=key&Cmd=GetSuggestions&Typ=XML&Latitude=41.111&Longitude=29.023&Count=5&
Keyword=Bostancý


The response will be as following:

<response>
 <transactionid>LBS_196</transactionid>
 <status>0</status>
 <errno />
 <errdesc />
 <suggestions>
  <suggestion>
   <id>34200028667</id>
   <fromtable>SEMT</fromtable>
   <name>Bostancý, Bostancý, Kadýköy, Ýstanbul</name>
   <latitude>40.95789</latitude>
   <longitude>29.0957</longitude>
   <distance>18069</distance>
  </suggestion>
  <suggestions>
   <id>34000015027</id>
   <fromtable>MAHALLE</fromtable>
   <name>Bostancý, Kadýköy, Ýstanbul Anadolu Yakasý</name>
   <latitude>40.95788</latitude>
   <longitude>29.0957</longitude>
   <distance>18070</distance>
  </suggestion>
  <suggestion>
   <id>305610</id>
   <fromtable>MAHALLE</fromtable>
   <name>Bostancý, Gönen, Balýkesir</name>
   <latitude>40.21437</latitude>
   <longitude>27.69223</longitude>
   <distance>150255</distance>
  </poi>

   ...

  <suggestion>
   <id>27000994002</id>
   <fromtable>MAHALLE</fromtable>
   <name>Bostancý, Þahinbey, Gaziantep</name>
   <latitude>37.06775</latitude>
   <longitude>37.38665</longitude>
   <distance>850920</distance>
  </suggestion>
 </suggestions>
</response>

JSON Response

POI Search response returns in JSON format when the Typ parameter is set as "JSON".

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

http://www.locationbox.com.tr/locationbox/services?Key=key&Cmd=GetSuggestions&Typ=JSON&Latitude=41.111&Longitude=29.023&Count=5&
Keyword=Bostancý


The response will be as following:


{ "transactionid": "LBS_37376121", "status": 0, "suggestions": [ { "id": 34200028667, "fromtable": "SEMT", "name": "Bostancý, Bostancý, Kadýköy, Ýstanbul", "latitude": 40.95789, "longitude": 29.0957, "distance": 18069 }, { "id": 34000015027, "fromtable": "MAHALLE", "name": "Bostancý, Kadýköy, Ýstanbul Anadolu Yakasý", "latitude": 40.95788, "longitude": 29.0957, "distance": 18070 }, { "id": 305610, "fromtable": "MAHALLE", "name": "Bostancý, Gönen, Balýkesir", "latitude": 40.21437, "longitude": 27.69223, "distance": 150255 },
...
{ "id": 27000994002, "fromtable": "MAHALLE", "name": "Bostancý, Þahinbey, Gaziantep", "latitude": 37.06775, "longitude": 37.38665, "distance": 850920 } ] }


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.