DEPRECATED
This version of the Travel IQ API is deprecated. Please refer to the Travel IQ API (v3).
Autocompleter
Creating a Search
Search Status
Search Results
Hotel Package
Alternative Offers
Search Parameters
Table of contens
By Topic
Change Date
Contact Information
Scope of the API
Character Encoding
Supported Formats
Authentication
Abbreviations
Using the Autocompleter
Creating a Search
Retrieving the Status of a Search
Retrieving Search Results
Retrieving Details about a Hotel Package
Retrieving Alternative Offers for a Hotel Package
Retrieving Parameters of the Search
By URLs
/api/v2/hotels/autocompleter/#{q}.#{format} [GET]
/api/v2/hotels/searches.{format} [POST]
/api/v2/hotels/searches/{id}.{format} [GET]
/api/v2/hotels/searches/{id}/packages.{format} [GET]
/api/v2/hotels/searches/{search_id}/packages/{package_id}.{format} [GET]
/api/v2/hotels/searches/{search_id}/packages/{package_id}/alternative_packages.{format} [GET]
/api/v2/hotels/searches/{id}/parameters.{format} [GET]
General Notes
Last Change
Last change of this document: 2009-04-09
Contact
For questions, bug reports, etc. please contact api@traveliq.net
Scope of the API and this document
The Travel IQ API - and therefore this document - only covers hotel searches.
Encoding
All content in requests and responses to the API must be encoded in UTF-8.
Available Formats
Different API calls are available in different formats. The requested format will be determined by the extension you use. Generally available formats are JSON, XML and HTML.
Available formats are specified per api call.
API Key and Authentication
To use the Travel IQ API, you need an api key. This can be obtained from your Partner site - log in to http://www.travel-iq.com/partners with your Partner username/password, and click "Werbemittel".
Once you know your key, use it as the key parameter to all API calls. So, if your API key is example, then the full url of a request to the API could be:
You can test the connectivity and authentication with tools like curl, wget, or a web browser:
While using the API, all URLs returned by Travel-IQ will contain your key.
Note that the submission of a request with an invalid key will yield a HEAD response from the server with a status of 401: Unauthorized.
Documentation
Abbreviations
| M | Mandatory |
| O | Optional |
Retrieving Locations with the Autocompleter
The first step of the search is done by finding a valid location. This is how you translate your customer's input into valid locations. A location is identified by an numerical ID and a location type. Currently the only valid location type is 'city'.
You may need to note the complete flag: We might limit the number of results we return for performance or styling reasons. You retrieved all airports matching your input if the complete flag is set to true. If this complete flag is false, and the desired location is not in the returned set, then try posting a longer string to narrow down the possibilities.
Name-based AutocompleterThe most straight forward way to retrieve a city is to use the autocompleter with a substring of a city name.
/api/v2/hotels/autocompleter/#{q}.#{format} [GET]Parameters
| M | 'key' | String | Your API key |
| M | 'format' | String | 'xml', 'json' or 'html' |
| M | 'q' | String | General text query, substrings are accepted |
Example
GET /api/v2/hotels/autocompleter/pots.xmlLocation-based Autocompleter
As an alternative to the name-based autocompleter, you can used a location-based version. This is especially useful if you can obtain the location of the user, e.g. on a mobile phone. The reply is a collection of cities within a 50km perimeter. The first city in the list is always the closest. If it is also the largest, only one city is retuned. If the closest city is not the largerst, it is followed by all cities within the perimeter ordered by population. The format of the reply is identical for name-based and location-based autocompleter calls.
/api/v2/hotels/location_autocompleter.#{format} [GET]Parameters
| M | 'key' | String | Your API key |
| M | 'format' | String | 'xml', 'json' or 'html' |
| M | 'latitude' | Float | The latitude angle |
| M | 'longitude' | Float | The longitude angle |
Example
GET /api/v2/hotels/location_autocompleter.xml?latitude=52.3988578&longitude=13.0656624
Responses
-
html - the location type and the location ID you need to create
a valid hotel search is stated in the class and id attribute of an li
element, respectively. The returned html partial can be used in your
html application and is ready to be rendered.
HTML reply
<ol class='locationscomplete'> <li class='city' id='36720'> Potsdam - Deutschland </li> <li class='city' id='76616'> Potsdam - USA </li> <li class='city' id='51083'> Potštát - Tschechische Republik </li> </ol>
-
xml - the location type and the location ID you need to create
a valid hotel search is stated in the location_type and location_id
attributes of the location element.
XML reply
<?xml version="1.0" encoding="UTF-8"?> <locations complete="true"> <location name="Potsdam" country="Deutschland" country_code="DE" country_id="10" type="city" id="36720" longitude="13.0656624" latitude="52.3988578" > <![CDATA[Potsdam - Deutschland]]> </location> <location name="Potsdam" country="USA" country_code="US" country_id="5" type="city" id="76616" longitude="-74.9816700" latitude="44.6697200" > <![CDATA[Potsdam - USA]]> </location> <location name="Potštát" country="Tschechische Republik" country_code="CZ" country_id="46" type="city" id="51083" longitude="17.6517354" latitude="49.6369266" > <![CDATA[Potštát - Tschechische Republik]]> </location> </locations>
-
json - the location_type and the location_id is what is
neccessary to create a valid hotel search. The display_name is what you
should show to your customer.
JSON reply
{ "complete": true, "locations": [ { "type": "city", "country": "Deutschland", "display_name": "Potsdam - Deutschland", "country_code": "DE", "longitude": "13.0656624", "latitude": "52.3988578", "name": "Potsdam", "id": 36720 }, { "type": "city", "country": "USA", "display_name": "Potsdam - USA", "country_code": "US", "longitude": "-74.9816700", "latitude": "44.6697200", "name": "Potsdam", "id": 76616 }, { "type": "city", "country": "Tschechische Republik", "display_name": "Pot\u0161t\u00e1t - Tschechische Republik", "country_code": "CZ", "longitude": "17.6517354", "latitude": "49.6369266", "name": "Pot\u0161t\u00e1t", "id": 51083 } ] }
Search
Once you have the location ID and the location type for which you want to search, the next step is to submit the search. This is done via a HTTP POST with parameters.
/api/v2/hotels/searches.{format} [POST]Parameters
| M | 'key' | String | Your API key |
| M | 'format' | String | 'xml', 'json' or 'html' |
| M | 'location_type' | String | The location type as obtained from the autocompleter |
| M | 'location_id' | Integer | The location ID as obtained from the autocompleter |
| M | 'arrival_date' | ISO 8601 Date | The arrival date |
| M | 'departure_date' | ISO 8601 Date | The departure date |
There are two ways to define a room configuration:
| M | 'room_configuration' | String | 'single' or 'double' |
| M | 'single_rooms_count' | Integer | Number of single rooms |
| M | 'double_rooms_count' | Integer | Number of double rooms |
Examples
POST /api/v2/hotels/searches.xml?key=example&location_type=city&location_id=40784&arrival_date=2009-04-30&departure_date=2009-05-03&single_rooms_count=2&double_rooms_count=0
curl -d "key=example&location_type=city&location_id=40784&arrival_date=2009-04-30&departure_date=2009-05-03&single_rooms_count=2&double_rooms_count=0" 'www.travel-iq.com/api/v2/hotels/searches.xml'
Responses
On a successful search creation, the HTTP response code will be 201. The
body will contain the status of the search (see
Status
).
If the parameters are incomplete or invalid in some way, the server will respond with a HTTP 422 status code, and the response body will contain some human-readable information about which parameter was invalid, and why.
Examples of error messages
-
xml - An <errors> element, containing <error> elemets with error messages.
XML reply
<?xml version="1.0" encoding="UTF-8"?> <errors> <error>Bitte Zimmerkonfiguration mit maximal 3 Zimmern angeben.</error> </errors>
-
json - A hash with an 'error' key, the value beeing an array of error messages.
JSON reply
{ "errors": [ "Bitte Anreisedatum angeben.", "Anreisedatum muss vor dem Abreisedatum liegen.", "Anreisedatum muss auf dem heutigen Tag oder in der Zukunft liegen.", "Bitte Abreisedatum angeben.", "Abreisedatum muss nach dem Anreisedatum liegen." ] } -
html - A <div> element ith a <ul> element with <li> elements with error messages.
HTML reply
<div id="errors"> <span id="error_header">Folgende Fehler sind aufgetreten:</span> <ul id="error_list"> <li id="error_message">Bitte gültigen Ortstyp angeben.</li> </ul> </div>
Status
With your search successfully created, your client application will probably want to regularly check on the status of the search, and maybe display a progress indicator to the user. This is done using the status function.
The reply also contains the parameters you used the create the search (JSON and XML) or information for display about the used parameters (HMTL).
/api/v2/hotels/searches/{id}.{format} [GET]Parameters
| M | 'key' | String | Your API key |
| M | 'format' | String | 'xml', 'json' or 'html' |
| M | 'id' | Integer | The ID of the search, as returned by search |
Example
GET /api/v2/hotels/searches/123.xml?key=example
Responses
As long as the search exists, the response will be a HTTP 200. The response body depends on the format, but will generally contain an indication of the status (running, finished) and the number of unique packages found as of now.
If the search does not exist, the server will respond with a HTTP 404 status code, and the response body will contain an appropriate message. Since packages have a limited period of validity, searches can expire. If a search is expired, the server responds with a HTTP 205 status code, and the response body will contain an error message.
The two states available are
- running
- The search is still running, there might be more results available
- finished
- The search is finished. We believe to have found the cheapest hotels
-
xml - A <search> element, containing the status and the number of searches.
XML reply
<?xml version="1.0" encoding="UTF-8"?> <search id="33"> <search_parameters> <arrival_date>2009-07-02</arrival_date> <departure_date>2009-07-05</departure_date> <location_type>City</location_type> <location_id>40784</location_id> <single_rooms_count>1</single_rooms_count> <double_rooms_count>0</double_rooms_count> </search_parameters> <state>finished</state> <packages_count>520</packages_count> <provider_states> <provider> <provider_name>Venere</provider_name> <provider_state>returned</provider_state> </provider> <provider> <provider_name>Hotelopia</provider_name> <provider_state>returned</provider_state> </provider> </provider_states> <url>http://www.travel-iq.com/api/v2/hotels/searches/33.xml?key=example</url> <packages_url>http://www.travel-iq.com/api/v2/hotels/searches/33/packages.xml?key=example</packages_url> </search>
-
json - The search element, as a json object:
JSON reply
{ "search": { "search_parameters": { "double_rooms_count": 0, "location_id": 40784, "arrival_date": "2009-07-02", "departure_date": "2009-07-05", "single_rooms_count": 1, "location_type": "City" }, "provider_states": [ { "provider_state": "returned", "provider_name": "Venere" }, { "provider_state": "returned", "provider_name": "Hotelopia" } ], "packages_count": 520, "state": "finished", "packages_url": "http://www.travel-iq.com/api/v2/hotels/searches/33/packages.json?key=example", "url": "http://www.travel-iq.com/api/v2/hotels/searches/33.json?key=example" } } -
html - The search element, as html:
HTML reply
<dl class="search" id="33"> <dt class="search_parameters">Suchparameter</dt> <dd class="search_parameters"> <dt class="arrival_date">Anreisetag</dt> <dd class="arrival_date">Do, 02.07.09</dd> <dt class="departure_date">Abreisetag</dt> <dd class="departure_date">So, 05.07.09</dd> <dt class="location_name">Reiseziel</dt> <dd class="location_name">Berlin</dd> <dt class="single_rooms_count">Einzelzimmer:</dt> <dd class="single_rooms_count">1</dd> <dt class="double_rooms_count">Doppelzimmer:</dt> <dd class="double_rooms_count">keine</dd> </dd> <dt class="state">Status</dt> <dd class="state">fertig</dd> <dt class="packages_count">Anzahl der Ergebnisse</dt> <dd class="packages_count">520</dd> <dt class="packages_count">Anbieter</dt> <dd class="provider_states"> <ul> <li class="provider_state">Venere: geliefert</li> <li class="provider_state">Hotelopia: geliefert</li> <li class="provider_state">Hrs: angefragt</li> </ul> </dd> <dt class="status_link">Status Link</dt> <dd class="status_link"><a href="http://www.travel-iq.com/api/v2/hotels/searches/33.html?key=example">Status</a></dd> <dt class="packages_link">Pakete Link</dt> <dd class="packages_link"><a href="http://www.travel-iq.com/api/v2/hotels/searches/33/packages.html?key=example">Pakete</a></dd> <dl>
Examples of error messages for a missing search
-
xml
XML reply
<?xml version="1.0" encoding="UTF-8"?> <errors> <error>Die angefragte Suche existiert nicht.</error> </errors>
-
json
JSON reply
{ "errors": ["Die angefragte Suche existiert nicht."] } -
html
HTML reply
<div id="errors"> <span id="error_header">Folgende Fehler sind aufgetreten:</span> <ul id="error_list"> <li id="error_message">Die angefragte Suche existiert nicht.</li> </ul> </div>
Examples of error messages for a expired search
-
xml
XML reply
<?xml version="1.0" encoding="UTF-8"?> <errors> <error>Das Suchergebnis enthält abgelaufene Pakete. Bitte stellen sie die Suchanfrage erneut.</error> </errors>
-
json
JSON reply
{ "errors": ["Das Suchergebnis enth\u00e4lt abgelaufene Pakete. Bitte stellen sie die Suchanfrage erneut."] } -
html
HTML reply
<div id="errors"> <span id="error_header">Folgende Fehler sind aufgetreten:</span> <ul id="error_list"> <li id="error_message">Das Suchergebnis enthält abgelaufene Pakete. Bitte stellen sie die Suchanfrage erneut.</li> </ul> </div>
Search Result List
At any time, you can get the packages of your search. You will probably want to wait either for the status to be "finished", or for some limit.
/api/v2/hotels/searches/{id}/packages.{format} [GET]Parameters
| M | 'key' | String | Your API key |
| M | 'format' | String | 'xml', 'json' or 'html' |
| M | 'id' | Integer | The ID of the search, as returned by search |
| O | 'page' | Integer | Allows you to paginate the results (default: 1) |
| O | 'per_page' | Integer | Allows you to adjust the number of results per page (default: 25) |
| O | 'stars_min' | Integer | Allows you to get only hotels with more stars than the specified number |
| O | 'breakfast_included' | 'true' or 'false' | Allows you to get only offers which include breakfast (default: false) |
| O | 'hotel_name' | String | Allows you to get only hotels with a part of the name matching the query (default: false) |
| O | 'has_restaurant' | 'true' or 'false' | Allows you to get only offers from hotels which have a restaurant (default: false) |
| O | 'has_internet' | 'true' or 'false' | Allows you to get only offers from hotels which provide an internet connection (default: false) |
| O | 'has_gym' | 'true' or 'false' | Allows you to get only offers from hotels which have a gym (default: false) |
| O | 'has_spa' | 'true' or 'false' | Allows you to get only offers from hotels which have a spa (default: false) |
| O | 'reference_lat' | Float | The latitude angle of the reference point |
| O | 'reference_lng' | Float | The latitude angle of the reference point |
| O | 'reference_distance_max' | Float | The maximum distance to the hotel in kilometers |
Example
GET /api/v2/hotels/searches/123/packages.xml?key=example
Responses
The result will be a list of packages available for that search. The information returned is suited for displaying a list of packages. The set of results returned is "paged" - that is, limited to 25, with each set of 25 assigned a page number. Packges are ordere by price, starting with the cheapest package.
If the search not exist or the search is expired, the server will respond with a HTTP 404 or 205 status code, and the response body will contain an appropriate message as described in in the status section.
Example
- XML
XML reply
<?xml version="1.0" encoding="UTF-8"?> <search id="145"> <state>finished</state> <packages_count>409</packages_count> <packages> <package id="24741"> <breakfast>false</breakfast> <max_de_review_present>false</max_de_review_present> <longitude>13.58224</longitude> <rating_average>6.6</rating_average> <star_rating>2</star_rating> <currency>EUR</currency> <alternative_packages_count>0</alternative_packages_count> <zip>12621</zip> <booking_url>http://apiv3.travel-iq.com/hotel_searches/145/packages/24741/booking?key=example</booking_url> <latitude>52.50307</latitude> <city>Berlin</city> <street>Am Niederfeld 7</street> <price>50.0</price> <amenities> <amenity>parking</amenity> <amenity>restaurant</amenity> <amenity>internet</amenity> </amenities> <goodies><ul class=""> <li> Parkplatz direkt am Hotel </li> <li> Nutzung eines Internet-Terminals im Hotel </li> <li> Wireless LAN im Zimmer </li> </ul> </goodies> <package_url>http://apiv3.travel-iq.com/api/v2/hotels/searches/145/packages/24741.xml?key=example</package_url> <provider_name>HRS.de</provider_name> <ratings_count_total>0</ratings_count_total> <name>Hotel B1</name> <search_id>145</search_id> <image_url>http://www.hrs.com/foto/4/0/1/7/401792/f48e9/401792_a_1284426.jpg</image_url> <country>Deutschland</country> </package> <package id="23637"> <breakfast>false</breakfast> <max_de_review_present>false</max_de_review_present> <longitude>13.3299</longitude> <rating_average>6.71667</rating_average> <star_rating>3</star_rating> <currency>EUR</currency> <alternative_packages_count>2</alternative_packages_count> <zip>13403</zip> <booking_url>http://apiv3.travel-iq.com/hotel_searches/145/packages/23637/booking?key=example</booking_url> <latitude>52.5694</latitude> <city>Berlin</city> <street>Ollenhauerstraße 111</street> <price>58.0</price> <amenities> <amenity>restaurant</amenity> <amenity>parking</amenity> <amenity>internet</amenity> </amenities> <goodies></goodies> <package_url>http://apiv3.travel-iq.com/api/v2/hotels/searches/145/packages/23637.xml?key=example</package_url> <provider_name>Venere.com</provider_name> <ratings_count_total>6</ratings_count_total> <name>Carat</name> <search_id>145</search_id> <image_url>http://www.venere.com/img/hotel/7/4/5/2/22547/image_hotel_exterior_frontview_1.jpg</image_url> <country>Deutschland</country> </package> </packages> </search>
- JSON
JSON reply
{"search":{"packages_count":409,"packages":[{"breakfast":false,"max_de_review_present":false,"longitude":13.58224,"rating_average":6.6,"star_rating":2,"currency":"EUR","alternative_packages_count":0,"zip":"12621","booking_url":"http:\/\/apiv3.travel-iq.com\/hotel_searches\/145\/packages\/24741\/booking?key=example","latitude":52.50307,"city":"Berlin","street":"Am Niederfeld 7","price":50.0,"amenities":["parking","restaurant","internet"],"goodies":"<ul class=\"\">\n <li>\n Parkplatz direkt am Hotel\n <\/li>\n <li>\nNutzung eines Internet-Terminals im Hotel\n <\/li>\n <li>\nWireless LAN im Zimmer\n <\/li>\n<\/ul>\n","package_url":"http:\/\/apiv3.travel-iq.com\/api\/v2\/hotels\/searches\/145\/packages\/24741.json?key=example","provider_name":"HRS.de","ratings_count_total":0,"name":"Hotel B1","search_id":145,"image_url":"http:\/\/www.hrs.com\/foto\/4\/0\/1\/7\/401792\/f48e9\/401792_a_1284426.jpg","id":24741,"country":"Deutschland"},{"breakfast":false,"max_de_review_present":false,"longitude":13.3299,"rating_average":6.71667,"star_rating":3,"currency":"EUR","alternative_packages_count":2,"zip":"13403","booking_url":"http:\/\/apiv3.travel-iq.com\/hotel_searches\/145\/packages\/23637\/booking?key=example","latitude":52.5694,"city":"Berlin","street":"Ollenhauerstra\u00dfe 111","price":58.0,"amenities":["restaurant","parking","internet"],"goodies":null,"package_url":"http:\/\/apiv3.travel-iq.com\/api\/v2\/hotels\/searches\/145\/packages\/23637.json?key=example","provider_name":"Venere.com","ratings_count_total":6,"name":"Carat","search_id":145,"image_url":"http:\/\/www.venere.com\/img\/hotel\/7\/4\/5\/2\/22547\/image_hotel_exterior_frontview_1.jpg","id":23637,"country":"Deutschland"}],"id":145,"state":"finished"}} -
HTML
HTML reply
<div class="search"> <span class="packages_count"> 396 Ergebnisse </span> <ol class="packages"> <li class="package"> <span class="name"> Hotel B1 </span> <span class="price"> 75.0 </span> <span class="currency"> EUR </span> <a class="booking_link" href="http://travel-iq.com/hotel_searches/8/packages/18225/booking?key=example"> Buchen </a> <span class="street"> Am Niederfeld 7 </span> <span class="zip"> 12621 </span> <span class="city"> Berlin </span> <span class="country"> Deutschland </span> <span class="breakfast"> Ohne Frühstück </span> <span class="star_rating"> ** </span> <a class="package_link" href="http://travel-iq.com/api/v2/hotels/packages/18225.html?key=example"> Details </a> <div class="hotel_image"> <img src="http://www.hrs.com/foto/4/0/1/7/401792/f48e9/401792_a_1284426.jpg" /> </div> <div class="amenities"> </div> <span class="alternative_packages_count"> 0 Alternativangebote </span> <span class="provider_name"> Hrs </span> </li> <li class="package"> <span class="name"> Azur </span> <span class="price"> 96.0 </span> <span class="currency"> EUR </span> <a class="booking_link" href="http://travel-iq.com/hotel_searches/8/packages/18349/booking?key=example"> Buchen </a> <span class="street"> Ferdinandstr. 39 </span> <span class="zip"> 12621 </span> <span class="city"> Berlin </span> <span class="country"> Deutschland </span> <span class="breakfast"> Ohne Frühstück </span> <span class="star_rating"> *** </span> <a class="package_link" href="http://travel-iq.com/api/v2/hotels/packages/18349.html?key=example"> Details </a> <div class="hotel_image"> <img src="http://www.hrs.com/foto/2/2/1/6/221638/1059d/221638_a_857107.jpg" /> </div> <div class="amenities"> <span title="Parkplatz"><img alt="Parking" src="http://www.travel-iq.com/images/amenities/parking.png?1234950831" /></span> <span title="Internet"><img alt="Internet" src="http://www.travel-iq.com/images/amenities/internet.png?1234950831" /></span> </div> <span class="alternative_packages_count"> 1 Alternativangebot </span> <span class="provider_name"> Hrs </span> </li> </ol> </div>
Single Packages
After retrieving the list of packages matching your search, you can get the full details of any one of them.
/api/v2/hotels/searches/{search_id}/packages/{package_id}.{format} [GET]Parameters
| M | 'key' | String | Your API key |
| M | 'format' | String | 'xml', 'json' or 'html' |
| M | 'search_id' | Integer | The ID of the search, as returned by search |
| M | 'package_id' | Integer | The ID of the package, as returned by results |
Example
GET /api/v2/hotels/searches/123/packages/456.xml?key=example
Responses
If the search and the package exits and the search is not expired, the server will respond with a HTTP 200.
The body will contain the full details available for this package including
descriptions and amenities. It will
alternative_packages_count, which indicates how many similar
packages are available from different providers (see
Alternative Packages
).
If the search not exist or the search is expired, the server will respond with a HTTP 404 or 205 status code, and the response body will contain an appropriate message as described in in the status section.
Example
- XML
XML reply
<?xml version="1.0" encoding="UTF-8"?> <package id="24741"> <breakfast>false</breakfast> <image_urls> <image_url>http://www.hrs.com/foto/4/0/1/7/401792/f48e9/401792_a_1284426.jpg</image_url> <image_url>http://www.hrs.com/foto/4/0/1/7/401792/f48e9/401792_z_1284439.jpg</image_url> <image_url>http://www.hrs.com/foto/4/0/1/7/401792/f48e9/401792_e_1284428.jpg</image_url> <image_url>http://www.hrs.com/foto/4/0/1/7/401792/f48e9/401792_i_1284429.jpg</image_url> </image_urls> <max_de_review_present>false</max_de_review_present> <amenities_description><ul class="heading"> <li> Akzeptierte Zahlungsmittel </li> <li> <ul class=""> <li> Eurocard/Mastercard </li> <li> Electronic Cash </li> <li> American Express </li> <li> Visa </li> </ul> </li> <li> Check in/out </li> <li> <ul class=""> <li> Spätester Check-out 16:00 </li> <li> Frühester Check-in 16:00 </li> </ul> </amenities_description> <longitude>13.58224</longitude> <rating_average>6.6</rating_average> <alternative_packages_url>http://apiv3.travel-iq.com/api/v2/hotels/searches/145/packages/24741/alternative_packages.xml?key=example</alternative_packages_url> <star_rating>2</star_rating> <currency>EUR</currency> <alternative_packages_count>0</alternative_packages_count> <description><ul class=""> <li> Das modern und komfortabel eingerichtete Hotel mit 50 Zimmern liegt verkehrsgünstig aber ruhig an der südlichen Parallelstraße zur B1 (Bundesstraße 1) in Berlin Alt-Kaulsdorf, etwa 10 Minuten von der A10 entfernt. </li> <li> Parkmöglichkeiten sind am Hotel ausreichend vorhanden. Eine Badesee ist etwa 5 Gehminuten entfernt. Ein chinesisches Restaurant (mit AllYouCanIt-Buffet für 6,90 EUR)befindet sich etwa 3 Gehminuten vom Hotel entfernt, geöffnet täglich bis 23.00 Uhr. Bitte beachten Sie: Die Rezeption ist täglich von 16.00 bis 22.00 Uhr besetzt! </li> <li> Ein High-Speed-Internetanschluss über W-Lan ist in allen Zimmern mit Ihrem Notebook sowie über ein Internet-Terminal im Empfangsbereich kostenlos nutzbar. SB-Bar mit Billard. </li> </ul> </description> <zip>12621</zip> <booking_url>http://apiv3.travel-iq.com/hotel_searches/145/packages/24741/booking?key=example</booking_url> <latitude>52.50307</latitude> <city>Berlin</city> <street>Am Niederfeld 7</street> <price>50.0</price> <amenities> <amenity>parking</amenity> <amenity>restaurant</amenity> <amenity>internet</amenity> </amenities> <goodies><ul class=""> <li> Parkplatz direkt am Hotel </li> <li> Nutzung eines Internet-Terminals im Hotel </li> <li> Wireless LAN im Zimmer </li> </ul> </goodies> <provider_name>HRS.de</provider_name> <provider_ratings> <provider_rating>rating6.6provider_nameHRS.deratings_urlratings_count0</provider_rating> </provider_ratings> <ratings_count_total>0</ratings_count_total> <name>Hotel B1</name> <search_id>145</search_id> <max_de_review></max_de_review> <country>Deutschland</country> </package>
- JSON
JSON reply
{"package":{"breakfast":false,"image_urls":["http:\/\/www.hrs.com\/foto\/4\/0\/1\/7\/401792\/f48e9\/401792_a_1284426.jpg","http:\/\/www.hrs.com\/foto\/4\/0\/1\/7\/401792\/f48e9\/401792_z_1284439.jpg","http:\/\/www.hrs.com\/foto\/4\/0\/1\/7\/401792\/f48e9\/401792_e_1284428.jpg","http:\/\/www.hrs.com\/foto\/4\/0\/1\/7\/401792\/f48e9\/401792_i_1284429.jpg"],"max_de_review_present":false,"amenities_description":"<ul class=\"heading\">\n <li>\n Akzeptierte Zahlungsmittel\n <\/li>\n <li>\n<ul class=\"\">\n <li>\n Eurocard\/Mastercard \n <\/li>\n <li>\nElectronic Cash \n <\/li>\n <li>\nAmerican Express \n <\/li>\n <li>\nVisa \n <\/li>\n<\/ul>\n\n <\/li>\n <li>\nCheck in\/out\n <\/li>\n <li>\n<ul class=\"\">\n <li>\n Sp\u00e4tester Check-out 16:00 \n <\/li>\n <li>\nFr\u00fchester Check-in 16:00 \n <\/li>\n<\/ul>\n\n <\/li>\n <li>\nGratis-Leistungen f\u00fcr HRS G\u00e4ste\n <\/li>\n <li>\n<ul class=\"\">\n <li>\n Wireless LAN im Zimmer \n <\/li>\n <li>\nNutzung eines Internet-Terminals im Hotel \n <\/li>\n <li>\nParkplatz direkt am Hotel \n <\/li>\n<\/ul>\n\n <\/li>\n <li>\nHotelausstattung\n <\/li>\n <li>\n<ul class=\"\">\n <li>\n Feuermelder \n <\/li>\n <li>\nNichtraucherzimmer 10 \n <\/li>\n <li>\nParkplatz ist direkt am Hotel \n <\/li>\n <li>\nHotelbar \n <\/li>\n <li>\nFernsehraum \n <\/li>\n <li>\nHoteleigener Parkplatz Geb\u00fchr pro 24 Std. 0 EUR \n <\/li>\n <li>\nWireless LAN im \u00f6ffentlichen Bereich \n <\/li>\n <li>\nRauchmelder \n <\/li>\n <li>\nLiegewiese \n <\/li>\n <li>\nGeplante Renovierungsarbeiten 2008-01-23 bis 2008-12-31 \n <\/li>\n <li>\nMobilfunkerreichbarkeit \n <\/li>\n <li>\nAu\u00dfengastronomie \n <\/li>\n <li>\nBusparkplatz am Hotel \n <\/li>\n <li>\n\u00d6ffentliches Internet-Terminal \/ Lobby Geb\u00fchr pro Std. 0,00 EUR \n <\/li>\n <li>\nRestaurants (Anzahl) 1 \n <\/li>\n <li>\nVideo\u00fcberwachung Hotelhalle \n <\/li>\n <li>\nGartenterrasse \n <\/li>\n <li>\nRollstuhlgerechte Zimmer \n <\/li>\n <li>\nParkplatz ist gesichert \n <\/li>\n<\/ul>\n\n <\/li>\n <li>\nHotelinformationen\n <\/li>\n <li>\n<ul class=\"\">\n <li>\n Letzte Gesamt-Renovierung 2005 \n <\/li>\n <li>\nZimmer mit Verbindungst\u00fcr 1 \n <\/li>\n <li>\nHotel Garni \n <\/li>\n <li>\nAnzahl Einzelzimmer 15 \n <\/li>\n <li>\nAnzahl Doppelzimmer 35 \n <\/li>\n <li>\ndavon mit 2 getrennten Betten 5 \n <\/li>\n <li>\ndavon mit einem Doppelbett 30 \n <\/li>\n <li>\ndavon als Dreibettzimmer geeignet 3 \n <\/li>\n <li>\nGesamtanzahl Zimmer 50 \n <\/li>\n <li>\nStadthotel \n <\/li>\n <li>\nAnzahl Etagen 3 \n <\/li>\n<\/ul>\n\n <\/li>\n <li>\nLage des Hotels\n <\/li>\n <li>\n<ul class=\"\">\n <li>\n Stadtrand Ost \n <\/li>\n<\/ul>\n\n <\/li>\n <li>\nServiceleistungen im Hotel\n <\/li>\n <li>\n<ul class=\"\">\n <li>\n Schuhputzautomat \n <\/li>\n <li>\nExpress Checkout \n <\/li>\n <li>\nEnglisch sprechendes Personal tags\u00fcber \n <\/li>\n <li>\nHaustiere erlaubt Geb\u00fchr pro Tag 5 EUR \n <\/li>\n <li>\nKostenlose Tageszeitung \n <\/li>\n <li>\nGro\u00dfe Hunde erlaubt Geb\u00fchr pro Tag 5 EUR \n <\/li>\n<\/ul>\n\n <\/li>\n <li>\nZimmeraustattung\n <\/li>\n <li>\n<ul class=\"\">\n <li>\n separate Kofferablage \n <\/li>\n <li>\nBadezimmer mit Dusche \n <\/li>\n <li>\nFluchtwegkarte \n <\/li>\n <li>\nL\u00e4rmschutzfenster \n <\/li>\n <li>\nKabel-TV \n <\/li>\n <li>\nWireless LAN in allen Zimmern Geb\u00fchr pro Stunde 0,00 EUR \n <\/li>\n <li>\nFenster zum \u00d6ffnen \n <\/li>\n <li>\nTV Fernbedienung \n <\/li>\n<\/ul>\n\n <\/li>\n<\/ul>\n","longitude":13.58224,"rating_average":6.6,"alternative_packages_url":"http:\/\/apiv3.travel-iq.com\/api\/v2\/hotels\/searches\/145\/packages\/24741\/alternative_packages.json?key=example","star_rating":2,"currency":"EUR","alternative_packages_count":0,"description":"<ul class=\"\">\n <li>\n Das modern und komfortabel eingerichtete Hotel mit 50 Zimmern liegt verkehrsg\u00fcnstig aber ruhig an der s\u00fcdlichen Parallelstra\u00dfe zur B1 (Bundesstra\u00dfe 1) in Berlin Alt-Kaulsdorf, etwa 10 Minuten von der A10 entfernt.\n <\/li>\n <li>\nParkm\u00f6glichkeiten sind am Hotel ausreichend vorhanden. \r\n\r\nEine Badesee ist etwa 5 Gehminuten entfernt.\r\n\r\nEin chinesisches Restaurant (mit AllYouCanIt-Buffet f\u00fcr 6,90 EUR)befindet sich etwa 3 Gehminuten vom Hotel entfernt, ge\u00f6ffnet t\u00e4glich bis 23.00 Uhr.\r\n\r\nBitte beachten Sie: Die Rezeption ist t\u00e4glich von 16.00 bis 22.00 Uhr besetzt!\n <\/li>\n <li>\nEin High-Speed-Internetanschluss \u00fcber W-Lan ist in allen Zimmern mit Ihrem Notebook sowie \u00fcber ein Internet-Terminal im Empfangsbereich kostenlos nutzbar. SB-Bar mit Billard.\n <\/li>\n<\/ul>\n","zip":"12621","booking_url":"http:\/\/apiv3.travel-iq.com\/hotel_searches\/145\/packages\/24741\/booking?key=example","latitude":52.50307,"city":"Berlin","street":"Am Niederfeld 7","price":50.0,"amenities":["parking","restaurant","internet"],"goodies":"<ul class=\"\">\n <li>\n Parkplatz direkt am Hotel\n <\/li>\n <li>\nNutzung eines Internet-Terminals im Hotel\n <\/li>\n <li>\nWireless LAN im Zimmer\n <\/li>\n<\/ul>\n","provider_name":"HRS.de","provider_ratings":[{"rating":6.6,"provider_name":"HRS.de","ratings_url":null,"ratings_count":0}],"ratings_count_total":0,"name":"Hotel B1","search_id":145,"id":24741,"max_de_review":null,"country":"Deutschland"}} - HTML
HTML reply
<div class="package"> <span class="name"> Pension-Grand </span> <span class="price"> 74.9932 </span> <span class="currency"> EUR </span> <span class="provider_name"> Agoda </span> <a class="booking_link" href="http://apiv3.travel-iq.com/hotel_searches/23/packages/19420/booking?key=example"> Buchen </a> <span class="street"> Silbersteinstr. 82 </span> <span class="zip"> </span> <span class="city"> Berlin </span> <span class="country"> Deutschland </span> <span class="breakfast"> Ohne Frühstück </span> <span class="star_rating"> * </span> <div class="description"> </div> <a class="package_link"> Details </a> </div>
Examples of error messages
-
xml
XML reply
<?xml version="1.0" encoding="UTF-8"?> <errors> <error>Das angefragte Paket existiert nicht.</error> </errors>
-
json
JSON reply
{ "errors": ["Das angefragte Paket existiert nicht."] } -
html
HTML reply
<div id="errors"> <span id="error_header">Folgende Fehler sind aufgetreten:</span> <ul id="error_list"> <li id="error_message">Das angefragte Paket existiert nicht.</li> </ul> </div>
Search Parameters
This call returns the parameters which were used to create the search. In contrast to all other GET requests, it will not return an error if the search has expired so the parameters can be retrieved to recreate the search.
/api/v2/hotels/searches/{id}/parameters.{format} [GET]Parameters
| M | 'key' | String | Your API key |
| M | 'format' | String | 'xml', 'json' or 'html' |
| M | 'id' | Integer | The ID of the search, as returned by search |
Example
GET /api/v2/hotels/searches/123/parameters.xml?key=example
Responses
The result will be a list of parameters which where used to create the search.
If the search does not exist, the server will respond with a HTTP 404 status code.
Example
- XML
XML reply
<?xml version="1.0" encoding="UTF-8"?> <search id="1"> <search_parameters> <arrival_date>2009-06-27</arrival_date> <departure_date>2009-06-30</departure_date> <location_type>City</location_type> <location_id>37463</location_id> <single_rooms_count>1</single_rooms_count> <double_rooms_count>0</double_rooms_count> </search_parameters> </search>
- JSON
JSON reply
{ "search": { "search_parameters": { "double_rooms_count": 0, "location_id": 37463, "arrival_date": "2009-06-27", "departure_date": "2009-06-30", "single_rooms_count": 1, "location_type": "City" }, "id": 1 } }Note that the JSON output may or may not contain the whitespace as shown above.
-
HTML
HTML reply
<dl class="search" id="1"> <dt class="search_parameters">Suchparameter</dt> <dd class="search_parameters"> <dt class="arrival_date">Anreisetag</dt> <dd class="arrival_date">Sa, 27.06.09</dd> <dt class="departure_date">Abreisetag</dt> <dd class="departure_date">Di, 30.06.09</dd> <dt class="location_name">Reiseziel</dt> <dd class="location_name">München</dd> <dt class="single_rooms_count">Einzelzimmer:</dt> <dd class="single_rooms_count">1</dd> <dt class="double_rooms_count">Doppelzimmer:</dt> <dd class="double_rooms_count">keine</dd> </dd> <dl>
Alternative Packages
Travel IQ always shows the cheapest unique package in its list of results. It's quite common that several providers offer the same package, with slight price differentials, or with slightly differernt amenities. You can determine whether the package that you're currently inspecting has alternatives (as mentioned above) by checking the alternative_packages_count response variable.
If this number is greater than 0, then it is possible to obtain the details of these alternative packages with a call to /api/v2/hotels/searches/{search_id}/packages/{package_id}/alternative_packages.{format}
Parameters
- key
- Your API key
- id
- The ID of the package
- format
- xml, json or html
| M | 'key' | String | Your API key |
| M | 'format' | String | 'xml', 'json' or 'html' |
| M | 'search_id' | Integer | The ID of the search, as returned by search |
| M | 'package_id' | Integer | The ID of the package, as returned by results |
Example
GET /api/v2/hotels/searches/123/packages/456/alternative_packages.xml?key=example
Responses
The response to alternative_packages is identical in format
to the packages response (see
Search Result List
).
However, the list of packages contained in the response is that of the
alternative packages to the package which was given. So the example
above would contain only alternatives to package 456 (i.e., the same
hotel from different providers).