Searches and filters hotels based on the specified criteria.

GET /api/Hotels/search

The search can be performed by providing a query string along with optional parameters such as check-in and check-out dates, number of adults, children, and room count. Additional filters, including minimum star rating, maximum and minimum price, amenities, and room types, can be applied to narrow down the search results.

Sample request:

GET /hotels/search?searchTerm=Tokyo&maxPrice=100&minStarRating=4&amenities=FreeWifi&roomTypes=Standard

Query parameters

  • CheckInDate string(date)

    Check in date in UTC (defaults to today)

  • CheckOutDate string(date)

    Check out date in UTC (defaults to tomorrow)

  • Adults integer(int32)

    Number of adults (defaults to 2)

  • Children integer(int32)

    Number of children (defaults to 0)

  • Rooms integer(int32)

    Number of rooms (defaults to 1)

  • MinStarRating integer(int32)

    Minimum star rating filter

  • MaxPrice number(double)

    Maximum price filter

  • MinPrice number(double)

    Minimum price filter

  • Amenities array[string]

    List of amenities to filter by

  • RoomTypes array[string]

    List of room types to filter by

    Values are Standard, Luxury, Budget, or Boutique.

  • PageNumber integer(int32)
  • PageSize integer(int32)
  • SearchTerm string

    search by:

  • SortColumn string

    sort by:

  • SortOrder string

    asc or desc

Responses

  • Returns the list of hotels based on the search criteria.

    Hide response attributes Show response attributes object
    • id string(uuid)
    • name string | null
    • starRate integer(int32)
    • hotelImage object
      Hide hotelImage attributes Show hotelImage attributes object
      • imageUrl string | null
      • alternativeText string | null
      • Additional properties are NOT allowed
    • description string | null
    • priceStartingFrom number(double)
    • Additional properties are NOT allowed
    Hide response attributes Show response attributes object
    • id string(uuid)
    • name string | null
    • starRate integer(int32)
    • hotelImage object
      Hide hotelImage attributes Show hotelImage attributes object
      • imageUrl string | null
      • alternativeText string | null
      • Additional properties are NOT allowed
    • description string | null
    • priceStartingFrom number(double)
    • Additional properties are NOT allowed
    Hide response attributes Show response attributes object
    • id string(uuid)
    • name string | null
    • starRate integer(int32)
    • hotelImage object
      Hide hotelImage attributes Show hotelImage attributes object
      • imageUrl string | null
      • alternativeText string | null
      • Additional properties are NOT allowed
    • description string | null
    • priceStartingFrom number(double)
    • Additional properties are NOT allowed
  • 400

    If the request parameters are invalid or missing.

GET /api/Hotels/search
curl \
 -X GET http://api.example.com/api/Hotels/search \
 -H "Authorization: Bearer $ACCESS_TOKEN"
Response examples (200)
[
  {
    "id": "string",
    "name": "string",
    "starRate": 42,
    "hotelImage": {
      "imageUrl": "string",
      "alternativeText": "string"
    },
    "description": "string",
    "priceStartingFrom": 42.0
  }
]
Response examples (200)
[
  {
    "id": "string",
    "name": "string",
    "starRate": 42,
    "hotelImage": {
      "imageUrl": "string",
      "alternativeText": "string"
    },
    "description": "string",
    "priceStartingFrom": 42.0
  }
]