REST API Tutorials

How to Use the Hotels.com API with Python, PHP, Ruby & JavaScript Examples

The Hotels.com API allows developers to search a global database of vacation rentals, hotel packages, and other travel deals to book reservations or generate custom displays of listings. The Hotels.com website includes a wide array of global travel options such as hotels, tour packages, car rentals, and flight ticketing. Hotels.com also offers customers a travel rewards program and credit card. Developers of websites and mobile applications can use the Hotels.com API to search, retrieve, and embed travel information in their display pages that can be used for advertising or reservations.

The RapidAPI service offers free access to the Hotels.com API for programmers. The API allows developers to easily build custom solutions for promoting travel bookings. This tutorial will review the PHP, Python, Ruby, and JavaScript code snippets that are required for establishing the most common endpoints of the system. Programmers can access the Hotels.com service by registering an API key from RapidAPI. Sign up for a free account at RapidAPI to test and generate the code for the Hotels.com API service.

Connect to the Hotels API

1. About the Hotels.com API Service

There are five main queries that can be implemented with the free Hotels.com API service through RapidAPI. The first is a property details query, which will allow developers to search a hotel for room availability across a range of given dates. The second is an image query that will return the stock image for the hotel by ID number. There is also a query that allows developers to search and return a list of hotels near a particular location by longitude/latitude coordinates. The hotel ID number can be used to return a list of reviews from users about the destination. The suggestions query will return a list of hotels by keyword location, such as “New York” or “San Francisco”.

The Hotels.com API supports hotel listings in over 100 different countries worldwide. Developers can use the longitude and latitude of an address to return a list of hotels near a particular location. After retrieving the hotel ID number, unique information like the user reviews, photos of the rooms, and the availability of reservations can be queried individually. The use of keyword locations like international city names allows developers to automate the Hotels.com API around their taxonomy terms in order to auto-generate listings for websites and mobile applications. The results can be used as a resource for search engines and travel agencies, or as advertising for blogs and travel websites.

Hotels.com: “Access the app from your iPhone, iPad, or Android device.”

2. What is the Hotels.com API?

The Hotels.com API is part of the Expedia Group and is operated under their Partner Solutions. The EPS Rapid API from Expedia supports over 400,000 intelligent geography definitions and allows search across 650,000 accommodation listings with rich content for displays. The Hotels.com API displays competitive rates for hotel room reservations and travel deals. The database includes over 13 million property images and 7.5 million room images that can be retrieved by search engines and travel apps. The Hotels.com API allows you to limit results to a specific number of items and determine the number of pages returned for each display through query variables.

The Hotels.com API is a RESTful API with enhanced capabilities for targeted requests that allow publishers to upsell travel listings and increase conversion rates through associated content recommendations. Travelers can search across Expedia listings that include over 75 million user reviews. The keyword search with the Hotels.com API allows for the top travel listings per region to be displayed dynamically in websites and mobile applications in association with an Expedia affiliate account. This allows web publishers to earn commissions for the web traffic or travel bookings that they serve. There are also options to integrate with the Expedia Travel Agent Affiliate Program.

Search & Compare Hotel Prices: “Hotels.com is a strong brand and a leading provider of lodging accommodations worldwide, from international chains and all-inclusive resorts to local favorites and bed & breakfasts, together with all the information needed to book the perfect stay. The site is localized across 85 websites around the world and is available in over 35 languages.” Learn more about Hotels.com.

3. How does the Hotels.com API work?

The Hotels.com API is a RESTful API that communicates in JSON over HTTP connections using a Swagger file for configuration. Swagger is an open-source developer utility and allows the service to implement the OpenAPI standard for functionality. The Hotels.com API is a limited version of the Expedia API designed for listings specifically on the domain. The API returns travel listing information like hotel rooms in a region according to keyword or longitude/latitude coordinates.

The Hotels.com API will also retrieve vendor information like the description and photos from the hotel facilities that are listed on the domain. Developers can build custom displays with this information into their applications using the API with over 20 different programming languages. The Expedia API requires an SHA-512 signature hash with a Unix timestamp to access the service, and websites or applications using the API must be reviewed by the company before going live. By signing up for the RapidAPI service, developers can generate the code snippets required for use with free authorization.

