API Documentation

Bus History

Read the bus history from the database for a given bus. You may need to know the bus plate in order to determine the historical coordinate of the bus.

Endpoint description: Get list of latitude, longitude, speed and bearing for a given bus

Endpoint

https://dataapi.paj.com.my/api/v1/bus-history

Available Method

GET
/bus-history/{bus}/{date}
Get bus history data by a date
GET
/bus-history/{bus}/{date}/{timefrom}/{timeto}
Get bus history data by limiting between two specific time in a day

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)