# Search Bus

This API allows the customers to search for available bus options based on the provided criteria.

## Get Available Bus

<mark style="color:green;">`POST`</mark> `/np/bus/search`

**Headers**

| Name         | Value              |
| ------------ | ------------------ |
| Content-Type | `application/json` |
| Accept       | `application/json` |
| x-auth-token | `<token>`          |

**Body**

| Name               | Type   | Description                                          |
| ------------------ | ------ | ---------------------------------------------------- |
| `operator_type_id` | int    | The type of operator for the bus route               |
| `operator_id`      | int    | The ID of the operator for the bus route             |
| `from`             | string | The Source location for the bus                      |
| `to`               | sting  | The destination location for the bus                 |
| `date`             | date   | Date of the bus journey. Format: YYYY-MM-DD          |
| `reference_no`     | int    | A unique 6 digit reference number for the bus search |

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
    "error": false,
    "message": "Bus routes fetched successfully",
    "data":{
            "id": "ID of the bus option",
            "date": "Date of the bus journey",
            "departure_time": "Time of departure",
            "bus_type": "Type of bus",
            "bus_no": "Bus number",
            "ticket_price": "Price of the bus ticket",
            "operator": "Operator of the bus",
            "amenities": "An array of amenities available on the bus",
            "is_tourist_bus": "Indicates if the bus is a tourist bus"
        }
}
```

{% endtab %}

{% tab title="4XX/5XX" %}

```json
{
    "error": true,
    "message": "Description for the error",
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.globaltopup.in/nepal-recharge/bus-booking/search-bus.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