RapidAPI provides free access to the Hotels.com API which is limited to 50 requests per day and one request per second. For applications that require unlimited support for queries using the Hotels.com API, RapidAPI offers this upgrade at the cost of a $259 per month subscription. The Hotels.com API has 95% uptime and latency of 1.139 ms per query on average. The Hotels.com API authorization key is provided by RapidAPI and trusted by over 3 million developers worldwide for thousands of different services.

 

Subscribe on RapidAPI: “Starting with the Hotels.com FREE API – you have access to an extensive ecosystem to accelerate your development process.” Learn more.

4. Who is the Hotels.com API for exactly?

The Hotels.com API is designed for use by developers building travel applications and web publishers that seek to embed dynamic advertising content in their websites. Hotels.com has an affiliate program for advertisers which can be used by bloggers who display dynamic listings or search results on their web pages. Hotels.com also has a travel agency partnership program that is for professional use and can provide full booking services for hotel room reservations. The Hotels.com service is worldwide and supports more than 35 languages. The ability to pull in user reviews of hotels is an advantage for publishers looking to add targeted dynamic content to travel applications.

RapidAPI has a developer sandbox environment that will generate the code required to use the Hotels.com API with over 20 programming languages. PHP publishers running CMS scripts with WordPress, Drupal, and Joomla can easily add dynamic content to pages or blocks using the API. Python developers can add the code snippets to a framework like Django or Flask. There are similar app builder frameworks for most other programming languages that can be integrated through RapidAPI’s automated code generation service. The RapidAPI sandbox also allows developers to sculpt queries by inserting the specific keyword or longitude/latitude coordinates.

Programmers can use the Hotels.com API to publish search results for travel listings and hotel rooms on their website according to the requirements of their particular sales & marketing strategy. The ability to automate the API with application code makes the Hotels.com service a good way to build affiliate income for travel bloggers or publishers. The RapidAPI service is not designed to support the travel agency partnership search and booking capabilities. The free access to the Hotels.com API through RapidAPI allows developers to unify all of their API key information across service providers, custom applications, and websites.

5. Tutorial: How to Connect to the Hotels.com API

To connect to the Hotels.com API, log in to RapidAPI and navigate to the playground environment for the service. Under the “Endpoints” tab, there is a reference table with a drop-down menu supporting all of the available web & mobile programming languages. Developers can use the RapidAPI website to generate their custom query code by entering keywords, geolocation, and hotel ID information into the easy-to-use form.

The Hotels.com API has code snippets available for more than 20 of the most popular programming languages for web design and mobile app development currently. You can copy and paste the code snippets from RapidAPI directly into your apps with a valid User ID. Use the playground environment to test endpoints and API variables by embedding the snippets in blocks for CMS websites that need dynamic content.

PHP Code Snippets:

For PHP applications and websites, there are four different methods that the code can be input into a web page. Developers can use cUrl, HTTP, or a Unirest request.

To embed the Hotels.com API with cUrl in PHP:

<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://hotels-com-free.p.rapidapi.com/pde/property-details/v1/hotels.com/106346?rooms=1&checkIn=2021-01-27&checkOut=2021-01-28&locale=en_US&currency=USD&include=neighborhood",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "x-rapidapi-host: hotels-com-free.p.rapidapi.com",
    "x-rapidapi-key: insert-your-RapidAPI-key-here"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}

To embed the Hotels.com API with a HTTP request in PHP:

<?php

$request = new HttpRequest();
$request->setUrl('https://hotels-com-free.p.rapidapi.com/pde/property-details/v1/hotels.com/106346');
$request->setMethod(HTTP_METH_GET);

$request->setQueryData([
  'rooms' => '1',
  'checkIn' => '2021-01-27',
  'checkOut' => '2021-01-28',
  'locale' => 'en_US',
  'currency' => 'USD',
  'include' => 'neighborhood'
]);

