bmtc-api icon indicating copy to clipboard operation
bmtc-api copied to clipboard

missing live location endpoint

Open asdofindia opened this issue 6 years ago • 5 comments

The BMTC app allows planning trip by entering source and destination with live location of buses in the route

asdofindia avatar Oct 27 '18 13:10 asdofindia

I have made a pull request to add the trip planning at https://github.com/tachyons/bmtc-api/pull/11

Vonter avatar Dec 29 '18 08:12 Vonter

is the endpoint available now for live tracking of bus? If so, can you please share with parameters as applicable.

klpradeepkl avatar Mar 10 '19 07:03 klpradeepkl

is the endpoint available now for live tracking of bus? If so, can you please share with parameters as applicable.

@klpradeepkl I'm not sure if this is the exact endpoint you are looking for, but you can get the live latitude and longitude of a bus like this:

curl -H 'Content-Type:application/x-www-form-urlencoded; charset=UTF-8' -H 'User-Agent:Dalvik/1.6.0 (Linux; U; Android 2.2.1; en-us; Nexus One Build/FRG83)' -H 'Host:bmtcmob.hostg.in' -H 'Accept-Encoding:gzip' -H 'Content-Length:69' -X POST 'https://bmtcmob.hostg.in/test/api/routemap/details' --data-binary 'routeNO=401&direction=UP&salt_value=abcdefghijklmnopqrstuvwxyz123456&'

You will have to modify the values of 'Content-Length:69', 'routeNO=401', 'direction=UP', 'salt_value=<32characteralphanumeric>'

The actual parameters that the API requires are only the routeNO, direction and a salt value.

The response will be similar to this:

 [                                                                                                                                                                            
        "vehicleno:KA01FA1777",                                                                                                                                                  
        "routeno:401",                                                                                                                                                           
        "vehiclelat:13.017557",                                                                                                                                                  
        "vehiclelng:77.555283",                                                                                                                                                  
        "routeid:35172",                                                                                                                                                         
        "serviceid:1",                                                                                                                                                           
        "nearestlatlng:13.01792884,77.55638747",                                                                                                                                 
        "start_busstopname:Yelahanka Old Town",                                                                                                                                  
        "end_busstopname:Yeshwanthapura TTMC",                                                                                                                                   
        "traveldistance:0.0",                                                                                                                                                    
        "ETA:0",                                                                                                                                                                 
        "FARE:0.0",                                                                                                                                                              
        "routeorder:37"                                                                                                                                                          
    ]        

Vonter avatar Mar 10 '19 11:03 Vonter

The endpoint you had mentioned is slightly incorrect. The correct one is https://bmtcmob.hostg.in/api/routemap/details. In the context of live tracking of vehicle, what is the difference between Vehiclelat, Vehiclelng & nearestlatlng.

klpradeepkl avatar Mar 13 '19 16:03 klpradeepkl

@klpradeepkl As far as I can tell, vehiclelat and vehiclelng are the current position of the bus. nearestlatlng is the coordinates of the nearest bus stop.

Vonter avatar Mar 14 '19 01:03 Vonter