3. Vehicles

Returns parent ID and registration number of vehicles which match the vehicle number passed in the argument. Ex: 0007 returns KA53F0007 and KA57F0007.

Sample request

curl 'https://bmtcmobileapi.karnataka.gov.in/WebAPI/ListVehicles' \
  -H 'Content-Type: application/json' \
  -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36' \
  --data-raw '{"vehicleRegNo":"0007"}'

Sample response

{
    "data": [
        {
            "vehicleid": 19100,
            "vehicleregno": "KA53F0007",
            "responsecode": 200
        },
        {
            "vehicleid": 18830,
            "vehicleregno": "KA57F0007",
            "responsecode": 200
        }
    ],
    "Message": "Success",
    "Issuccess": true,
    "exception": null,
    "RowCount": 2,
    "responsecode": 200
}

Functions


source

fetch_vehicles

 fetch_vehicles (pattern:str='', sleep_duration:float=0.1)

Fetch vehicles matching the given registration number pattern from BMTC API.


source

process_vehicles

 process_vehicles (vehicles)

Process and clean vehicle data, returning a DataFrame with vehicle_id and registration_number.


source

task_fetch_vehicles

 task_fetch_vehicles (data_directory:pathlib.Path)

source

get_vehicles

 get_vehicles (data_directory:pathlib.Path)