API Documentation

Route GeoJson

GeoJSON is an open standard format designed for representing simple geographical features, along with their non-spatial attributes. PAJ use geojson as geographical to draw route, polygon and point coordinate with our system. 3rd party user can use this geojson data to retreive routes data use by BMJ.

Endpoint

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

Available Method

GET
/route-geojson
Get all geojson route data
GET
/route-geojson/{name}
Get particular geojson 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-geojson/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
name Name of the search route
geojson GeoJSON data of the route. You may need to parse this data into readable form of valid GeoJSON before you can use it to draw a polyline into your map plugin of choices