Discover/Megabus API
live

Megabus APImegabus.com

Search Megabus UK coach trips, compare fares, check seat availability, and retrieve stop lists and price calendars via a structured REST API.

Endpoint health
verified 6d ago
get_route_guides
get_cheapest_prices_calendar
search_trips
get_stops_list
get_trip_vacancy
5/5 passing latest checkself-healing
Endpoints
5
Updated
22d ago

What is the Megabus 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.

Try it
Number of passengers (1-9).
Origin Distribusion city code (e.g. GBLON for London, GBMAN for Manchester, GBEDIN for Edinburgh).
Destination Distribusion city code (e.g. GBLON for London, GBMAN for Manchester, GBEDIN for Edinburgh).
Departure date in YYYY-MM-DD format. Must be a current or future date.
api.parse.bot/scraper/7adc06ab-d9ba-4cbc-b019-293f47442dc3/<endpoint>
Ready to send
Fill in the parameters and hit sign in to send to see live response data here.
Call it over HTTPgrab a free API key at signup
curl -X GET 'https://api.parse.bot/scraper/7adc06ab-d9ba-4cbc-b019-293f47442dc3/search_trips?pax=1&origin=GBLON&destination=GBMAN&departure_date=2026-07-21' \
  -H 'X-API-Key: $PARSE_API_KEY'
Python SDK · recommended

Typed, relational, agent-ready

A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.

  • Fully typed · autocompletes
  • Objects link to objects
  • Typed errors & pagination

Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:

uv add parse-sdk
uv run parse init
uv run parse add --marketplace megabus-com-api

uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.

"""Walkthrough: Megabus UK SDK — search trips, check prices, list stops and routes."""
from parse_apis.megabus_uk_api import Megabus, FareClass, TripNotFound

megabus = Megabus()

# Search trips from London to Manchester, capped at 3 results
for trip in megabus.trips.search(origin="GBLON", destination="GBMAN", departure_date="2026-06-26", limit=3):
    print(trip.id, trip.departure_time, trip.cheapest_price_pence, trip.total_seats_left)
    for fare in trip.fares:
        print(f"  {fare.fare_class.name}: {fare.price_pence}p")

# Check cheapest prices across dates for a route
calendar = megabus.pricecalendars.check(
    origin="GBLON",
    destination="GBMAN",
    departure_dates='["2026-06-26","2026-06-27"]',
)
print(calendar.prices)

# Check vacancy for a specific connection using the FareClass enum
try:
    vacancy = megabus.vacancies.check(
        carrier_code="NEXP",
        departure_station="GBLONVSA",
        arrival_station="GBMANCBS",
        departure_date="2026-06-26",
        departure_time="02:00",
        arrival_date="2026-06-26",
        arrival_time="07:35",
        fare_class=FareClass.STANDARD,
    )
    print(vacancy.id, vacancy.vacant, vacancy.total_price, vacancy.currency)
except TripNotFound as exc:
    print(f"Trip not found: {exc}")

# List first 5 stops
for stop in megabus.stops.list(limit=5):
    print(stop.name, stop.code, stop.latitude, stop.longitude)

# List first 3 route guides
for guide in megabus.routeguides.list(limit=3):
    print(guide.title, guide.services, guide.timetable_url)

print("exercised: trips.search / pricecalendars.check / vacancies.check / stops.list / routeguides.list")
All endpoints · 5 totalmissing one? ·

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). Each trip includes fares with fare class details and carrier name.

Input
ParamTypeDescription
paxintegerNumber of passengers (1-9).
originrequiredstringOrigin Distribusion city code (e.g. GBLON for London, GBMAN for Manchester, GBEDIN for Edinburgh).
destinationrequiredstringDestination Distribusion city code (e.g. GBLON for London, GBMAN for Manchester, GBEDIN for Edinburgh).
departure_daterequiredstringDeparture date in YYYY-MM-DD format. Must be a current or future date.
Response
{
  "type": "object",
  "fields": {
    "trips": "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": {
      "trips": [
        {
          "id": "NEXP-GBLONVSA-GBMANAIR-2026-06-20T02:00-2026-06-20T07:15",
          "fares": [
            {
              "id": "NEXP-GBLONVSA-GBMANAIR-2026-06-20T02:00-2026-06-20T07:15-FARE-2",
              "fare_class": {
                "code": "FARE-2",
                "name": "Restricted Fare",
                "journey_type": "single",
                "iata_category": null
              },
              "price_pence": 2390
            }
          ],
          "booked_out": false,
          "arrival_time": "2026-06-20T07:15",
          "carrier_name": "National Express",
          "departure_time": "2026-06-20T02:00",
          "duration_seconds": 18900,
          "total_seats_left": 22,
          "cheapest_price_pence": 2390
        }
      ]
    },
    "status": "success"
  }
}

About the Megabus API

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.

