Skip to main content

/search

Search for hotels and offers by various criteria.

Endpoint URL

https://partners.api.vio.com/v1/search

HTTP Method

POST

Headers

NameRequiredDescription
X-Partner-KeyYesPartner's profile key
Content-TypeYesapplication/json
Accept-EncodingNogzip, deflate, br

Request body

The request body contains a search request payload in JSON format.

NameRequiredTypeDescriptionExampleDefault
queryYesQueryThe way to query hotels.{ hotelIds: ["123","456"], hotelIdsProvider: "EXP"}
checkInNostringCheck in date (YYYY-MM-DD). It must be within 0 and 365 days from today. If not specified, then default dates are picked."2023-05-10"
checkOutNostringCheck out date (YYYY-MM-DD). It must be within 1 and 31 days from the checkIn. If not specified, then default dates are picked."2023-05-11"
roomsYesstringSee rooms configuration"2:4,6""2"
languageYesstringSee supported languages"es""en"
currencyYesstringSee supported currencies"USD""EUR"
anonymousIdNostringAnonymous user identifier for tracking purposes."e0775301-a95a-4b56-a727-9cec40a013af"
userDeviceYesstringThe type of the user's device: desktop,mobile,tablet. If not specified then API determines it based on the caller's User-Agent header."desktop""desktop"
userCountryYesstringThe 2-char ISO 3166 country code of a user. If not specified then API determines it based on the caller's IP address."US"
timeoutNointegerMaximum time in seconds to process a request. Setting this timeout allows to receive a response without waiting for offers from slow providers, but it also may lead to an incomplete or empty list of offers in a response.10
hotelAttributesNostring[]The list of extra hotel attributes to include in a response: details.["details"]
filtersNoFiltersSet of filters.{"guestRating": 9}
pageSizeNointegerMax number of hotels in a response. Must be between 1 and 20.120
sortFieldNostringSort criteria: price, guestRating."price"
sortOrderNostringSort order: ascending,descending."ascending"
labelNostringArbitrary string for tracking and reporting.
attributesNostring[]The list of extra attributes to include in a response: availableHotelsCount.["availableHotelsCount"]
optimizeRoomsNobooleanWhen enabled, the most cost-effective room combinations will be searched for a given occupancy request (rooms field). For example, for 6 people, it will compare offers across different configurations like one 6-person room ("6"), two 3-person rooms ("3|3"), or three 2-person rooms ("2|2|2"), returning only the best option per hotel. This feature is not enabled by default, reach the support if you are going to use it.truefalse

Query

The endpoint supports several ways to query hotels:

  • By hotel IDs
  • By hotel names
  • By place name
  • By place ID
  • By IATA code (most relevant closest place is returned)
  • By Geo coordinates

The only one parameter must be used in a single request. The hotelIds parameter is only supported if the partner hotel inventory has been mapped to Vio.com hotel database during the onboarding.

NameRequiredTypeDescriptionExample
hotelIdsNostring[]The list of hotel IDs. The number of IDs must be between 1 and 50.["123", "432"]
hotelIdsProviderNostringUsed to specify the source of the list of Hotel IDs provided in the hotelIds parameter, which affiliate it should be mapped from (Expedia -> EXP, etc).EXP
hotelNamesNoHotelNamesQuerySet of parameters to query by hotel names.
placeNoPlaceQuerySet of parameters to query by place.{"name": "London"}
placeIdNostringPlace ID."158584"
iataCodeNostringIATA code of an airport."AMS"
latNonumberLatitude.
lonNonumberLongitude.
precisionNostringUsed to rank hotels in each precision range equally (for more information see below).0-100,1000-10000,25000-50000
radiusNonumberOptional radius of nearby search in meters. If not provided, it will be considered as infinite radius. radius will be used only if the lat/lon parameters are provided.25000

Precision Ranges

Specifies the precision for geographic search results, defined as a string in "from-value" format, where each pair influences how results are grouped by distance for ranking purposes.

Each pair in PrecisionRanges is written as "from-value", where from is the starting distance (in meters) and value defines the precision for that range. For example, "0-100" will group all results starting from 0 meters at a precision of 100 meters, meaning all results within a 0-99 meter radius are ranked equally.

Multiple ranges can be specified as comma-separated pairs, such as "0-100,1000-10000,25000-50000". In this example, results within 0 meters have a precision of 100 meters, so distances from 0-99 are treated equally. Starting from 1000 meters, distances are grouped with a precision of 10000 meters, meaning that any result between 1000 and 10999 (1000 + 9999) meters is ranked equally based on proximity. Similarly, results from 25000 meters are grouped with a precision of 25000 meters, meaning that all distances from 25000 to 49999 meters are treated as equal. This format allows flexible, non-linear precision grouping to optimize geo-ranking by reducing overly precise calculations for distant results.

HotelNamesQuery

