Realtime APIs
Transport API (GTFS)

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 returned

Prasarana

GET https://api.data.gov.my/gtfs-static/prasarana?category=<category>
# ZIP file is returned
  • The possible <category> values are rapid-bus-penang, rapid-bus-kuantan, rapid-bus-mrtfeeder, rapid-rail-kl and rapid-bus-kl.
  • Note: A small number of trips (~2%, fully specified in this CSV (opens in a new tab)) for the rapid-bus-kl endpoint have been removed from the stop_times.txt file 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 returned

BAS.MY Alor Setar

GET https://api.data.gov.my/gtfs-static/mybas-alor-setar
# ZIP file is returned

BAS.MY Kota Bharu

GET https://api.data.gov.my/gtfs-static/mybas-kota-bharu
# ZIP file is returned

BAS.MY Kuala Terengganu

GET https://api.data.gov.my/gtfs-static/mybas-kuala-terengganu
# ZIP file is returned

BAS.MY Melaka

GET https://api.data.gov.my/gtfs-static/mybas-melaka
# ZIP file is returned

BAS.MY Johor Bahru

GET https://api.data.gov.my/gtfs-static/mybas-johor
# ZIP file is returned

BAS.MY Kuching

GET https://api.data.gov.my/gtfs-static/mybas-kuching
# ZIP file is returned

Understanding 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 TypeDescription
agency.txtInformation about transit agencies
stops.txtInformation about transit stops
routes.txtDetails about transit routes
trips.txtSpecific trips with associated route information
stop_times.txtTimetables and stop details for trips
calendar.txtService 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).