# 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 for Locus Pro. Each call burns credits from your workspace balance.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/credits/margdarshi-upsrtcvlt/`
**Auth:** `Authorization: Bearer <LOCUS_CREDITS_SECRET_KEY>` (an `lcr_` secret key or a scoped `lcac_` agent credential)
**Required header:** `Idempotency-Key: <fresh UUID per call>`. A retry with the same key replays the stored result without a new charge.
**Response:** the provider response after any endpoint-specific normalization. `X-Locus-Credits-Charged` carries the charge and `X-Locus-Credits-Balance` the remaining balance. Insufficient credits return `402` before the provider is called.
**Pricing:** estimated costs below are USD. Locus debits the credit equivalent at your workspace rate.

Full call contract: https://docs.paywithlocus.com/api-reference/introduction

> Using a Pay With Locus wallet key (`claw_` prefix)? Wallet routes are documented separately: https://docs.paywithlocus.com/wrapped-apis/for-agents

## 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/credits/margdarshi-upsrtcvlt/get-bus-types \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -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/credits/margdarshi-upsrtcvlt/get-buses-between-stops \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -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/credits/margdarshi-upsrtcvlt/get-realtime-arrivals \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -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/credits/margdarshi-upsrtcvlt/get-route-timetable \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -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/credits/margdarshi-upsrtcvlt/get-routes \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -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/credits/margdarshi-upsrtcvlt/get-stops \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -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/credits/margdarshi-upsrtcvlt/search-stops \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"query":"<string>"}'
```

## Next steps

- [All wrapped API providers](https://paywithlocus.com/wapi/index.md): pick another provider.
- [Find and call tools](https://paywithlocus.com/agent/tools.md): price ceilings, async results, and errors.
- [Credits and billing](https://paywithlocus.com/agent/billing.md): what a call costs and how to add credits.
- [Agent docs index](https://paywithlocus.com/agent/index.md): every Locus agent page.