Upsrtcvlt APImargdarshi.upsrtcvlt.com ↗
Access UPSRTC bus routes, timetables, real-time arrivals, stop data, and bus-between-stops search via the Margdarshi passenger information system API.
What is the Upsrtcvlt API?
This API provides structured access to UPSRTC (Uttar Pradesh State Road Transport Corporation) bus data across 7 endpoints, covering the full network of routes, stops, timetables, and live arrival status. The get_buses_between_stops endpoint lets you query direct bus services between any two locations by origin and destination IDs, while get_realtime_arrivals returns running and cancelled trip data with deviation status for a given stop or route.
No input parameters required.
curl -X GET 'https://api.parse.bot/scraper/5c402f3d-5581-4190-93ad-2ec6c19c90c2/get_routes' \ -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 margdarshi-upsrtcvlt-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.
from parse_apis.upsrtc_margdarshi_bus_information_api import Margdarshi, ServiceType
client = Margdarshi()
# Search for stops to find origin and destination IDs
for result in client.stops.search(query="lucknow"):
print(result.name, result.id, result.classification)
# List available bus types
for bus_type in client.bustypes.list():
print(bus_type.name, bus_type.short_name, bus_type.speed_limit)
# Find buses between two cities with a service type filter
for bus in client.busservices.between_stops(
origin_id=8,
destination_id=5,
service_type=ServiceType.ORDINARY,
):
print(bus.from_stop_name, bus.to_stop_name, bus.from_arrival_time, bus.depot_name)
# List all routes and inspect timetable for the first one
for route in client.routes.list(limit=3):
print(route.id, route.description, route.line_name)
for trip in route.timetable.list(limit=2):
print(trip.trip_code, trip.service_type_name, trip.total_stops)
for stop_time in trip.stop_times:
print(stop_time.stop_area_name, stop_time.arrival_time, stop_time.departure_time)
Get all bus routes/lines operated by UPSRTC. Returns the complete catalog of routes with IDs, line names, descriptions, and directional information. Single-page response with all 8800+ routes.
No input parameters required.
{
"type": "object",
"fields": {
"total": "integer - total number of routes",
"routes": "array of route objects with id, line_name, marketing_name, description, outbound_description, inbound_description, direction, line_colour"
},
"sample": {
"data": {
"total": 8803,
"routes": [
{
"id": 1,
"direction": null,
"line_name": "1",
"description": "DHAMPUR-NOORPUR",
"line_colour": "rgb(0, 0, 0)",
"marketing_name": "1",
"inbound_description": "",
"outbound_description": "DHAMPUR TO NOORPUR"
}
]
},
"status": "success"
}
}About the Upsrtcvlt API
Route and Stop Discovery
The get_routes endpoint returns the complete UPSRTC route catalog, including each route's id, line_name, marketing_name, and directional descriptions (outbound_description, inbound_description). These route IDs feed directly into get_route_timetable, which returns all trips on that route with fields like vehicle_journey_id, trip_code, service_type_name, garage_name, and total_stop. The get_stops endpoint exposes the full stop network with geographic fields (easting, northing), stop_area_type, and administrative_area_code.
Searching and Filtering Services
Use search_stops with a text query (e.g., 'lucknow' or 'agra') to retrieve matching stop groups and stop areas, each with a classification of either GROUP or STOP_AREA. Pass those IDs and classifications directly to get_buses_between_stops as origin_id, destination_id, origin_classification, and destination_classification. That endpoint also accepts an optional date parameter (YYYY-MM-DD) and a service_type filter covering types like SHATABDI, VOLVO, AC SLEEPER, ORDINARY, and several others. Results include depot_name, route_origin, route_destination, and trip identifiers.
Bus Types and Real-Time Data
The get_bus_types endpoint lists all UPSRTC service classes — including JANRATH 2X3, JANRATH 2X2, PINK EXPRESS, RAJDHANI, and ENFORCEMENT — with speed_limit, primary_color, secondary_color, and Hindi translations for each. For live operations, get_realtime_arrivals accepts either a stop_code (from get_stops) or a route_id (from get_routes) and returns running_trips and cancelled_trips arrays alongside a deviation_status object that maps each bus registration_number to a flag indicating normal or deviated operation.
The Upsrtcvlt API is a managed, monitored endpoint for margdarshi.upsrtcvlt.com — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when margdarshi.upsrtcvlt.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 margdarshi.upsrtcvlt.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.
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 journey planner that queries
get_buses_between_stopsto show available direct UPSRTC services between two cities on a given date. - Display live bus arrival boards for a specific stop using
get_realtime_arrivalswith astop_code. - Generate full route timetables for a travel app by combining
get_routesandget_route_timetable. - Power an autocomplete stop-search field using
search_stopsto resolve user-typed city names to stop IDs. - Filter available buses by service class (e.g., VOLVO or AC SLEEPER) using the
service_typeparameter inget_buses_between_stops. - Map the UPSRTC stop network geographically using the
eastingandnorthingfields fromget_stops. - Track deviation and cancellation rates per route by aggregating
deviation_statusandtotal_cancelledfromget_realtime_arrivals.
| 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 UPSRTC or Margdarshi have an official public developer API?+
What does `get_realtime_arrivals` return, and how do I distinguish running from cancelled trips?+
running_trips and cancelled_trips arrays with counts total_running and total_cancelled. Each running trip includes a registration_number, route_description, and timing data. The deviation_status object maps each registration_number to 0 (on normal path) or 1 (deviated route). You can supply either a stop_code or a route_id — at least one is required.Does `get_buses_between_stops` return stop-by-stop intermediate timings for a trip?+
get_buses_between_stops returns trip-level fields like depot_name, service_type_name, route_origin, and route_destination, but not intermediate stop sequences or per-stop arrival times. Stop-by-stop timing data is available through get_route_timetable using the route's ID. You can fork this API on Parse and revise it to add an endpoint that joins trip results with full timetable detail.Is fare or ticket pricing data available through this API?+
What happens when I query `get_route_timetable` for a route with no trips?+
message field explaining that no trips exist for the route, along with the route_id that was queried and total_trips set to zero. The trips array will be empty. This can occur for routes that are defined in the system but have no currently scheduled services.