> For the complete documentation index, see [llms.txt](https://syticks.gitbook.io/merpi-by-syticks/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://syticks.gitbook.io/merpi-by-syticks/api-reference/bus-ticketing-routes-terminals-schedules-buses-purchase-etc/get-buses-endpoint.md).

# Get Buses Endpoint

## Fetch Buses Based on Schedule (Pass the schedule ID as a path parameter)

> This endpoint allows users to search for available buses based on a schedule. \
> We plan to make it possible to also get buses based on the Route ID in the nearest future.<br>

```json
{"openapi":"3.0.3","info":{"title":"Syticks API","version":"1.0.0"},"paths":{"/api/v1/merpi/transport/buses/{schedule_id}":{"get":{"summary":"Fetch Buses Based on Schedule (Pass the schedule ID as a path parameter)","description":"This endpoint allows users to search for available buses based on a schedule. \nWe plan to make it possible to also get buses based on the Route ID in the nearest future.\n","operationId":"fetchBuses","parameters":[{"name":"schedule_id","in":"path","required":false,"schema":{"type":"integer"},"description":"Filter buses by a specific schedule ID (departure time)."}],"responses":{"200":{"description":"List of buses based on a schedule.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates whether the request was successful."},"status":{"type":"integer","description":"HTTP status code representing the response status."},"message":{"type":"string","description":"Human-readable description of the response."},"data":{"type":"object","properties":{"buses":{"type":"array","description":"A collection of Bus objects.","items":{"type":"object","properties":{"id":{"type":"integer","description":"Unique identifier for the bus."},"name":{"type":"string","description":"Name of the bus."},"image":{"type":"string","description":"URL of the bus image."},"seats":{"type":"integer","description":"Total number of seats available on the bus."},"price":{"type":"string","description":"Price of the bus ticket (might be a string due to currency formatting)."}}}},"next_page":{"type":"string","description":"URL for the next page of results (null if no more pages)."},"count":{"type":"integer","description":"Total number of buses retrieved."},"per_page":{"type":"integer","description":"Number of buses included per page."}}}}}}}},"400":{"description":"Bad request due to invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}}}}}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://syticks.gitbook.io/merpi-by-syticks/api-reference/bus-ticketing-routes-terminals-schedules-buses-purchase-etc/get-buses-endpoint.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