Reliability & maintenanceVerified

The Megabus API is a managed, monitored endpoint for megabus.com — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when megabus.com changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.

This isn't an official megabus.com API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.

Last verified
6d ago
Latest check
5/5 endpoints passing
Maintenance
Monitored & self-healing
Will this API break when the source site changes?+
It's built not to. Every endpoint is health-checked on a schedule with automated test probes. When the source site changes and a check fails, the API is automatically queued for repair and re-verified — that's the self-healing layer. Each API page shows when its endpoints were last verified. And because marketplace APIs are shared, any fix reaches everyone using it.
Is this an official API from the source site?+
No — Parse APIs are independent, managed REST wrappers over publicly available data. That is the point: where a site has no official API (or only a limited one), Parse gives you a maintained, monitored endpoint for that data and keeps it working as the site changes — so you get a stable contract over a source that never promised one.
Can I fix or extend this API myself if I need a new endpoint or field?+
Yes — and you don't have to wait on us. This API was generated by the Parse agent, which stays attached. Describe the change in plain English ("add an endpoint that returns reviews", "fix the price field") in the revise box on the API page or via the revise_api MCP tool, and the agent rebuilds it against the live site in minutes. Contributing the change back to the public API is free.
What happens if I call an endpoint that has an issue?+
Errors are machine-readable: a bad call returns a clean status with the list of available endpoints and a repair hint, so an agent (or you) can recover or trigger a fix instead of failing silently. Confirmed failures feed the automatic repair queue.
Common use cases
  • 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
Pricing & limitsSee full pricing →
TierPriceCredits/monthRate limit
Free$0/mo1005 req/min
Hobby$30/mo1,00020 req/min
Developer$100/mo5,000100 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.

Frequently asked questions
Does Megabus have an official public developer API?+
Megabus does not publish a documented public developer API. Their booking system runs on the Distribusion platform, but no official API is offered to third-party developers directly.
What is the difference between the city codes used in search_trips and the station codes used in get_trip_vacancy?+
search_trips uses Distribusion city-level codes like GBLON or GBMAN, which represent broader city areas. get_trip_vacancy uses station-level codes like GBLONVSA (London Victoria) or GBMANCBS (Manchester Coach Station). The stop codes returned by get_stops_list correspond to the station-level codes for vacancy checks, not to the city codes for trip search.
Does the API cover return journeys or multi-leg itineraries?+
Not currently. The API covers single-leg outbound trip search, price calendars, vacancy checks, and stop/route metadata. You can fork it on Parse and revise to add a return-journey search endpoint that calls search_trips with origin and destination swapped for a return date.
What happens when get_cheapest_prices_calendar has no service on a requested date?+
Dates without available trips are omitted from the response entirely. The returned object only contains keys for dates where service exists, each mapping to a price object with fractional (in pence) and currency fields.
Does the API cover Megabus routes outside the UK, such as US or European services?+
Not currently. The API is scoped to Megabus UK routes and uses UK Distribusion city codes (GB-prefixed). You can fork it on Parse and revise to add endpoints targeting other regional Megabus markets.
Page content last updated . Spec covers 5 endpoints from megabus.com.
Related APIs in TravelSee all →
thetrainline.com API
Search UK train stations and find the cheapest fares across date ranges, then generate direct booking links to complete your purchase on Trainline.com. Get real-time journey information to compare prices and book your tickets in seconds.
redbus.in API
Search and explore bus and train services on redBus.in. Look up city and station suggestions, find available routes, check schedules, and view seat layouts and fare details.
omio.com API
Search and compare train, bus, and flight trips across multiple providers in real-time, with detailed pricing breakdowns and the ability to view fares across different dates. Find the best deals by exploring popular destinations, autocompleting location searches, and analyzing price variations to plan your ideal journey.
amtrak.com API
Search for Amtrak trains across stations, compare fares, and discover discounts to plan your rail journey with current pricing and availability. Get detailed train information, autocomplete station names, and find the cheapest routes for your travel dates.
skyscanner.com API
Search for flights and compare prices across multiple booking agents, while exploring airports and cities to plan your trip. View daily and monthly price calendars to find the best deals for your travel dates.
makemytrip.com API
Search for airports and compare the cheapest flight fares between any two cities across multiple dates with MakeMyTrip's fare calendar to find your best deal. Quickly identify the most affordable travel options and plan your trip with real-time pricing information.
margdarshi.upsrtcvlt.com API
Find UPSRTC bus routes, schedules, and real-time arrival information across Uttar Pradesh. Search for specific stops, discover which buses operate between two locations, and plan journeys with detailed timetables, bus types, and comprehensive stop data from the Margdarshi passenger information system.
us.trip.com API
Search for flights across Trip.com and view a low-price calendar to find the cheapest travel dates for your destination. Compare flight options and prices to book your next trip at the best rates available.