NameRequiredTypeDescriptionExample
namesYesstring[]The list of of hotel names. The number of names must be between 1 and 50.["May Ramblas Hotel", "Vincci Maritimo"]
countryNostringCountry of hotels. Use this parameter to refine the search if there are hotels with the same names in another country. See countries"Spain"
cityNostringCity of hotels. Use this parameter to refine the search if there are hotels with the same names in another city."Barcelona"

If you need to query hotels by names for different cities/countries, you can do it in separate requests.

PlaceQuery

NameRequiredTypeDescriptionExample
nameYesstringName of the place to query."London"
countryNostringCountry of hotels. Use this parameter to refine the search if there are hotels with the same names in another country. See countries"United Kingdom"

Filters

NameRequiredTypeDescriptionExample
starRatingsNointeger[]The list of star ratings. Star rating is a number between 0 and 5.[4,5]
priceNoPriceFilterPrice filter parameters.{"min": 200}
guestRatingNostringMinimum overall guest rating. Guest rating is a number between 0 and 10.9
propertyTypesNointeger[]The list of property type ids. See property types[0]
notPropertyTypesNointeger[]The list of property type ids to exclude. See property types[5]
themesNointeger[]The list of theme ids. See themes[2]
facilitiesNointeger[]The list of facility ids. See facilities[299]
freeCancellationNobooleanIf true, only offers with free cancellation will be returned. If false, only offers without free cancellation will be returned. Omits the filter if not set.true

PriceFilter

NameRequiredTypeDescriptionExample
minNointegerMinimum total rate in requested currency.200
maxNointegerMaximum total rate in requested currency.400

Dynamic Click Tracking

Click tracking is available using Dynamic Click Tracking

Examples

Searching by hotel names


curl --request POST 'https://partners.api.vio.com/v1/search' \
--header 'X-Partner-Key: <profile key>' \
--header 'Content-Type: application/json' \
--data-raw '{
"checkIn": "2023-10-19",
"checkOut": "2023-10-20",
"query": {
"hotelNames": {
"names": [
"New York - New York Hotel and Casino",
"Palms Place Hotel and Spa",
"The Palazzo at The Venetian"
],
"city": "Las Vegas",
"country": "United States"
}
},
"rooms": "2",
"language": "en",
"currency": "EUR",
"userCountry": "US",
"userDevice": "desktop"
}'

Searching by city name


curl --request POST 'https://partners.api.vio.com/v1/search' \
--header 'X-Partner-Key: <profile key>' \
--header 'Content-Type: application/json' \
--data-raw '{
"checkIn": "2023-10-19",
"checkOut": "2023-10-20",
"query": {
"place": {
"name": "London"
}
},
"hotelAttributes": ["details"],
"rooms": "2",
"language": "en",
"currency": "EUR",
"userCountry": "GB",
"userDevice": "mobile"
}'

Searching by city name with price filter and sorting

This request searches for hotels in London with total price (including taxes) between 200 EUR and 400 EUR. Results are sorted by price from lower to higher. The timeout parameter sets the maximum execution time to 6 seconds.

curl --request POST 'https://partners.api.vio.com/v1/search' \
--header 'X-Partner-Key: <profile key>' \
--header 'Content-Type: application/json' \
--data-raw '{
"checkIn": "2023-10-19",
"checkOut": "2023-10-20",
"query": {
"place": {
"name": "London"
}
},
"hotelAttributes": ["details"],
"rooms": "2",
"language": "en",
"currency": "EUR",
"userCountry": "GB",
"userDevice": "mobile",
"sortField": "price",
"sortOrder": "ascending",
"filters": {
"price": {
"min": 200,
"max": 400
}
},
"timeout": 6
}'

Response

The response payload has the following fields:

FieldRequiredTypeDescription
hotelsYesHotel[]The list of hotels.
failedToMapNostring[]The list of hotels that the API failed to map to a Vio.com hotel.
placeNoPlaceRequested place if queried by place or placeId.
stayNoStayRequested stay.
availableHotelsCountNointegerAn approximate count of available hotels. For popular places, it's close to the real number of available hotels. For unpopular places it could be much less. Available for place searches if "availableHotelsCount" value is specified in the "attributes" request parameter.

Hotel

FieldRequiredTypeDescription
idNostringHotel ID if queried by hotel IDs.
requestedNameNostringHotel name if queried by hotel names.
detailsNoHotelDetailsHotel details. Available if the "details" value is specified in the hotelAttributes request parameter.
offersYesOffer[]The list of offers.
anchorRateNoRateStrike through price.

Example:

{
"requestedName": "Leonardo Hotel Amsterdam Rembrandtpark",
"offers": [...]
}

HotelDetails

FieldRequiredTypeDescription
nameYesstringName of the hotel.
locationYesGeolocationGeolocation of the hotel.
addressYesstringAddress of the hotel.
starRatingNointegerStar rating from 0 to 5.
imagesNostring[]The list of hotel images.
distanceFromCityCentreNointegerDistance from city centre in meters.
guestRatingsNoGuestRatingGuest ratings per category.
cityNameNostringCity name.
reviewCountNointegerReview count.
vioUrlYesstringURL of the hotel on Vio website.
facilitiesNointeger[]The list of hotel facility ids.

