onlineupsrtc APIonlineupsrtc.co.in ↗
Search UPSRTC bus stations, schedules, fares, seat availability, and stop-by-stop timetables for Uttar Pradesh routes via a simple REST API.
What is the onlineupsrtc API?
The onlineupsrtc.co.in API exposes 3 endpoints covering UPSRTC bus station lookup, route schedules, and trip stop sequences for Uttar Pradesh State Road Transport Corporation services. search_bus_schedules returns departure and arrival times, bus type, fare, and seat availability for any origin-to-destination pair on a given travel date. Station codes from search_stations feed directly into schedule queries, and get_trip_stops resolves the full stop-by-stop timetable for any individual trip.
curl -X GET 'https://api.parse.bot/scraper/55afb3ad-9c87-4eb4-b7d0-c2729c5d9d6c/search_stations?query=luck' \ -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 onlineupsrtc-co-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: UPSRTC bus schedules — search stations, find trips, view stops."""
from parse_apis.onlineupsrtc_co_in_api import Upsrtc, BusTypeFilter, StationNotFound
client = Upsrtc()
# Find stations whose name starts with "LUCK".
for station in client.stations.search(query="LUCK", limit=5):
print(station.station_name, station.station_code)
# Search AC bus trips from LUCKNOW to KANPUR for tomorrow.
try:
trip = client.trips.search(
origin="LUCKNOW",
destination="KANPUR",
bus_type=BusTypeFilter.AC,
limit=3,
).first()
except StationNotFound:
print("Origin or destination station not recognised")
trip = None
if trip is not None:
print(trip.trip_number, trip.bus_type, trip.departure_time, trip.fare, trip.currency)
print(f"{trip.available_seats}/{trip.total_seats} seats, {trip.distance_km} km")
# Drill into stop-by-stop timetable for that trip.
for stop in trip.stops.list(limit=5):
print(stop.sequence, stop.station_name, stop.departure_time, stop.arrival_time)
print("exercised: stations.search / trips.search / trip.stops.list")
Look up UPSRTC bus stations whose name starts with the given text (case-insensitive prefix match, the same matching the site's From/To autocomplete uses). Returns one row per station with its station_code, which is the identifier accepted by search_bus_schedules as origin/destination. The full station catalogue (about 14,500 stations) is fetched in one round trip and filtered locally; results are sorted by name and capped at 200 rows, with total_matches reporting the uncapped count. A prefix that matches nothing returns an empty stations array. City-level aggregate stations (e.g. one shape is a station named after a city with a 9xxxxx code and no district) group all bus stands in that city.
| Param | Type | Description |
|---|---|---|
| queryrequired | string | Station name prefix to match, e.g. the first letters of a city or bus-stand name. |
{
"type": "object",
"fields": {
"query": "the prefix that was searched",
"stations": "array of matching stations: station_code (string id used by search_bus_schedules), station_name, district (string or null), abbreviation (string or null)",
"total_matches": "integer count of matching stations before the 200-row cap"
},
"sample": {
"data": {
"query": "luck",
"stations": [
{
"district": null,
"abbreviation": null,
"station_code": "900001",
"station_name": "LUCKNOW"
},
{
"district": null,
"abbreviation": "LUCKYAKHEDA",
"station_code": "9153",
"station_name": "LUCKYAKHEDA"
}
],
"total_matches": 2
},
"status": "success"
}
}About the onlineupsrtc API
Station Lookup
The search_stations endpoint accepts a query string and returns all UPSRTC stations whose names begin with that prefix, up to a cap of 200 rows. Each result includes a station_code, station_name, district (nullable), and abbrev. The station_code is the canonical identifier used by the other two endpoints — always resolve station names here before querying schedules.
Schedule Search
search_bus_schedules takes origin and destination as either station codes or exact station names, an optional ISO date (defaults to today in Asia/Kolkata), and an optional bus_type filter (AC or NONAC). Each trip in the trips array carries a schedule_id, trip_number, route_code, route_name, ISO local departure_time and arrival_time, bus type label (e.g. AC JANRATH 2X2), fare, and seat availability count. The response also echoes resolved origin and destination objects and a bus_type_filter field confirming what filter was applied.
Trip Stop Timetable
get_trip_stops accepts a schedule_id from the schedule search and returns an ordered stops array. Each stop has a 1-based sequence, station_code, station_name, district, and arrival_time / departure_time in HH:MM:SS local clock format. The first stop has no arrival_time and the last has no departure_time. Times that roll past midnight are represented without a date bump, so consumers should track sequence order rather than relying on purely numeric time comparison across midnight.
Coverage and Scope
All data reflects UPSRTC scheduled services accessible via onlineupsrtc.co.in. Coverage is limited to routes operated by UPSRTC within and from Uttar Pradesh; inter-state carriers or private operators listed on other portals are not included. The total_matches field in station search and total_trips in schedule search give exact counts so callers can detect when a result set has been capped.
The onlineupsrtc API is a managed, monitored endpoint for onlineupsrtc.co.in — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when onlineupsrtc.co.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 onlineupsrtc.co.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?+
- Display live seat availability and fares for UPSRTC routes between two UP cities on a travel app
- Build an autocomplete station picker using the prefix-search
queryparam ofsearch_stations - Compare AC vs non-AC bus options on a route by calling
search_bus_scheduleswithbus_typefilter variants - Reconstruct a full journey timeline for a booked trip using
get_trip_stopsstop sequences and HH:MM:SS times - Alert travelers to the first bus of the day on a route by sorting
tripsbydeparture_time - Populate a route map with all intermediate stops and their scheduled times from
get_trip_stops - Aggregate fare data across multiple travel dates to analyze UPSRTC pricing patterns by route
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 200 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
| Team | $300/mo | 20,000 | 300 req/min |
| Company | $1,000/mo | 100,000 | 500 req/min |
Each endpoint has a fixed posted price per successful call — most fall between 1 and 10 credits — shown on this API's page before you run it. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does onlineupsrtc.co.in provide an official developer API?+
What does `search_bus_schedules` return beyond departure and arrival times?+
schedule_id, trip_number, route_code, route_name, origin_station, destination_station, departure_time and arrival_time as ISO local timestamps, a bus type label, fare, and seat availability count. The response also returns a resolved origin and destination object and the bus_type_filter that was applied (ALL, AC, or NONAC).How do midnight-crossing trips work in `get_trip_stops`?+
HH:MM:SS clock strings without a date component. When a trip runs past midnight, times reset to early-morning values (e.g. 00:30:00) but the sequence field remains strictly increasing. Consumers should rely on sequence order rather than numeric time comparison alone to reconstruct correct elapsed time across midnight.