redBus APIredbus.in ↗
Search buses and trains on redBus.in via API. Get seat layouts, schedules, boarding points, fares, and city/station suggestions across 7 endpoints.
What is the redBus API?
The redBus.in API covers 7 endpoints for querying bus and train services listed on redBus.in, returning operator details, seat-level availability, boarding/dropping points, and complete train schedules. The search_buses endpoint returns paginated inventories with fare lists, available seat counts, departure and arrival times per operator. The get_bus_seat_layout endpoint maps each seat by X/Y coordinates along with per-seat fares and availability status.
curl -X GET 'https://api.parse.bot/scraper/35a9b6fe-4009-43dd-89e2-993f11b60ad0/get_city_suggestions?limit=10&query=Mumbai' \ -H 'X-API-Key: $PARSE_API_KEY'
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 redbus-in-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: redBus API — search cities, buses, trains, get details and schedules."""
from parse_apis.redBus_Bus_and_Train_API import RedBus, NotFoundError
client = RedBus()
# Search cities to get IDs for bus search
for city in client.cities.search(query="Mumbai", limit=5):
print(city.name, city.location_name, city.region)
# Search buses between two cities on a future date
bus = client.bus_services.search(
from_city_id="462", to_city_id="130", doj="26-Jun-2026", limit=1
).first()
if bus:
print(bus.travels_name, bus.bus_type, bus.available_seats, bus.fare_list)
# Get detailed boarding/dropping points for this bus
detail = bus.details(doj="26-Jun-2026", from_city_id="462", to_city_id="130")
for bp in detail.boarding_points[:3]:
print(bp.name, bp.time, bp.address)
# Get seat layout for this bus
layout = bus.seat_layout(doj="26-Jun-2026")
for svc in layout.services[:1]:
print(svc.bus_type, svc.available_seats)
# Search trains between stations
for result in client.train_results.search(src="MMCT", dst="NDLS", doj="20260625", limit=3):
print(result.train_name, result.train_number, result.duration, result.distance)
# Construct a train by number and get its full schedule
try:
sched = client.train(train_no="22209").schedule()
print(sched.train_name, sched.source, sched.destination)
for stop in sched.stops[:3]:
print(stop.station_name, stop.station_code, stop.departure_time)
except NotFoundError as exc:
print(f"Not found: {exc}")
# Search trains by name
train = client.trains.search(query="Rajdhani", limit=1).first()
if train:
print(train.train_name, train.train_no, train.src_station_name)
print("exercised: cities.search / bus_services.search / bus.details / bus.seat_layout / train_results.search / train.schedule / trains.search")
Get city suggestions and IDs for bus search autocomplete. Returns matching cities with their IDs, location names, and boarding point lists. Use the returned city ID to feed into search_buses, get_bus_details, or get_bus_seat_layout endpoints.
| Param | Type | Description |
|---|---|---|
| limit | integer | Max results to return |
| queryrequired | string | Search query for city name (e.g. 'Mumbai', 'Pune', 'Bangalore') |
{
"type": "object",
"fields": {
"docs": "array of city objects with ID, Name, locationName, region, BpList",
"numFound": "integer - number of matching cities found"
},
"sample": {
"data": {
"docs": [
{
"ID": 462,
"cc": "IND",
"Name": "Mumbai",
"rank": 111266,
"BpList": [
{
"ID": 66545,
"Name": "Borivali East, Mumbai",
"locationName": "Borivali East"
}
],
"region": "Maharashtra and Goa",
"locationName": "Mumbai (All Locations)",
"locationType": "CITY"
}
],
"numFound": 1
},
"status": "success"
}
}About the redBus API
Bus Search and Route Data
Use get_city_suggestions with a query string to retrieve matching city objects, each carrying an ID, locationName, region, and a BpList of boarding points. Pass the returned ID values as from_city_id and to_city_id in search_buses, along with a doj (date of journey in DD-Mon-YYYY format). The response includes a metaData object with totalCount for pagination and an inventories array containing travelsName, busType, fareList, availableSeats, departureTime, and arrivalTime per service. Use offset and limit parameters to page through results.
Bus Details and Seat Layouts
get_bus_details accepts a route_id from the search response and returns two separate arrays: BPLt (boarding points) and DPLt (dropping points), each with Id, Address, BpTm, and name. It also returns services objects that include operator info, amenities, and cancellation policy. For seat-level data, get_bus_seat_layout takes the same route_id plus an operator_id and returns a seatlist where each entry has Id, IsAvailable, fares, and X/Y grid coordinates — enough to reconstruct the physical seat map. Boarding and dropping point details with LatLong coordinates are also included in BPInformationList and DPInformationList.
Train Search and Schedules
get_train_suggestions searches by train name or number and returns trainNo, trainName, srcStationCode, and destStationCode. Feed station codes into search_trains using src, dst, and a doj in YYYYMMDD format. Results come back in trainBtwnStnsList with departureTime, arrivalTime, duration, distance, avlClasses, and tbsAvailability. For a full stop-by-stop itinerary, get_train_schedule accepts a train_no and returns a Schedule array where each stop includes StationName, StationCode, ArrivalTime, DepartureTime, Day, and DistanceFromOrigin.
The redBus API is a managed, monitored endpoint for redbus.in — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when redbus.in 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 redbus.in 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.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Build a bus fare comparison tool using
fareListandavailableSeatsfromsearch_buses - Render an interactive seat-selection map using X/Y coordinates from
get_bus_seat_layout - Show boarding and dropping point locations on a map using
LatLongfromBPInformationList - Display a complete train route with all stops and timings using
get_train_schedule - Autocomplete city or station inputs in a travel app using
get_city_suggestionsorget_train_suggestions - Monitor seat availability across multiple bus operators for a given route and date
- Build a train class availability checker using
avlClassesandtbsAvailabilityfromsearch_trains
| 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 | 100 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.
Does redBus.in have an official public developer API?+
What does `get_bus_seat_layout` return beyond seat availability?+
seatlist array where each seat object includes Id, IsAvailable, per-seat fares, and X/Y grid coordinates. It also returns BPInformationList and DPInformationList with stop names, addresses, times, and LatLong values for boarding and dropping points.Does the API support booking or ticketing on redBus?+
How does pagination work in `search_buses`?+
limit and offset integer parameters. The metaData object in the response includes totalCount, which tells you how many total results exist for the route and date so you can calculate how many pages to fetch.Does the API return live PNR status or train running status?+
get_train_schedule. Live running status and PNR lookup are not included. You can fork the API on Parse and revise it to add those endpoints.