$request->setHeaders([
  'x-rapidapi-key' => 'insert-your-RapidAPI-key-here',
  'x-rapidapi-host' => 'hotels-com-free.p.rapidapi.com'
]);

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}

To use an alternative HTTP method with the Hotels.com API in PHP:

<?php

$client = new http\Client;
$request = new http\Client\Request;

$request->setRequestUrl('https://hotels-com-free.p.rapidapi.com/pde/property-details/v1/hotels.com/106346');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
  'rooms' => '1',
  'checkIn' => '2021-01-27',
  'checkOut' => '2021-01-28',
  'locale' => 'en_US',
  'currency' => 'USD',
  'include' => 'neighborhood'
]));

$request->setHeaders([
  'x-rapidapi-key' => 'insert-your-RapidAPI-key-here',
  'x-rapidapi-host' => 'hotels-com-free.p.rapidapi.com'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();

Add the Hotels.com API to your PHP code with a Unirest request:

<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://hotels-com-free.p.rapidapi.com/pde/property-details/v1/hotels.com/106346?rooms=1&checkIn=2021-01-27&checkOut=2021-01-28&locale=en_US&currency=USD&include=neighborhood",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "x-rapidapi-host: hotels-com-free.p.rapidapi.com",
    "x-rapidapi-key: insert-your-RapidAPI-key-here"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}

Make sure to replace the placeholder text with your custom API key from RapidAPI.

Python Code Snippets:

For Python applications and websites, there are three different methods that the Hotels.com API code can be input into apps. Developers can use the HTTP client, an import request, or a Unirest command to embed the functionality in a display page.

To embed the Hotels.com API with the HTTP Client in Python:

import http.client

conn = http.client.HTTPSConnection("hotels-com-free.p.rapidapi.com")

headers = {
    'x-rapidapi-key': "insert-your-RapidAPI-key-here",
    'x-rapidapi-host': "hotels-com-free.p.rapidapi.com"
    }

conn.request("GET", "/pde/property-details/v1/hotels.com/106346?rooms=1&checkIn=2021-01-27&checkOut=2021-01-28&locale=en_US&currency=USD&include=neighborhood", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))

To add the Hotels.com API with a Python import request:

import requests

url = "https://hotels-com-free.p.rapidapi.com/pde/property-details/v1/hotels.com/106346"

querystring = {"rooms":"1","checkIn":"2021-01-27","checkOut":"2021-01-28","locale":"en_US","currency":"USD","include":"neighborhood"}

headers = {
    'x-rapidapi-key': "insert-your-RapidAPI-key-here",
    'x-rapidapi-host': "hotels-com-free.p.rapidapi.com"
    }

response = requests.request("GET", url, headers=headers, params=querystring)

print(response.text)

To embed the Hotels.com API with a Unirest command in Python:

import http.client

conn = http.client.HTTPSConnection("hotels-com-free.p.rapidapi.com")

headers = {
    'x-rapidapi-key': "insert-your-RapidAPI-key-here",
    'x-rapidapi-host': "hotels-com-free.p.rapidapi.com"
    }

conn.request("GET", "/pde/property-details/v1/hotels.com/106346?rooms=1&checkIn=2021-01-27&checkOut=2021-01-28&locale=en_US&currency=USD&include=neighborhood", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))

Make sure to replace the placeholder text with your custom API key from RapidAPI.

Ruby Code Snippets:

For Ruby applications and websites, there are two different methods that the Hotels.com API code can be input into a web page. Developers can use a net::HTTP request or a Unirest command.

To embed the Hotels.com API with a net::HTTP request in Ruby:

require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://hotels-com-free.p.rapidapi.com/pde/property-details/v1/hotels.com/106346?rooms=1&checkIn=2021-01-27&checkOut=2021-01-28&locale=en_US&currency=USD&include=neighborhood")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["x-rapidapi-key"] = 'insert-your-RapidAPI-key-here'
request["x-rapidapi-host"] = 'hotels-com-free.p.rapidapi.com'

response = http.request(request)
puts response.read_body

