API

LocationBox API

Traffic Route

Traffic Route Service gives traffic information on specific routes based on criterias which you can find below.

Traffic Route request must look like this:

http://www.locationbox.com.tr/locationbox/services?Key=key&Cmd=cmd_name&Typ=output_format& parameters=parameter_id


TrafficRouteList


Request Parameters


Key: LocationBox user key. (Register for user key)
Cmd: LocationBox service name. (TrafficRouteList)
Typ: Response format. (XML or JSON)
IlId: Il Id. (Address Elements)

Response Parameters


XML Response

Traffic Route List response returns in XML format when the Typ parameter is set as "XML".

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

http://www.locationbox.com.tr/locationbox/services?Key=key&Cmd=TrafficRouteList&IlId=ilid&Typ=XML

The response will be as following:


<response>
 <transactionid>LBS_151</transactionid>
 <status>0</status>
 <errno />
 <errdesc />
 <items>
  <trafficroute>
   <id>4348952</id>
   <fromname>Altunizade Kavþaðý</fromname>
   <toname>Beþiktaþ (Dolmabahçe)</toname>
   <exp />
   <distance>7838</distance>
   <duration>6</duration>
   <delay>1814</delay>
  <trafficroute />

   ...

  <trafficroute>
   <id>4325953</id>
   <fromname>Zühtüpaþa (Baðdat Caddesi)</fromname>
   <toname>Bostancý (Baðdat Caddesi)</toname>
   <exp />
   <distance>6782</distance>
   <duration>10</duration>
   <delay>233</delay>
  <trafficroute />
 <items />
</response>

JSON Response

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

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

http://www.locationbox.com.tr/locationbox/services?Key=key&Cmd=TrafficRouteList&IlId=ilid&Typ=JSON

The response will be as following:


{ "transactionid": "LBS_37845299", "status": 0, "items": [ { "id": 4348952, "fromname": "Altunizade Kavþaðý", "toname": "Beþiktaþ (Dolmabahçe)", "exp": "", "distance": 7838, "duration": 6, "delay": 2032 },
...
{ "id": 4325953, "fromname": "Zühtüpaþa (Baðdat Caddesi)", "toname": "Bostancý (Baðdat Caddesi)", "exp": "", "distance": 6782, "duration": 10, "delay": 175 } ] }


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.
20022 City is not found.
20023 Town is not found.
20024 District is not found.

TrafficRouteList ( Traffic Route List )
id: Traffic route id.
froname: Traffic route starting point.
toname: Traffic route ending point.
distance: Traffic route distance.
duration: Traffic duration on route path.
delay: Traffic delay on route path.


TrafficRoute


Request Parameters


Key: LocationBox user key. (Register for user key)
Cmd: LocationBox service name. (TrafficRoute)
Typ: Response format. (XML or JSON)
IlId: Il Id. (Address Elements)
StartName: Start route address
EndName: End route address


XML Response

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

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

http://www.locationbox.com.tr/locationbox/services?Key=key&Cmd=TrafficRoute&Typ=XML&IlId=34&StartName=Altunizade%20Kav%C5%9Fa%C4%9F%C4%B1&EndName=Maslak

The response will be as following:


<response>
 <transactionid>LBS_151</transactionid>
 <status>0</status>
 <errno />
 <errdesc />
 <items>
  <trafficroute>
   <id>4326197</id>
   <fromname>Altunizade Kavþaðý</fromname>
   <toname>Maslak</toname>
   <exp>(1.Köprü)</exp>
   <distance>12609</distance>
   <duration>12</duration>
   <delay>1193</delay>
  <trafficroute />
  <trafficroute>
   <id>4326197</id>
   <fromname>Altunizade Kavþaðý</fromname>
   <toname>Maslak</toname>
   <exp>(2.Köprü)</exp>
   <distance>29274</distance>
   <duration>26</duration>
   <delay>1644</delay>
  <trafficroute />
 </items>
</response>

JSON Response

Trafic Route response returns in JSON format when the Typ parameter is set as "JSON".

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

http://www.locationbox.com.tr/locationbox/services?Key=key&Cmd=TrafficRoute&Typ=JSON&IlId=34&StartName=Altunizade%20Kav%C5%9Fa%C4%9F%C4%B1&EndName=Maslak

The response will be as following:


{ "transactionid": "LBS_37845334", "status": 0, "items": [ { "id": 4326197, "fromname": "Altunizade Kavþaðý", "toname": "Maslak", "exp": "(1.Köprü)", "distance": 12609, "duration": 12, "delay": 1104 }, { "id": 4351597, "fromname": "Altunizade Kavþaðý", "toname": "Maslak", "exp": "(2.Köprü)", "distance": 29274, "duration": 26, "delay": 1536} ] }

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.
20022 City is not found.
20023 Town is not found.
20024 District is not found.


TrafficStartList & TrafficEndList


Request Parameters


Key: LocationBox user key. (Register for user key)
Cmd: LocationBox service name. (TrafficStartList & TrafficEndList)
Typ: Response format. (XML or JSON)
EndName (or StartName): Response format. (XML or JSON)


XML Response

Address Elements response returns in XML format when the Typ parameter is set as "XML".

Below is an example for an traffic start list (traffic end list) request which is expected to return a response in XML format .

http://www.locationbox.com.tr/locationbox/services?Key=key&Cmd=TrafficStartList&Typ=XML&IlId=34&EndName=Maslak

The response will be as following:


<response>
 <transactionid>LBS_183487</transactionid>
 <status>0</status>
 <errno />
 <errdesc />
 <names>
  <name>Altunizade Kavþaðý</name>
  <name>Kozyataðý</name>
  <name>Zincirlikuyu</name>
 </names>
</response>

JSON Response

TrafficStartList (TrafficEndList) response returns in JSON format when the Typ parameter is set as "JSON".

Below is an example for an traffic start list (traffic end list) request which is expected to return a response in JSON format .

http://www.locationbox.com.tr/locationbox/services?Key=key&Cmd=TrafficStartList&Typ=JSON&IlId=34&EndName=Maslak

The response will be as following:


{ "transactionid": "LBS_37845366", "status": 0, "names": [ "Altunizade Kavþaðý", "Kozyataðý", "Zincirlikuyu" ] }

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.
20022 City is not found.
20023 Town is not found.
20024 District is not found.