5. GetHotels

Last modified by Giorgi Mdivnishvili on 2024/04/11 15:59

Method Overview

Description

The GetHotels API method is designed for fetching a curated list of hotels based on the specified country code. It enables developers to extract comprehensive hotel-related information essential for building travel, booking, or accommodation recommendation features within applications.

Use Case

To query hotels located in the United Arab Emirates, for instance, the country code "AE" must be supplied as a query parameter. This approach ensures targeted data retrieval, streamlining the process of gathering hotel information for specific locations.

Data Fields

Upon successful request, the response includes an array of hotels, each containing the following data fields:

  • Hotel ID: A unique identifier assigned to each hotel.
  • Hotel Name: The official name of the hotel.
  • Hotel Classification: A rating that categorizes the hotel, typically denoted by stars (e.g., "4" for 4-star hotels).
  • City ID: A unique code representing the city where the hotel is situated.
  • Country Code: The ISO 3166-1 alpha-2 code indicating the country of the hotel's location.
  • District ID: A unique identifier for the district encompassing the hotel.
  • City Name: The name of the city where the hotel is located.
  • District Name: The name of the district where the hotel is situated.
  • Hotel Type: Describes the hotel's category (e.g., "CityHotel", "BeachHotel").
  • Latitude and Longitude: Geographical coordinates pinpointing the hotel's location.
  • Alcohol Availability: Specifies whether the hotel serves alcohol.
  • Wi-Fi Availability: Indicates if complimentary Wi-Fi service is provided.
  • Metro/Subway Proximity: Describes the hotel's closeness to metro or subway stations.
  • Swimming Pool Availability: Identifies if there's a swimming pool available for guests.
  • Shopping Mall Proximity: Indicates the distance to the nearest shopping mall from the hotel.

Endpoint URL - [GET]

Request Parameters

To request hotel data for a specific country, the following parameter should be included in the request:

  • Key: CountryCode
  • Value: The ISO 3166-1 alpha-2 country code (e.g., "AE" for the United Arab Emirates)

Request Body

none

Response Body

[
  {
   "hotelCode": "string",
   "hotelName": "string",
   "hotelClass": "string",
   "cityUID": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
   "countryCode": "string",
   "countryName": "string",
   "districtUID": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
   "cityName": "string",
   "districtName": "string",
   "hotelType": "CityHotel",
   "latitude": "string",
   "longitude": "string",
   "hasAlcohol": true,
   "hasFreeWifi": true,
   "hasMetro": true,
   "hasPool": true,
   "hasMall": true
  }
]

example

{
       "hotelCode": "cfbca5b5-4090-4bcd-805a-463d83423b86",
       "hotelName": "Ramada Abu Dhabi Corniche",
       "hotelClass": "4",
       "cityUID": "28c794fe-3c7e-4da2-ba93-f24bd3d4730d",
       "countryCode": "AE",
       "districtUID": "ee402984-6d1d-4fcf-915d-f31b14fa8b0f",
       "cityName": "Abu Dhabi",
       "districtName": "Abu Dhabi",
       "hotelType": "CityHotel",
       "latitude": "24.503759",
       "longitude": "54.374577",
       "hasAlcohol": false,
       "hasFreeWifi": true,
       "hasMetro": false,
       "hasPool": true,
       "hasMall": false
    },
    {
       "hotelCode": "c64b6082-2337-4519-8c33-4bcdef76b16b",
       "hotelName": "Emirates Palace Mandarin Oriental, Abu Dhabi",
       "hotelClass": "5",
       "cityUID": "28c794fe-3c7e-4da2-ba93-f24bd3d4730d",
       "countryCode": "AE",
       "districtUID": "ee402984-6d1d-4fcf-915d-f31b14fa8b0f",
       "cityName": "Abu Dhabi",
       "districtName": "Abu Dhabi",
       "hotelType": "BeachHotel",
       "latitude": "24.461556",
       "longitude": "54.317404",
       "hasAlcohol": false,
       "hasFreeWifi": true,
       "hasMetro": false,
       "hasPool": true,
       "hasMall": false
    },

Schema

Success

[Hotel{

hotelCodestring
nullable: true
hotelNamestring
nullable: true
hotelClassstring
nullable: true
cityUIDstring($uuid)
nullable: true
countryCodestring
nullable: true
countryNamestring
nullable: true
districtUIDstring($uuid)
nullable: true
cityNamestring
nullable: true
districtNamestring
nullable: true
hotelTypeHotelTypeEnumstringEnum:
[ CityHotel, BeachHotel, SecondLineBeach ]
latitudestring
nullable: true
longitudestring
nullable: true
hasAlcoholboolean
hasFreeWifiboolean
hasMetroboolean
hasPoolboolean
hasMallboolean

}]

Definitions

Field NameData TypeDescription
hotelCodeStringUnique identifier for the hotel.
hotelNameStringThe name of the hotel.
hotelClassStringClassification of the hotel on a scale (e.g., "4" for 4-star).
cityUIDStringUnique identifier for the city where the hotel is located.
countryCodeStringThe ISO 3166-1 alpha-2 country code for the hotel's location.
districtUIDStringUnique identifier for the district where the hotel is located.
cityNameStringName of the city where the hotel is located.
districtNameStringName of the district where the hotel is situated.
hotelTypeStringType of hotel (e.g., CityHotel, BeachHotel, SecondLineBeach).
latitudeStringGeographic latitude of the hotel.
longitudeStringGeographic longitude of the hotel.
hasAlcoholBooleanIndicates whether alcohol is served at the hotel.
hasFreeWifiBooleanIndicates whether free Wi-Fi is available.
hasMetroBooleanIndicates the proximity of a metro/subway station to the hotel.
hasPoolBooleanIndicates whether the hotel has a swimming pool.
hasMallBooleanIndicates the proximity of a shopping mall to the hotel.