Malaysia Transit Logo

Malaysia Transit API

Developer Portal

API Docs

Real-time Transit Data for Malaysia

Access live bus locations, schedules, and route information across multiple transit providers in Malaysia. One API, complete coverage.

Real-time Vehicle Tracking

Live GPS positions updated every 30 seconds

Complete Schedule Data

Timetables for all routes and stops

Multi-Provider Coverage

Rapid KL, BAS.MY, Rapid Penang, and more

Only RM99/month

  • Unlimited API calls (subject to )
  • Full access to all endpoints

All subscription charges are in Malaysian Ringgit (RM). Currency conversions are estimates only.

Get Started

Sign in to access your API dashboard

By signing in, you agree to the Terms of Service

Frequently Asked Questions

Why do I need to pay when GTFS data from data.gov.my is free?

While the raw GTFS data is publicly available and free to access, parsing that data and hosting the infrastructure to serve it is not.

I handle all the complexity so you don't have to:

  • Process real-time feeds
  • Calculate arrival predictions
  • Aggregate multiple providers
  • Maintain reliable servers

Plus, features the raw GTFS feeds don't include:

  • Shape-based ETA predictions (40-60% more accurate) with time-of-day adjustments and confidence scoring
  • Fare calculator for BAS.MY (distance-based), Rapid Penang (staged), KTM Komuter Utara (matrix), and Penang Ferry, plus multi-leg journey fares
  • Multi-modal journey planner combining bus, rail, ferry, and walking with route polylines and shareable plans
  • Non-GTFS providers integrated: Bas Muafakat Johor (41 PAJ-tracked routes) and Penang Ferry schedules
  • Clean REST/JSON instead of protobuf zips. CORS-friendly, works from any language or browser
  • Smart geocoding and nearby-stop search (e.g. "Penang Airport" resolves to live arrivals at the nearest stop)
  • GitHub backup fallback when upstream data.gov.my has hiccups

Your subscription helps cover my server cost, maintenance, and continuous development of this middleware.

What transit providers are covered?

I cover 13 service areas across Malaysia: Klang Valley, Penang, Ipoh, Seremban, Melaka, Johor Bahru, Kuching, Kota Bharu, Kuala Terengganu, Alor Setar, and Kangar (11 live), plus Kuantan (maintenance) and Kota Kinabalu (coming soon).

Providers include:

  • Rapid KL (LRT, MRT, Monorail, bus, MRT feeder bus)
  • Rapid Penang
  • All BAS.MY operators (state-funded bus services)
  • KTM Komuter Utara and KTM Intercity
  • Bas Muafakat Johor (BMJ)
  • Penang Ferry (Butterworth ↔ Georgetown)

What happens if I cancel my subscription?

Your API key will be automatically invalidated when your subscription ends. You can resubscribe at any time to get a new API key and resume access.

Is there a rate limit?

No rate limits from my end! Your subscription includes unlimited API calls and I trust you to use the API responsibly. However, the upstream GTFS data is subject to rate limits by data.gov.my. .

How do I use the API key?

Include your API key in the X-API-Key header with every request. Example: X-API-Key: mtk_pub_your_key. After subscribing you can mint two keys from the dashboard: a public one (mtk_pub_*) for browsers and a secret one (mtk_sec_*) for server-side use.

Can I safely use the API key in a browser or SPA?

Yes. Every subscriber gets a Stripe-style key pair from the dashboard:

  • Public key (mtk_pub_*) for browser/SPA use. Pair it with an Allowed Origins allowlist so a key scraped from your bundle is useless on any other site.
  • Secret key (mtk_sec_*) for server-side integrations: ChatGPT custom GPTs, Zapier, n8n, your backend. Keep it off the wire to browsers.
  • Legacy mtk_live_* keys still work and auto-classify based on whether allowed origins are set.

Origin patterns support exact hosts (https://app.com), single-label wildcards (https://*.app.com), and Netlify preview wildcards (https://*--myapp.netlify.app). The dashboard surfaces a lifetime + last-7-days reject counter so you can spot key leaks.

Honest framing: origin restriction stops browser-scraped key reuse, not header-forging scripted clients. For full theft protection, keep keys out of public bundles and proxy through a backend.

Who manages this developer dashboard?

I'm Aliff, and I develop and maintain this Malaysia Transit Middleware and its API under TechMavie Digital. Learn more about what I do on TechMavie Digital by .

API at a Glance

A quick reference of the public REST endpoints. Sign in to your dashboard after subscribing for worked curl examples and live usage stats.

Base URL

https://malaysiatransit.techmavie.digital/api

Most endpoints accept an ?area= query parameter to scope the request to a service area.

Authentication

X-API-Key: mtk_live_your_key

Send your key in the X-API-Key header on every request. Keys are generated on the dashboard after subscribing.

Areas & Status

  • GET /areas — list all service areas
  • GET /areas/:areaId — service area details
  • GET /areas/:areaId/providers/status — per-provider health

Real-time Tracking

  • GET /realtime?area= — live vehicle positions
  • GET /stops/:stopId/arrivals?area= — arrivals at a stop
  • GET /stops/nearby/arrivals?lat=&lng=&area= — nearby stops with arrivals
  • GET /stops/nearby/routes?lat=&lng=&area= — nearby stops with routes

Routes & Stops

  • GET /routes?area= — list routes
  • GET /routes/:routeId?area= — route details
  • GET /routes/:routeId/geometry?area= — route shape
  • GET /stops/search?area=&q= — search for stops
  • GET /stops/:stopId?area= — stop details

Schedules

  • GET /schedules/routes/:routeId/departures?area= — departures from origin
  • GET /schedules/routes/:routeId/next?area= — next departure
  • GET /schedules/stops/:stopId/routes?area= — routes serving a stop
  • GET /schedules/routes/:routeId/full?area= — full weekly timetable

KTM (Komuter & Intercity)

  • GET /ktm/stations — list KTM stations
  • GET /ktm/stations/:name/departures — station departures
  • GET /ktm/schedules — full KTM timetable
  • GET /ktm/komuter/fare?from=&to= — Komuter fare lookup
  • GET /ktm/komuter/fare-matrix — full Komuter fare matrix
  • GET /ktm/intercity/fare?from=&to= — Intercity fare lookup

Penang Ferry

  • GET /ferry/penang — service overview
  • GET /ferry/penang/schedule — daily schedule
  • GET /ferry/penang/next?from= — next departure
  • GET /ferry/penang/terminals — terminal info
  • GET /ferry/penang/fare — fare table

Fares & Journey Planning

  • GET /fare/structures — fare model per area (staged vs. distance)
  • GET /fare/:area/routes — fare-eligible routes
  • GET /fare/:area/calculate — single-leg fare
  • GET /fare/:area/calculate-journey — multi-leg fare
  • GET /journey/areas — areas supported by the planner
  • POST /journey/plan — plan a multi-modal journey

Service Area IDs

Use these IDs in the ?area= query parameter.

klang-valleypenangipohserembanmelakajohorkuchingkota-bharukuala-terengganualor-setarkangarkuantan*kota-kinabalu**

* Under maintenance (pending Rapid Kuantan → BAS.MY transition).  ** Coming soon.

Not Ready to Subscribe Yet?

No worries! You can explore the Malaysia Transit ecosystem first before committing. Try out the live middleware site or connect via MCP server to see how this API snaps into action. Completely free, no hidden paywalls. I promise✋🏻

Scroll up to sign in and get your API key

Note: The Malaysia Transit Live Middleware and other whitelisted TechMavie Digital-associated applications have built-in access to the API. If you're building your own application, you'll need to subscribe to get your own API key.