# Redbus — 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.

> Search and explore bus and train services on redBus.in. Look up city and station suggestions, find available routes, check schedules, and view seat layouts and fare details.

**Category:** Travel | **Website:** [redbus.in/](https://redbus.in/) | **Docs:** [parse.bot/marketplace/435b2b4a-23c5-4306-8caf-4dee94e26565/redbus-in-api](https://parse.bot/marketplace/435b2b4a-23c5-4306-8caf-4dee94e26565/redbus-in-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-redbus-in-api-435b2b4a/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### get_bus_details

Get detailed information for a specific bus service including boarding points, dropping points, cancellation policy, fares, and service metadata. Requires a route_id from search_buses results.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `doj` | string | Yes | Date of journey in DD-Mon-YYYY format (e.g. 26-Jun-2026) |
| `from_city_id` | string | Yes | Source city ID (from get_city_suggestions) |
| `route_id` | string | Yes | Route ID of the bus service (from search_buses response inventories[*].routeId) |
| `to_city_id` | string | Yes | Destination city ID (from get_city_suggestions) |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-redbus-in-api-435b2b4a/get_bus_details \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"doj":"<string>","from_city_id":"<string>","route_id":"<string>","to_city_id":"<string>"}'
```

### get_bus_seat_layout

Get the seat layout and availability for a specific bus service. Returns detailed seat information including position, availability, and fares. Requires route_id and operator_id from search_buses results. Optionally pass from_city_name and to_city_name for proper boarding/dropping point resolution.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `doj` | string | Yes | Date of journey in DD-Mon-YYYY format (e.g. 26-Jun-2026) |
| `from_city_name` | string | No | Source city name (e.g. 'Mumbai', 'Bangalore'). Helps resolve boarding points correctly. |
| `operator_id` | string | Yes | Operator ID of the bus service (from search_buses response inventories[*].operatorId) |
| `route_id` | string | Yes | Route ID of the bus service (from search_buses response inventories[*].routeId) |
| `to_city_name` | string | No | Destination city name (e.g. 'Pune', 'Hyderabad'). Helps resolve dropping points correctly. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-redbus-in-api-435b2b4a/get_bus_seat_layout \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"doj":"<string>","from_city_name":"<string>","operator_id":"<string>","route_id":"<string>","to_city_name":"<string>"}'
```

### get_city_suggestions

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.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `limit` | integer | No | Max results to return |
| `query` | string | Yes | Search query for city name (e.g. 'Mumbai', 'Pune', 'Bangalore') |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-redbus-in-api-435b2b4a/get_city_suggestions \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"limit":"<integer>","query":"<string>"}'
```

### get_train_schedule

Get the complete schedule and route for a specific train including all stops, arrival/departure times, platform numbers, distances, and days of operation. Train numbers can be obtained from get_train_suggestions or search_trains.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `train_no` | string | Yes | Train number (e.g. 22209, 12925, 12137) |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-redbus-in-api-435b2b4a/get_train_schedule \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"train_no":"<string>"}'
```

### get_train_suggestions

Get train suggestions for autocomplete search. Returns matching trains with train number, name, source and destination station codes. Use station codes for search_trains and train numbers for get_train_schedule.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `query` | string | Yes | Search query for train name or number (e.g. 'Rajdhani', 'Mumbai', '22209') |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-redbus-in-api-435b2b4a/get_train_suggestions \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query":"<string>"}'
```

### search_buses

Search for available bus services between two cities on a given date. Returns paginated results with bus operator details, fares, availability, departure/arrival times, and amenities. Use city IDs from get_city_suggestions.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `doj` | string | Yes | Date of journey in DD-Mon-YYYY format (e.g. 26-Jun-2026) |
| `from_city_id` | string | Yes | Source city ID (obtained from get_city_suggestions response docs[*].ID) |
| `limit` | integer | No | Max results per page |
| `offset` | integer | No | Offset for pagination (number of results to skip) |
| `to_city_id` | string | Yes | Destination city ID (obtained from get_city_suggestions response docs[*].ID) |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-redbus-in-api-435b2b4a/search_buses \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"doj":"<string>","from_city_id":"<string>","limit":"<integer>","offset":"<integer>","to_city_id":"<string>"}'
```

### search_trains

Search for available trains between two stations on a given date. Returns train list with availability status, fares per class, duration, and distance. Station codes can be obtained from get_train_suggestions.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `doj` | string | Yes | Date of journey in YYYYMMDD format (e.g. 20260620) |
| `dst` | string | Yes | Destination station code (e.g. NDLS, NZM) |
| `page` | integer | No | Page number for pagination |
| `src` | string | Yes | Source station code (e.g. MMCT, CSMT, BRC) |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-redbus-in-api-435b2b4a/search_trains \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"doj":"<string>","dst":"<string>","page":"<integer>","src":"<string>"}'
```
