TourCMS, a leading online booking and channel management solution is operated by Palisis.

Contact Info

Palisis AG
Florastrasse 18A
8610 Uster
support@palisis.com
+41 44 533 40 40

Follow Us

home > support > API > Marketplace API > hotel search > by date range

Hotel(s) by date range

Deprecated API method

This API call should not be used in new projects and may cease to exist in a future update to the API.
To search for Tours/Hotels with availability over a date range please use the Dates and Deals API method.

I understand, show me the old method details anyway

PurposeCreate a hotel/chalet/villa search results page based on the property having some availability during a date range (i.e. "Available at some point between the 1st and 31st July 2011")
NotesExtends the standard Tour Search Method to allow searching hotels available for check in over a specified date range. Includes a list of dates which are available during the range searched (handy for drawing a calendar of a week / month perhaps).
 
Searches all loaded Hotels, finds the top 200 based on general search criteria and then performs the date range search to find max 75 results..
REST info Call/p/hotels/search_range
/c/hotels/search_range
FormatsXML
Example/p/hotels/search_range.xml?start_date_start=2011-07-01&start_date_end=2011-07-31
VerbGET
Code

PHP examples use the PHP Client Library with SimpleXML

Description

object
search_hotels_range([string $params="" [,string $tour="" [,int $channel=0]]]) 

Parameters

$params
	Querystring, see "Querystring parameters" section below
$tour
	Restrict the Search to a specific hotel ID
$channel
	ID for a Channel (supplier) to list products from. Set as 0 for all.

Example

// Define channel
$channel = 3;

// Define search parameters
$params = "start_date_start=2011-07-01&start_date_end=2011-07-31";

// Query the TourCMS API
$result = $tourcms->search_hotels_range($params, "", $channel);

// Loop through each Hotel and output the name
foreach($result->tour as $hotel) {
    print $hotel->tour_name.'<br />';
}
The Hilton
Travel Lodge

C# examples use the .Net Client Library

Overload list

XmlDocument SearchHotelsByRange ()
XmlDocument SearchHotelsByRange (string queryString)
XmlDocument SearchHotelsByRange (string queryString, string tour)
XmlDocument SearchHotelsByRange (string queryString, string tour, int channelId)

Parameters

queryString
	Search querystring, see possible values in the table below
tour
	Comma separated list of Tours to include in the search,
	empty string/blank for all
channelId
	Channel to search, 0/blank for all connected channels

Example

// Set the Channel ID
// For Suppliers this can be found in the API settings page
// For Partners this can be a specific Channel or 0 to search all
int channelId = 0;

// Define the Tour IDs
// Passing an empty string to search all
string tour = "";

// Define search parameters (any properties available during July 2011)
string queryString = "start_date_start=2011-07-01&start_date_end=2011-07-31";

// Call the API
XmlDocument doc = myTourCMS.SearchHotelsByRange(queryString, tour, channelId);

// Loop through each Hotel and output the name
XmlNodeList tourList = doc.GetElementsByTagName("tour");
foreach (XmlNode tour in tourList)
{
	string tourName = tour.SelectSingleNode("tour_name").InnerText;
    Console.WriteLine(tourName);
}
The Hilton
Travel Lodge

VB examples use the .Net Client Library

Overload list

XmlDocument SearchHotelsByRange ()
XmlDocument SearchHotelsByRange (string queryString)
XmlDocument SearchHotelsByRange (string queryString, string tour)
XmlDocument SearchHotelsByRange (string queryString, string tour, int channelId)

Parameters

queryString
	Search querystring, see possible values in the table below
tour
	Comma separated list of Tours to include in the search,
	empty string/blank for all
channelId
	Channel to search, 0/blank for all connected channels

Example

' Set the Channel ID
' For Suppliers this can be found in the API settings page
' For Partners this can be a specific Channel or 0 to search all
Dim channelId As Integer = 0

' Define the Tour IDs
' Passing an empty string to search all
Dim tour As String = ""

' Define search parameters (any properties available during July 2011)
Dim queryString As String = "start_date_start=2011-07-01&start_date_end=2011-07-31"

' Call the API
Dim doc As XmlDocument =
	myTourCMS.SearchHotelsByRange(queryString, tour, channelId)

' Loop through each Hotel and output the name
Dim tourList As XmlNodeList = doc.GetElementsByTagName("tour")
For Each tour As XmlNode In tourList
	Dim tourName As String = tour.SelectSingleNode("tour_name").InnerText
	Console.WriteLine(tourName)
Next
The Hilton
Travel Lodge

Querystring parameters

Supports all of the querystring parameters (apart from paging) from the Tour Search Method plus:

Querystring parameters
ParameterNotes
start_date_start(YYYY-MM-DD) - Earliest desired start (check-in) date
start_date_end(YYYY-MM-DD) - Latest desired start (check-in) date
single_tour_idThis will just check that product. Useful if you have a single product page and want to show some live price data. Bear in mind that the tour id is unique per TourCMS account so if you are using this API in a mutli account environment you could get a couple of products back in the XML. (non mandatory)

Response fields

Returns the same data as the standard Tour Search Method plus each tour node has a new dates node which contains one or more date nodes. The text value of each available date node is the date in YYYY-MM-DD format, only dates that are available to be booked will be returned.

Linking to the booking engine

You can append the following to the book link (returned in the XML):

  • startdate_yyyymmdd - e.g. 2010-12-12 - start date
  • hdur - e.g. 1 - duration
  • ad - e.g. 2 - adults
  • ch - e.g. 0 - children

No fields are mandatory. Further informtion about linking to the booking engine with default values

More information