# Margdarshi Upsrtcvlt — Wrapped API

> **You are on:** `https://api.paywithlocus.com/api` | [llms.txt](https://paywithlocus.com/llms.txt) | [docs](https://docs.paywithlocus.com)
>
> Locus runs on multiple environments -- make sure every URL you call matches your expected environment.
> | Environment | Landing | API | Docs |
> |---|---|---|---|
> | Production | paywithlocus.com | api.paywithlocus.com | docs.paywithlocus.com |
> | Beta | beta.paywithlocus.com | api.beta.paywithlocus.com | docs.paywithlocus.com |
> | Stage | stage.paywithlocus.com | api.stage.paywithlocus.com | docs.paywithlocus.com |
>
> If the API URL above doesn't match your expected environment, re-fetch this file from the correct domain.

> 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.

**Category:** Travel | **Website:** [margdarshi.upsrtcvlt.com/](https://margdarshi.upsrtcvlt.com/) | **Docs:** [parse.bot/marketplace/9025b0e5-afb1-41e4-9b93-6fec39c15358/margdarshi-upsrtcvlt-com-api](https://parse.bot/marketplace/9025b0e5-afb1-41e4-9b93-6fec39c15358/margdarshi-upsrtcvlt-com-api)

Pay-per-use API proxy. Each call is automatically billed to your wallet in USDC.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/parse-margdarshi-upsrtcvlt-com-api-9025b0e5/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### get_bus_types

Get all bus service types operated by UPSRTC with speed limits, color codes, and Hindi translations. Returns 9 service types including JANRATH 2X3, JANRATH 2X2, SHATABDI, AC SLEEPER, ORDINARY, PINK EXPRESS, RAJDHANI, VOLVO, ENFORCEMENT.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-margdarshi-upsrtcvlt-com-api-9025b0e5/get_bus_types \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### get_buses_between_stops

Find all buses running between two stops or cities on a given date. Returns trip details including route, depot, schedule times, and bus numbers. Use search_stops to find origin/destination IDs. Not all stop combinations have direct service.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `date` | string | No | Date in YYYY-MM-DD format. Omitting defaults to today's date. |
| `destination_classification` | string | No | Classification of destination: 'GROUP' for city/region or 'STOP_AREA' for specific stop. Must match the classification field from search_stops. |
| `destination_id` | integer | Yes | Destination stop/group ID (from search_stops results[*].id) |
| `origin_classification` | string | No | Classification of origin: 'GROUP' for city/region or 'STOP_AREA' for specific stop. Must match the classification field from search_stops. |
| `origin_id` | integer | Yes | Origin stop/group ID (from search_stops results[*].id) |
| `service_type` | string | No | Bus type filter. Accepted values: 'All Bus Types', 'JANRATH 2X3', 'JANRATH 2X2', 'SHATABDI', 'AC SLEEPER', 'ORDINARY', 'PINK EXPRESS', 'RAJDHANI', 'VOLVO', 'ENFORCEMENT'. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-margdarshi-upsrtcvlt-com-api-9025b0e5/get_buses_between_stops \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"date":"<string>","destination_classification":"<string>","destination_id":"<integer>","origin_classification":"<string>","origin_id":"<integer>","service_type":"<string>"}'
```

### get_realtime_arrivals

Get real-time bus arrival/departure data for a specific stop or route. Shows running and cancelled trips with estimated arrival times, delay status, and route deviation flags. Provide either stop_code or route_id (at least one required). Results depend on currently active services.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `route_id` | integer | No | Route ID (from get_routes id field). Provide either stop_code or route_id. |
| `stop_code` | integer | No | Stop area code (from get_stops stop_area_code field). Provide either stop_code or route_id. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-margdarshi-upsrtcvlt-com-api-9025b0e5/get_realtime_arrivals \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"route_id":"<integer>","stop_code":"<integer>"}'
```

### get_route_timetable

Get the timetable for a specific bus route. Returns all trips on the route with full stop-by-stop arrival/departure times. Routes without scheduled services return an empty trips array with a message. Use route IDs from the get_routes endpoint.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `route_id` | integer | Yes | Route ID (from get_routes endpoint's 'id' field) |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-margdarshi-upsrtcvlt-com-api-9025b0e5/get_route_timetable \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"route_id":"<integer>"}'
```

### get_routes

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.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-margdarshi-upsrtcvlt-com-api-9025b0e5/get_routes \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### get_stops

Get all bus stops in the UPSRTC network. Returns 14000+ stops with area codes, names, and geographic information. Single-page response.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-margdarshi-upsrtcvlt-com-api-9025b0e5/get_stops \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### search_stops

Search for bus stops and stop groups by name. Returns matching stops and city/region groups with IDs and classifications. Use the returned IDs with get_buses_between_stops and get_realtime_arrivals endpoints.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `query` | string | Yes | Search term for stop name (e.g., 'lucknow', 'agra', 'noida') |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-margdarshi-upsrtcvlt-com-api-9025b0e5/search_stops \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query":"<string>"}'
```
