API Documentation

Bus Live Data

This API is use to get the info for each bus lines including the bus line code, total distance, total trip and etc.

Endpoint description: Get list of bus line(s) filter by bus_vendor_id or name

Endpoint

https://dataapi.paj.com.my/api/v1/route

Available Method

GET
/bus-live
Get all live bus data
GET
bus-live/bus/{bus}
Get particular live bus data with requested bus plate. Eg: JTV6100, JJU2633
GET
/bus-live/operator/{operator}
Get all live bus data by operator name. Need to be in all capatilize word. Eg: MAYANG SARI, HANDAL INDAH
GET
/bus-live/route/{route}
Get all live bus data by route name. Eg: BP001, P101

Example

Send any data using any language you desired, below is just example of request and respond. You may use different language based on your needs.
                                                            
                                                                fetch('https://dataapi.paj.com.my/api/v1/route/code/P101', {
	method: 'GET',
	headers: {'api-key': 'YOUR_API_KEY'}
})
.then(res => res.json())
.then(console.log)
                                                            
                                                        
                                                            
                                                                {
    "status": "success",
    "timestamps": "2022-08-19 17:24:00",
    "data": [
        {
            "id": 42,
            "bus_vendor_id": 1,
            "code": "P101",
            "distance": 21.5,
            "km_price": 3.83,
            "schedule_status": 1,
            "special_line": 0,
            "total_trip": 33,
            "description": "P101"
        }
    ]
}
                                                            
                                                        

Response

The explanation of each response was explain in table below
Name Description
id Id for each route
bus_vendor_id The id for the particular bus vendor/operator. This data is correlate with the bus vendor data. You can check all bus operator data here
code The route number for the particular bus route
distance The total distance of the bus route in Kilometer. This value is predetermined during the insertion of the bus line.
km_price The price that need to be paid to the vendor in Ringgit Malaysia per each kilometer
special_line This is a special tag if the bus line considered as special line. Special line is when a particular route has a deviation from normal route at certain particular time. For normal user, you may not have any use for this option.
total_trip A total of trip of that route in a day (may not accurate if route is a special route)