Get Started

Overview

The Hotel Availability Check (HAC) API allows partners that offer online hotel booking to show their availability and prices on Tripadvisor. The Availability request is made to get price and availability and is made whenever a user views a page that shows availability for a hotel connected through your system. The request can include one to many hotels. The response contains price and availability of the hotel(s) included in the request. As of API v8 checking availability could include Hotel Availability and Expanded Availability.

The HTTP or HTTPS URL to a Hotel Availability Check (HAC) API implementation is called a 'partner endpoint' or just 'endpoint'. In this documentation, the url:

http://www.partner-site.com/api_implementation

will be used as the example endpoint to a fictitious HAC API implementation.

 

General Requirements

Technical Requirements

All HAC API requests from Tripadvisor are sent as a HTTP POST request. All parameters will be application/x-www-form-urlencoded.

All responses must conform to the JSON specification and be sent with the HTTP Content-Type header set to application/json.

All responses must use UTF-8 encoding.

All responses must return status code 200 (success). Any other status code is not acceptable. This includes status in the 300s (which indicates redirection), 400s (which indicates client error), and 500s (which indicates server error).

Redirects

Responses must not redirect to another URL. All the URLs in the API below do not use a trailing slash and you cannot redirect to a URL that contains one.

Optional Fields

Fields that are marked as '[Optional]' do not need to be included in your responses. When you do not have a value for an optional field, it should be omitted entirely. Do not include the field with an empty string or other value.

JSON Data Types

There are a few datatypes used throughout this API.

String - 
      Most values are strings. Strings must have quote marks around them. As stated above, empty strings are unacceptable for optional fields. Do not use control characters like \r, \n, or \t in Strings.
Number - 
      A number can be used to represent anything from a Tripadvisor ID to a price. Numbers should not have quotes around them. Numbers can also have decimal points if needed
Boolean - 
      Can only be the word true or false. Booleans are not written in quotes.

Performance

Your API needs to perform at a certain speed in order to handle Tripadvisor traffic. For best performance, responses to HAC API requests should take no longer than 5 seconds on average.  

Additional Parameters in Tripadvisor Requests

Tripadvisor may add new parameters to its API requests at future dates. Those may not be documented at the time of your implementation so you should not validate against new parameters. These newly released parameters should not cause your API to return errors.

Test & Validate

Once you have finished building your API Endpoint, please use the API Viewer Tool to validate your endpoint.

If there are any validation issues found during the API testing, you must fix the issues before we can proceed with the integration.