To embed the Hotels.com API with a Unirest command in Ruby:

require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://hotels-com-free.p.rapidapi.com/pde/property-details/v1/hotels.com/106346?rooms=1&checkIn=2021-01-27&checkOut=2021-01-28&locale=en_US&currency=USD&include=neighborhood")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["x-rapidapi-key"] = 'insert-your-RapidAPI-key-here'
request["x-rapidapi-host"] = 'hotels-com-free.p.rapidapi.com'

response = http.request(request)
puts response.read_body

Make sure to replace the placeholder text with your custom API key from RapidAPI.

JavaScript Code Snippets:

For JavaScript applications and websites, there are four different methods that the code can be input into a web page. Developers can use jQuery, fetch, an XML HTTP request, or Axios to build displays for the application.

To embed the Hotels.com API with jQuery in JavaScript:

const settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://hotels-com-free.p.rapidapi.com/pde/property-details/v1/hotels.com/106346?rooms=1&checkIn=2021-01-27&checkOut=2021-01-28&locale=en_US&currency=USD&include=neighborhood",
  "method": "GET",
  "headers": {
    "x-rapidapi-key": "insert-your-RapidAPI-key-here",
    "x-rapidapi-host": "hotels-com-free.p.rapidapi.com"
  }
};

$.ajax(settings).done(function (response) {
  console.log(response);
});

To add the Hotels.com API with an XML HTTP request in JavaScript:

const data = null;

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://hotels-com-free.p.rapidapi.com/pde/property-details/v1/hotels.com/106346?rooms=1&checkIn=2021-01-27&checkOut=2021-01-28&locale=en_US&currency=USD&include=neighborhood");
xhr.setRequestHeader("x-rapidapi-key", "insert-your-RapidAPI-key-here");
xhr.setRequestHeader("x-rapidapi-host", "hotels-com-free.p.rapidapi.com");

xhr.send(data);

To insert the Hotels.com API with fetch in JavaScript:

fetch("https://hotels-com-free.p.rapidapi.com/pde/property-details/v1/hotels.com/106346?rooms=1&checkIn=2021-01-27&checkOut=2021-01-28&locale=en_US&currency=USD&include=neighborhood", {
  "method": "GET",
  "headers": {
    "x-rapidapi-key": "insert-your-RapidAPI-key-here",
    "x-rapidapi-host": "hotels-com-free.p.rapidapi.com"
  }
})
.then(response => {
  console.log(response);
})
.catch(err => {
  console.error(err);
});

To use the Hotels.com API with Axios in JavaScript:

import axios from "axios";

const options = {
  method: 'GET',
  url: 'https://hotels-com-free.p.rapidapi.com/pde/property-details/v1/hotels.com/106346',
  params: {
    rooms: '1',
    checkIn: '2021-01-27',
    checkOut: '2021-01-28',
    locale: 'en_US',
    currency: 'USD',
    include: 'neighborhood'
  },
  headers: {
    'x-rapidapi-key': 'insert-your-RapidAPI-key-here',
    'x-rapidapi-host': 'hotels-com-free.p.rapidapi.com'
  }
};

axios.request(options).then(function (response) {
  console.log(response.data);
}).catch(function (error) {
  console.error(error);
});

Make sure to replace the placeholder text with your custom API key from RapidAPI.

6. Endpoints of the Hotels.com API

The Hotels.com FREE API has 5 main endpoints which allow developers to pull targeted search listings from the website. The free API service has less functionality than Expedia’s EPS Rapid API, but the two work together integrally. The main difference is the authorization key provider which is managed through RapidAPI in this instance.

The five main endpoints of the Hotels.com API are:

  • GET details
  • GET images
  • GET search nearby
  • GET reviews
  • GET suggest

With each of these endpoints, there is a wide range of flexibility that allows developers to target information across the full worldwide listings of Hotel.com in a dynamic way.

An example of the data returned from the GET details query is :

