API Documentation

Bus Route

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
/route
Get all bus line related data
GET
/route/code/{code}
Get bus line data by route code
GET
/route/operator/{operator_id}
Get bus line data by vendor id

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
name The route number for the particular bus 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
distance The total distance of the bus route in Kilometer. This value is predetermined during the insertion of the bus line.
special_route This is a special tag if the bus line considered as special route. Special route 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)
active Indicator whether the route is currently be use PAJ