KTMB (Keretapi Tanah Melayu Berhad) Station Schedule Checker & Journey Planner in Web Form , written with PHP.
KTM recently has merged MyRailTime into KTMB Integrated Ticketing System (KITS) , all the old backend API has changed. A V2 with better web UI and useable API from KTMB Integrated Ticketing System (KITS) has been build.
- PHP 7.4 and above
- Redis and Redis PHP Extension installed (For Rate Limit purposes)
- A VPS / Computer / Server that have a stable Internet Connection and allowed to access KTMB Integrated Ticketing System (KITS)'s API Endpoint (online.ktmb.com.my:443)
- Nginx / Apache / Any web server with PHP configured install and running
- Download the source code and extract to the designated folder on ur web server root folder.
- Make sure Redis and Redis PHP Extension installed.
- Make sure PHP is preconfigured with your web server.
- Expose it to public and you are up and running!.
- KTMB Integrated Ticketing System (KITS)
KTMB Integrated Ticketing System (KITS) uses two types of CSRF Token to verify request :
- Via Cookie
- Via Hidden Input Value in Form Both of these two token must be present in Cookie & Submit Form way in order to get successful request
This project provide proxied MyRailTime - KTMB Integrated Ticketing System (KITS)'s API via PHP and return in JSON form.
stationScheduleData.php
- Retrieve specified KTM Station's schedule and timetable in JSON form
- Query String required :
station
- Specified KTM Station's Code
stationData.php
- Retrieve specified KTM Station's encrypted trips data & token in JSON form
- Query String required :
station
- Specified KTM Station's Code
tripData.php
-
Retrieve specified KTM Station's trips data via the token & data retrieved from
stationData.php
in JSON form -
Query String required :
-
Station
- Specified KTM Station's Code Returned fromstationData.php
-
TokenCookie
- Specified Token via Cookie retrieved fromstationData.php
-
TokenForm
- Specified Token via Hidden Input Value retrieved fromstationData.php
-
TripData
- Specified Trips Data retrieved fromstationData.php
Slow response , still no solution to solve it. Any PR that could enhance the user experience of this project are welcomed. Please create an issue if you experience any problem.
- KTMB