megabus.com APImegabus.com ↗
Search Megabus UK coach trips, compare fares, check seat availability, and retrieve stop lists and price calendars via a structured REST API.
curl -X GET 'https://api.parse.bot/scraper/7adc06ab-d9ba-4cbc-b019-293f47442dc3/search_trips?pax=1&origin=GBLON&destination=GBMAN&departure_date=2026-05-01' \ -H 'X-API-Key: $PARSE_API_KEY'
Search for available coach trips between two cities on a specific date. Returns detailed trip info including times, duration, prices, and seat availability. Uses Distribusion city codes (e.g. GBLON, GBMAN) which differ from the numeric stop codes returned by get_stops_list.
| Param | Type | Description |
|---|---|---|
| pax | integer | Number of passengers. |
| originrequired | string | Origin Distribusion city code (e.g. GBLON for London, GBMAN for Manchester, GBEDIN for Edinburgh). These are NOT the numeric codes from get_stops_list. |
| destinationrequired | string | Destination Distribusion city code (e.g. GBLON for London, GBMAN for Manchester, GBEDIN for Edinburgh). These are NOT the numeric codes from get_stops_list. |
| departure_daterequired | string | Departure date in YYYY-MM-DD format. Must be a current or future date. |
{
"type": "object",
"fields": {
"data": "array of trip objects with id, departure_time, arrival_time, duration_seconds, total_seats_left, booked_out, cheapest_price_pence, fares, and carrier_name"
},
"sample": {
"data": [
{
"id": "NEXP-GBLONGGE-GBMANAIR-2026-05-01T04:10-2026-05-01T12:10",
"fares": [
{
"id": "NEXP-GBLONGGE-GBMANAIR-2026-05-01T04:10-2026-05-01T12:10-FARE-1",
"fare_class": {
"code": "FARE-1",
"name": "Standard Fare",
"journey_type": "single",
"iata_category": null
},
"price_pence": 3510
}
],
"booked_out": false,
"arrival_time": "2026-05-01T12:10",
"departure_time": "2026-05-01T04:10",
"duration_seconds": 28800,
"total_seats_left": 22,
"cheapest_price_pence": 3510
}
],
"status": "success"
}
}About the megabus.com API
The Megabus UK API covers 5 endpoints for querying coach trips, stop data, route guides, fare calendars, and seat vacancy across the Megabus UK network. The search_trips endpoint returns trip-level detail including departure and arrival times, duration in seconds, seats remaining, and cheapest price in pence — all keyed by Distribusion city codes such as GBLON and GBMAN.
Trip Search and Fare Data
The search_trips endpoint accepts an origin and destination as Distribusion city codes (e.g. GBLON for London, GBEDIN for Edinburgh), a departure_date in YYYY-MM-DD format, and an optional pax count. It returns an array of trip objects, each carrying departure_time, arrival_time, duration_seconds, total_seats_left, a booked_out flag, and cheapest_price_pence. This is the primary endpoint for building trip search or fare comparison tools.
Price Calendars and Vacancy Checks
get_cheapest_prices_calendar accepts the same origin/destination city codes and a JSON array of dates, returning only dates that have service — dates with no trips are omitted entirely. Each returned date maps to a price object with fractional (price in pence) and currency. For deeper fare inspection, get_trip_vacancy checks a specific connection by departure and arrival station codes (e.g. GBLONVSA, GBMANCBS), date, time, and carrier code. It returns a vacancy response including vacant, total_price, and original_price attributes, and optionally filters by fare class (FARE-1 Standard, FARE-2 Restricted, FARE-3 Fully Flexible).
Stops and Route Guides
get_stops_list returns the full catalogue of UK Megabus stops with name, friendlyName, code, longitude, latitude, information, stopGroupExtFlag, and ssrs fields. Note that these numeric stop codes are distinct from the Distribusion city codes used in trip search — they apply specifically to the get_trip_vacancy station parameters. get_route_guides returns all published route guides, including title, services, departures, destinations, timetableUrl, and seasonal timetableTabs data, making it useful for building timetable browsers or route discovery features.
- Build a coach fare comparison tool using cheapest_price_pence from search_trips across multiple routes
- Display a monthly price calendar for a London–Edinburgh route using get_cheapest_prices_calendar
- Check real-time seat availability and fare class pricing for a specific departure via get_trip_vacancy
- Render an interactive stop map using latitude/longitude coordinates from get_stops_list
- Generate a timetable directory from route guides including service numbers and timetableUrl links
- Alert users when low-cost seats appear on a route by polling search_trips for total_seats_left
- Cross-reference Distribusion station codes with stop metadata before submitting a vacancy query
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 250 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.