> 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-bus-routes-endpoint.md).

# Get Bus Routes Endpoint

Example of bus routes are Lagos->Abuja, Abuja->Kaduna, Awka-> Benin.

{% hint style="info" %}
Note that, to get all Lagos->Abuja routes, you have to pass Lagos' city ID as the from\_city\_id as you can see below and Abuja's city ID as the to\_city\_id. Doing this will fetch you all the transport companies that ply that route.

\
So, if there are 4 companies that ply that route, it will return 4 items in the list, then if you pass in a business\_id in the query param, it will return only the route of that particular business that you have specified.
{% endhint %}

> To get the ID of any city, go to the 'Get all Cities' Endpoint.

## Fetch All Bus Routes

> This endpoint allows users to search for routes between cities and filter by price and business using query parameters. It provides flexibility for users to search for routes based on their travel needs. Filtering by origin, destination, price, and business allows for targeted searches.<br>

```json
{"openapi":"3.0.3","info":{"title":"Syticks API","version":"1.0.0"},"paths":{"/api/v2/merpi/transport/routes":{"get":{"summary":"Fetch All Bus Routes","description":"This endpoint allows users to search for routes between cities and filter by price and business using query parameters. It provides flexibility for users to search for routes based on their travel needs. Filtering by origin, destination, price, and business allows for targeted searches.\n","operationId":"fetchAllBusRoutes","parameters":[{"name":"search","in":"query","required":false,"schema":{"type":"string"},"description":"Search for routes by city name, state name, or address. Returns routes matching the search criteria in origin or destination."},{"name":"from_city_id","in":"query","required":false,"schema":{"type":"integer"},"description":"Filter routes departing from a specific city by its unique ID."},{"name":"to_city_id","in":"query","required":false,"schema":{"type":"integer"},"description":"Filter routes arriving in a specific city by its unique ID."},{"name":"price","in":"query","required":false,"schema":{"type":"string"},"description":"Filter routes by price. You can specify a range using commas (e.g., price=100,200)."},{"name":"business_id","in":"query","required":false,"schema":{"type":"integer"},"description":"Filter routes by a specific business offering the route (e.g., bus company)."}],"responses":{"200":{"description":"List of bus routes.","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":{"routes":{"type":"array","description":"A collection of Route objects.","items":{"type":"object","properties":{"id":{"type":"integer","description":"Unique identifier for the route."},"price":{"type":"number","description":"Total price of the route (includes ticket price + fees)."},"schedule_type":{"type":"string","enum":["timed","random"],"description":"Type of schedule - 'timed' for fixed departure times, 'random' for flexible schedules."},"price_breakdown":{"type":"object","description":"Breakdown of the route pricing components.","properties":{"ticket_price":{"type":"number","description":"Base ticket price."},"convenience_fee":{"type":"number","description":"Convenience fee charged."},"merchant_commission":{"type":"number","description":"Commission paid to merchant."}}},"from":{"type":"object","description":"Information about the starting point of the route.","properties":{"address":{"type":"string","nullable":true,"description":"Address of the starting point."},"city":{"type":"object","description":"Information about the city of origin.","properties":{"id":{"type":"integer","description":"Unique identifier for the city."},"name":{"type":"string","description":"Name of the city."},"state":{"type":"object","description":"Information about the state of origin.","properties":{"id":{"type":"integer","description":"Unique identifier for the state."},"name":{"type":"string","description":"Name of the state."}}}}}}},"to":{"type":"object","description":"Information about the destination of the route.","properties":{"address":{"type":"string","nullable":true,"description":"Address of the destination."},"city":{"type":"object","description":"Information about the destination city.","properties":{"id":{"type":"integer","description":"Unique identifier for the city."},"name":{"type":"string","description":"Name of the city."},"state":{"type":"object","description":"Information about the destination state.","properties":{"id":{"type":"integer","description":"Unique identifier for the state."},"name":{"type":"string","description":"Name of the state."}}}}}}},"terminal":{"type":"object","description":"Information about the route's terminal.","properties":{"id":{"type":"integer","description":"Unique identifier for the terminal."},"name":{"type":"string","description":"Name of the terminal."},"address":{"type":"string","description":"Address of the terminal."},"location":{"type":"string","description":"Location of the terminal (typically state or city)."},"slug":{"type":"string","nullable":true,"description":"URL-friendly identifier for the terminal."}}},"business":{"type":"object","description":"Information about the business operating the route.","properties":{"id":{"type":"string","description":"Unique identifier for the business (UUID format)."},"name":{"type":"string","description":"Name of the business."},"photo":{"type":"string","description":"URL of the business profile photo."},"slug":{"type":"string","description":"URL-friendly identifier for the business."},"type":{"type":"string","description":"Type of business."}}}}}},"next_page":{"type":"string","nullable":true,"description":"URL for the next page of results (null if no more pages)."},"count":{"type":"integer","description":"Total number of routes retrieved."},"per_page":{"type":"integer","description":"Number of routes included per page."}}}}}}}},"400":{"description":"Bad request due to invalid input parameters.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"status":{"type":"integer"},"message":{"type":"string"}}}}}},"404":{"description":"No routes found matching the criteria.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"status":{"type":"integer"},"message":{"type":"string"}}}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"status":{"type":"integer"},"message":{"type":"string"}}}}}}}}}}}
```
