API

LocationBox API

Traffic Event Search

Traffic Event Search Service gives dynamic traffic information based on criterias which you can find below.

A Traffic Event Search request must look like this:

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



Request Parameters


Key: LocationBox user key. (Register for user key)
Cmd: LocationBox service name. (TrafficEventSearch)
Typ: Response format. (XML or JSON)
Latitude: Latitude of location.
Longitude: Longitude of location.
Radius: The radius of the area bounding for event search result.

Response Parameters


XML Response

Traffic Event Search response returns in XML format when the Typ parameter is set as "XML".

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

http://www.locationbox.com.tr/locationbox/services?Key=key&Cmd=TrafficEventSearch&Typ=XML
&Latitude=41.0961&Longitude=29.0619&Radius=10000


The response will be as following:

<response>
 <transactionid>LBS_37525910</transactionid>
 <status>0</status>
 <errno />
 <errdesc />
 <items>
  <event>
   <id>2620</id>
   <name>trafik tkankl, ortalama hz 10 km/s</name>
   <code>70</code>
   <type>1</type>
   <latitude>41.09141</latitude>
   <longitude>29.06163</longitude>
   <delay>977</delay>
   <speed>14</speed>
   <roadname>Tem Otoyolu</roadname>
   <startingpoint>Molla Grani Viyad</startingpoint>
   <endingpoint>FSM Kprs</endingpoint>
   <distance>521</distance>
  </event>
  </items>
</response>

JSON Response

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

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

http://www.locationbox.com.tr/locationbox/services?Key=key&Cmd=TrafficEventSearch&Typ=JSON
&Latitude=41.0961&Longitude=29.0619&Radius=10000


The response will be as following:


{ { "transactionid": "LBS_37526482", "status": 0, "items": [ { "id": -2620, "name": "trafik tkankl, ortalama hz 10 km/s", "code": 70, "type": 1, "latitude": 41.09141, "longitude": 29.06163, "delay": 977, "speed": 14, "roadname": "Tem Otoyolu", "startingpoint": "Molla Grani Viyad", "endingpoint": "FSM Kprs", "distance": 521 } ] }

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

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.