API Documentation

Route Schedule

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-schedule

Available Method

GET
/route-schedule
Get all trip data of all BMJ route
GET
/route-schedule/{route}
Get a trip data of a BMJ route by route name

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-schedule/BP001', {
	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
route Name of the route
trip The trip data for the route by day of the week and its schedule
dayofweek The day of the week for the route. Can be from sunday to saturday
schedule The general start trip data the bus need to depart from the designation waiting station