{3 items
"result":"OK"
"data":{2 items
"body":{13 items
"pdpHeader":{6 items
"hotelId":"106346"
"destinationId":"1493604"
"pointOfSaleId":"HCOM_US"
"currencyCode":"USD"
"occupancyKey":"A1"
"hotelLocation":{...}3 items
}
"overview":{1 item
"overviewSections":[...]3 items
}
"hotelWelcomeRewards":{2 items
"applies":true
"info":"You can collect Hotels.com(r) Rewards stamps here"
}
"propertyDescription":{12 items
"clientToken":"DjiPdaXUcsTfR-wyVpg8-ylCXkw."
"address":{...}8 items
"priceMatchEnabled":false
"name":"Marriott San Francisco Fisherman's Wharf"
"starRatingTitle":"4 stars"
"starRating":4
"featuredPrice":{...}7 items
"mapWidget":{...}1 item
"renovationInfo":"The following facilities or services will be unavailable from June 1 2021 to October 1 2021 (dates subject to change): <ul><li>Dining venue(s)</li><li>Fitness facilities</li></ul>"
"roomTypeNames":[...]6 items
"tagline":[...]1 item
"freebies":[]0 items
}
"guestReviews":{1 item
"brands":{...}7 items
}
"atAGlance":{3 items
"keyFacts":{...}4 items
"travellingOrInternet":{...}2 items
"transportAndOther":{...}3 items
}
"amenities":[2 items
0:{...}2 items
1:{...}2 items
]
"hygieneAndCleanliness":{3 items
"title":"COVID-19: Hygiene and cleanliness"
"hygieneQualifications":{...}2 items
"healthAndSafetyMeasures":{...}3 items
}
"smallPrint":{6 items
"alternativeNames":[...]10 items
"mandatoryFees":[...]1 item
"optionalExtras":[...]4 items
"policies":[...]2 items
"mandatoryTaxesOrFees":true
"display":true
}
"specialFeatures":{1 item
"sections":[...]1 item
}
"miscellaneous":{3 items
"pimmsAttributes":"DoubleStamps|TESCO"
"showLegalInfoForStrikethroughPrices":true
"legalInfoForStrikethroughPrices":"The struck-out price is based on the property's standard rate on our app, as determined and supplied by the property."
}
"pageInfo":{3 items
"pageType":"dateless"
"errors":[...]1 item
"errorKeys":[...]1 item
}
"unavailable":{0 items
}
}
"common":{2 items
"pointOfSale":{...}2 items
"tracking":{...}2 items
}
}
"neighborhood":{4 items
"neighborhoodName":"Union Square"
"neighborhoodImage":"https://a.cdn-hotels.com/gdcs/production101/d1430/62cad3f0-c19f-11e7-aa7f-0242ac1100ec.jpg"
"neighborhoodShortDescription":""
"neighborhoodLongDescription":"Union Square is acclaimed for its architecture and museums, and visitors here can explore SHN Curran Theatre and Powell and Market Cable Car Turnaround. This walkable neighborhood in San Francisco is well-known for its theaters, restaurants, and cafés. <br/><br/>Appreciated for its art, this neighborhood's cultural attractions include Golden Gate Theatre and Alcove Theater. You can browse for treasures at Westfield San Francisco Centre, Maiden Lane, and Westfield Metreon. "
}

This data can be used with the GET images query using the same hotel ID number to generate custom displays in applications and websites that match the theme design.

For the GET search nearby query, the check-in/check-out date range is entered with a set of geolocation coordinates based on longitude and latitude. The number of rooms required and the country code are also variables. The endpoint returns a list of dynamic content about the hotel rooms available in a specific geo-location.

An example of the endpoint data returned by the GET search nearby query is:

{2 items
"result":"OK"
"data":{2 items
"body":{7 items
"header":"149 New Montgomery St, San Francisco, CA 94105, USA"
"query":{...}1 item
"searchResults":{3 items
"totalCount":476
"results":[8 items
0:{19 items
"id":141179
"name":"Palace Hotel, a Luxury Collection Hotel, San Francisco"
"starRating":5
"urls":{}0 items
"address":{...}8 items
"guestReviews":{...}6 items
"landmarks":[...]2 items
"geoBullets":[]0 items
"ratePlan":{...}2 items
"neighbourhood":"Financial District"
"deals":{}0 items
"messaging":{}0 items
"badging":{}0 items
"pimmsAttributes":"DoubleStamps|priceRangeCA|priceRangeUK|TESCO"
"coordinate":{...}2 items
"providerType":"LOCAL"
"supplierHotelId":27274
"isAlternative":false
"optimizedThumbUrls":{...}1 item
}
1:{...}19 items
2:{...}19 items
3:{...}19 items
4:{...}19 items
5:{...}19 items
6:{...}19 items
7:{...}19 items
]
"pagination":{...}5 items
}
"sortResults":{...}1 item
"pointOfSale":{...}1 item
"miscellaneous":{3 items
"pageViewBeaconUrl":"/taps/v1/PageView?deviceType=App-Phone&sort-order=DISTANCE_FROM_LANDMARK&rooms=1&hotelIds=141179,129368,114219,235570,145299,108742,195370,170879&adults=1&userAgent=Hotels.com/Android%2056.1.1.9.release-56_1%20(56010472)&userGuid=7907534a-f458-4f4d-94f7-9057ed3e62ba&pageName=Hotel-Search&slots=HSR_A,HSR_B,HSR_C,HSR_D,HSR_E,HSR_F,HSR_G,HSR_H,HSR_I,HSR_J&children=0&culture=en_US&testVersionOverride=4961.0,904.0,7561.0,7215.0,8218.0,8711.0,8928.1,9008.0,8347.2,9004.0,8952.0,7992.2,8915.0,9729.0,9716.0,9864.0,10155.0,10185.0,10320.0&domain=www.hotels.com&userIP=127.0.0.1&action=pageview&publisher=expedia&programId=1"
"showLegalInfoForStrikethroughPrices":true
"legalInfoForStrikethroughPrices":"The struck-out price is based on the property's standard rate on our app, as determined and supplied by the property."
}
"pageInfo":{1 item
"pageType":"dateless"
}
}
"common":{2 items
"pointOfSale":{...}2 items
"tracking":{...}1 item
}
}
}

It will take some trial and error to customize the data from the endpoint results into a custom display for your websites and mobile applications.

The GET reviews and GET suggest queries are simpler, with only two variables per request. The GET reviews query requires the hotel ID number and the country code for language support. The endpoint returns a list of user review information about the hotel. The GET suggest query allows for developers to enter a city keyword like “New York” or “San Francisco” and the locale variable which is the country code. The API will then return a list of hotel vacancies that are available in the destination. Both of these endpoints will need to be customized by the developer to display to match their apps.

Booking.com API: “If the software is connected to the hotel booking API, you can register property and modify content (photos, rates, rooms, facilities) directly in the interface, without using the booking.com website.” Learn more about Travel APIs.

7. Alternatives to the Hotels.com API

There is an alternative version of the Hotels.com API that is hosted by RapidAPI and is developed by Tipsters CO. The basic functionality is the same, but there are six endpoints available that may make it easier to sort results for developers. In the travel industry, there are many competitors to Expedia and Hotels.com. Some of the best are:

Publishers can search the relevant affiliate account and advertising information to decide which solution works best for their websites and mobile applications. Experienced programmers may be able to combine services to retrieve travel search results from multiple providers. The RapidAPI sandbox gives developers a free API access key for each service as well as a free tier for usage to test the functionality.

Expedia EPS Rapid API: “A quick, light API product that lets you customize your hotel bookings end-to-end, from shopping to booking to payment.” Learn more.

8. What are the benefits of the Hotels.com API?

Hotels.com is one of the leading brands in the travel industry and builds upon Expedia’s global range to support more than 100 different countries. There are 85 local versions of Hotels.com that regional customers can access in their own language. For travelers, they can find the cheapest prices on hotel listings internationally using the service. It is possible to query individual hotels for room availability using the free API service, but you need an upgrade to book reservations directly under white-label. Most web publishers and mobile applications use the Hotels.com API with their affiliate program for advertising income on content recommendations in sidebars, banners, or blocks.

Hotels.com has a Price Guarantee and a Loyalty program that are of value to travelers and vacationers. With the Loyalty program, customers earn a free hotel night for every 10 nights booked. The search functionality also supports last-minute deals on hotel reservations, flights, and other travel promotions. Affiliates earn a commission for sales and can use the API to import specific listing information for travel destinations that support their content. There are almost unlimited ways that web publishers can use Hotels.com to earn affiliate income when blogging about travel.

With the RapidAPI service, developers can instantly generate code snippets for 20+ different programming languages. Just copy and paste the code into your apps or CMS websites. Some endpoints may require customization with CSS or HTML to match your website or application theme. The benefit of the RapidAPI service is that it does not require registration with Hotels.com or Expedia directly to test or use in production. There is also a professional upgrade option for high-traffic application requirements.

9. Developer Resources for the Hotels.com API

For background information on the Hotels.com API, review the extensive online resources available about RESTful APIs, JSON, Swagger, and the OpenAPI specification. Compare the Hotels.com and Expedia affiliate programs, as well as those of competitors who offer similar API search functionality. Application developers can direct the traffic to Hotels.com for final purchase, checkout, and payment. Travel agencies should consider the upgrade to professional white-label services for bookings.

For technical background information on RESTful APIs, OpenAPI, & Swagger:

Developers using the Hotels.com API can also look into the way that the Google Travel API implements OAuth 2.0 with RESTful API services. View the technical documentation here. The Hotels.com API favorably compares to the Top 10 travel API, reservation, and booking services, as shown in this article by Yasu at Rakuten.

10. Summary: Global Travel Listings & Hotel Bookings

The travel and tourism industry generated around $3 trillion dollars in economic activity globally in 2019 before the Covid pandemic. The Hotels.com website has millions of travel listings across more than 100 countries with localized versions in 35 different languages. Travel bloggers can use the keyword and geolocation functionality of the Hotels.com API to add dynamic content about tourism destinations to their websites and mobile apps. Combined with the Hotels.com affiliate program, this can add extra income for publishers. Travel agencies can upgrade to Expedia’s Rapid API service for booking reservations directly. Otherwise, checkout is guaranteed by the Hotels.com service.

The Hotels.com API allows publishers to search across over 600,000 accommodation listings worldwide, with 13 million images that can be imported to custom displays along with user reviews of each business. The keyword search recognizes over 400,000 geolocations intelligently. Travelers can book the best prices on hotel rooms, while publishers can earn commissions on their web traffic recommendations using the Hotels.com affiliate program. The JSON functionality of the Hotel.com API allows developers to query dynamic content and build custom displays that match the theme of their apps. Use the Hotels.com API with over 20 programming languages at RapidAPI.

Connect to the Hotels API
5/5 - (1 vote)
Share
Published by

Recent Posts

Power Up Your Enterprise Hub: New March Release Boosts Admin Capabilities and Streamlines Integrations

We're thrilled to announce the latest update to the Rapid Enterprise API Hub (version 2024.3)!…

2 weeks ago

Unveiling User Intent: How Search Term Insights Can Empower Your Enterprise API Hub

Are you curious about what your API consumers are searching for? Is your Hub effectively…

2 weeks ago

Rapid Enterprise API Hub Levels Up Custom Branding, Monetization, and Management in February Release

The RapidAPI team is excited to announce the February 2024 update (version 2024.2) for the…

1 month ago

Supercharge Your Enterprise Hub with January’s Release: Search Insights, Login Flexibility, and More!

This January's release brings exciting features and improvements designed to empower you and your developers.…

3 months ago

Enhanced Functionality and Improved User Experience with the Rapid API Enterprise Hub November 2023 Release

Rapid API is committed to providing its users with the best possible experience, and the…

5 months ago

The Power of Supporting Multiple API Gateways in an API Marketplace Platform

In today's fast-paced digital world, APIs (Application Programming Interfaces) have become the backbone of modern…

6 months ago