GTFS Static API Endpoint
GET https://api.data.gov.my/gtfs-static/<agency>What does GTFS Static do?
The GTFS Static API provides access to standardized public transportation schedules and geographic information, following the General Transit Feed Specification (GTFS). To learn more about GTFS and its specifications, you can visit the GTFS documentation (opens in a new tab) provided by Google.
Source of GTFS Static Data
The GTFS Static API incorporates data from various transport operators across Malaysia. We currently feature static feeds from the following:
- KTMB (Keretapi Tanah Melayu Berhad) (opens in a new tab): A railway operator providing train services across the country.
- Prasarana (opens in a new tab): A public transport operator responsible for managing various modes of transportation, including LRT (Light Rail Transit), MRT (Mass Rapid Transit), monorail, and bus services.
- BAS.MY (opens in a new tab): Stage bus services across Malaysia, run by various operators. Endpoints for Johor Bahru, Kangar, Alor Setar, Kuala Terengganu, Kota Bharu, and Kuching are currently available. We plan to expand the feed to cover Melaka, Seremban, and Ipoh by 15 November 2025.
Frequency of Data Update
- GTFS for KTMB: Daily at 00:01:00.
- GTFS for Prasarana: As required.
- GTFS for all BAS.MY services: As required.
If you are scheduling a cron job, we recommend refreshing the static data at least once per day at 4am, i.e. right before rail and bus services nationwide begin their daily operations.
Request Query & Response Format
The GTFS Static API provides access to public transportation data represented as a GTFS Feed, which consists of a collection of text files packaged in a ZIP file. You can access these data files through the following endpoints:
KTMB
GET https://api.data.gov.my/gtfs-static/ktmb
# ZIP file is returnedPrasarana
GET https://api.data.gov.my/gtfs-static/prasarana?category=<category>
# ZIP file is returned- The possible
<category>values arerapid-bus-penang,rapid-bus-kuantan,rapid-bus-mrtfeeder,rapid-rail-klandrapid-bus-kl. - Note: A small number of trips (~2%, fully specified in this CSV (opens in a new tab))
for the
rapid-bus-klendpoint have been removed from thestop_times.txtfile due to operational issues which affect data accuracy. We are actively working to resolve and restore them to our GTFS feed.
BAS.MY Kangar
GET https://api.data.gov.my/gtfs-static/mybas-kangar
# ZIP file is returnedBAS.MY Alor Setar
GET https://api.data.gov.my/gtfs-static/mybas-alor-setar
# ZIP file is returnedBAS.MY Kota Bharu
GET https://api.data.gov.my/gtfs-static/mybas-kota-bharu
# ZIP file is returnedBAS.MY Kuala Terengganu
GET https://api.data.gov.my/gtfs-static/mybas-kuala-terengganu
# ZIP file is returnedBAS.MY Melaka
GET https://api.data.gov.my/gtfs-static/mybas-melaka
# ZIP file is returnedBAS.MY Johor Bahru
GET https://api.data.gov.my/gtfs-static/mybas-johor
# ZIP file is returnedBAS.MY Kuching
GET https://api.data.gov.my/gtfs-static/mybas-kuching
# ZIP file is returnedUnderstanding the data
Upon extracting the ZIP files obtained from the API endpoints, you will find various text files. Here are the essential text files provided by all agencies:
| GTFS Type | Description |
|---|---|
agency.txt | Information about transit agencies |
stops.txt | Information about transit stops |
routes.txt | Details about transit routes |
trips.txt | Specific trips with associated route information |
stop_times.txt | Timetables and stop details for trips |
calendar.txt | Service availability for specific dates |
Other optional files, such as frequencies.txt and shapes.txt, are provided if available.
For more details, refer to the GTFS Schedule Reference (opens in a new tab).