GuestRating

FieldRequiredType
cleanlinessNonumber
diningNonumber
facilitiesNonumber
locationNonumber
overallNonumber
pricingNonumber
roomsNonumber
serviceNonumber

Example:

{
"name": "Leonardo Hotel Amsterdam Rembrandtpark",
"location": {
"lat": 52.368132,
"lon": 4.844
},
"address": "Staalmeesterslaan 410",
"starRating": 4,
"images": [
"https://....jpg"
],
"distanceFromCityCentre": 3435
}

Geolocation

FieldRequiredTypeDescription
latYesnumberLatitude in degrees.
lonYesnumberLongitude in degrees.

Example:

{
"lat": 52.368132,
"lon": 4.844
}

Offer

NameRequiredTypeDescription
rateYesRateObject that contains details about the price of the Offer.
currencyYesstringThe currency applied to every rate in the offer. Currency is a 3 letter string following ISO 4217.
packageYesPackageAn object containing the attributes related to benefits that come with the offer.
providerYesProviderThe provider distributing this offer, not necessarily the same as the provider selling the offer.
cancellationPenaltiesYesCancellationPenalties[]Offers cancellation penalties.
roomNameYesstringRoom name of the offer.
roomNoRoomRoom details of the offer. This object is disabled by default, contact your account manager to enable it.
urlYesstringThe URL that redirects a user to book or view more details about this offer.

Room

NameRequiredTypeDescription
nameYesstringRoom name.
typeNostringRoom type.
layoutNoLayoutRoom layout details.
amenitiesNostring[]An array of strings with the amenities of the room.
imagesNostring[]Room images URLs.

Layout

NameRequiredTypeDescription
areaNonumberSurface area of this room in square meters.
bedroomCountNointegerNumber of bedrooms.
bathroomCountNointegerNumber of bathrooms.
bedroomsNoBedroom[]Available bedroom configurations.

Bedroom

NameRequiredTypeDescription
nameNostringName of bedroom.
descriptionNostringBedroom description.
bedConfigurationsNoBedConfiguration[]How beds are configured in the bedroom.

BedConfiguration

NameRequiredTypeDescription
nameNostringName of the bed.
descriptionNostringDescription of the bed.
sizeYesstringSize of the bed.
countYesintegerNumber of beds.
typeNostringType of the bed.

Provider

Information about the provider of the offer.

NameRequiredTypeDescription
nameYesstringProvider's name in english.
logoUrlYesstringProvider logo url.

Example:

{
"name": "Vio.com",
"logoUrl": "https://i.fih.io/provider/svg/fht.svg"
}

CancellationPenalties

NameRequiredTypeDescription
startYesstringDate and time when the penalty starts to apply.
endYesstringDate and time when the penalty stops to apply.
amountYesstringFixed amount of the penalty.
currencyYesstringCurrency of the fixed amount.

Example:

{
"start": "2023-04-13T23:59:00.000-08:00",
"end": "2023-04-20T23:59:00.000-08:00",
"amount": "325.25",
"currency": "EUR"
}

Package

An object describing conditions and complimentary benefits of the offer.

NameRequiredTypeDescription
amenitiesYesstring[]An array of strings (enums) with the amenities of the offer. See package amenities.
canPayLaterYesbooleanIndicates if the user can be charged later for the offer.

Example:

{
"amenities": ["breakfast", "internetIncluded"],
"canPayLater": false
}

Rate

An object that contains the offer price breakdown. All prices are specified per room.

NameRequiredTypeDescription
baseYesnumberThe rate exclusive of any taxes and hotel fees.
hotelFeesYesnumberThe sum of all mandatory taxes and fees that the customer will need to pay at the hotel. For example, a resort fee.
taxesYesnumberValue added tax (VAT).

Example:

{
"base": 120,
"hotelFees": 14,
"taxes": 23
}

Place

FieldRequiredTypeDescription
idYesstringPlace ID.
nameYesstringPlace name.
addressYesstringPlace address from the requested place to its country.
vioUrlYesstringURL of the place on Vio website.

Example:

{
"id": "158584",
"name": "London",
"address": "London, England, United Kingdom"
}

Stay

FieldRequiredTypeDescription
checkInYesstringCheck in date (YYYY-MM-DD) which was used in search.
checkOutYesstringCheck out date (YYYY-MM-DD) which was used in search.

Example:

{
"checkIn": "2023-05-21",
"checkOut": "2023-05-22"
}

Live demos

This is an example of how the /search endpoint can be used to create an offer comparison list per each queried hotel.

This is an example of how the /search endpoint can be used to create an offer comparison list for one specific hotel, showing deal details such as meals, cancellation policy and pay now/later.