# GetBestProperty

The `GetBestProperty` API enables clients to search for the best available hotel properties within a specified destination (city or region), based on check-in/check-out dates and occupancy.

***

#### **Use Case**

Ideal for travel portals, hotel booking engines, or any partner wanting to offer real-time hotel search results by destination code.

***

#### **Endpoint**

```
GET [SD-Domain]/api/SmartDistribution/bestproperties?checkin=2025-06-09&checkout=2025-06-11&occupancy=A1&destinationCode=MLA
```

***

#### **Authentication & Authorization**

| Type      | Description                     |
| --------- | ------------------------------- |
| apikey    | API Key provided by RateGain    |
| apisecret | API Secret provided by RateGain |

***

#### **Required Headers**

| Header       | Value / Example                       |
| ------------ | ------------------------------------- |
| accept       | application/json, text/plain, \**/\** |
| apikey       | RGKEY3HVW63CF9HQU                     |
| apisecret    | SECRETLCSPQDZCMYBYJ9CU                |
| content-type | application/json                      |

***

#### **Request Body (JSON Structure)**

{\
"destinationCode": "CUN",\
"checkin": "2025-08-07",\
"checkout": "2025-08-08",\
"adults": "2",\
"children": \[],\
"numberOfrooms": 1\
}

***

### Request Parameters

| Parameter       | Type   | Required | Description                                     |
| --------------- | ------ | -------- | ----------------------------------------------- |
| destinationCode | string | Yes      | Code of the destination (from getDestinations)  |
| checkin         | string | Yes      | Check-in date in YYYY-MM-DD format              |
| checkout        | string | Yes      | Check-out date in YYYY-MM-DD format             |
| Echotoken       | string | Yes      | Unique token for tracking and response matching |
| Rooms           | array  | Yes      | List of requested room configurations           |

#### └─ Rooms Object

| Parameter    | Type  | Required     | Description                                           |
| ------------ | ----- | ------------ | ----------------------------------------------------- |
| NumberOfRoom | int   | Yes          | Number of rooms of this configuration                 |
| adults       | int   | Yes          | Number of adult guests in the room                    |
| children     | int   | Yes          | Number of children (even if 0)                        |
| paxes        | array | Δ (Optional) | Guest detail list (children age mandatory if present) |

**└── Paxes Object**

| Parameter | Type   | Required     | Description                |
| --------- | ------ | ------------ | -------------------------- |
| type      | string | Yes          | Guest type: Adult or Child |
| age       | int    | Δ (Optional) | Required if type is Child  |

***

### 📥 Response Sample

***

### 📘 Top-Level Fields

| Field       | Type        | Description                                                   |
| ----------- | ----------- | ------------------------------------------------------------- |
| status      | boolean     | Indicates whether the response was successful (true or false) |
| statusCode  | integer     | HTTP status code (e.g., 200 for success)                      |
| description | string/null | Error/response details if applicable (usually null)           |
| body        | array       | List of available hotel results                               |

***

### 🏨 Hotel Object Fields (Inside `body[]`)

| Field             | Type                     | Description                                             |
| ----------------- | ------------------------ | ------------------------------------------------------- |
| propertyId        | string                   | Unique identifier of the hotel property                 |
| propertyName      | string                   | Name of the hotel                                       |
| description       | string                   | Brief description of the hotel property                 |
| images            | array of string          | List of image URLs for the property                     |
| currency          | string                   | Currency code for the price (e.g., EUR, USD)            |
| hotelCode         | string                   | Internal hotel code                                     |
| price             | decimal                  | Starting price of the hotel (per night or package)      |
| countryCode       | string                   | Country code (ISO format)                               |
| countryName       | string                   | Full country name                                       |
| stateCode         | string                   | State code (if available)                               |
| stateName         | string                   | Full state name (if available)                          |
| destinationnCode  | string                   | Destination code (e.g., city or region)                 |
| destinationName   | string                   | Destination name                                        |
| zoneCode          | string                   | Code of the zone/area where hotel is located            |
| zoneName          | string                   | Name of the zone                                        |
| longitude         | decimal                  | Longitude of the hotel location                         |
| latitude          | decimal                  | Latitude of the hotel location                          |
| categoryCode      | string                   | Hotel category code (e.g., star rating)                 |
| categoryName      | string                   | Category name (e.g., 3-Star)                            |
| categoryGroupCode | string                   | Group code for category                                 |
| categoryGroupDesc | string                   | Description of the category group                       |
| chainCode         | string                   | Hotel chain code                                        |
| chainName         | string                   | Name of the hotel chain                                 |
| accomodationType  | string                   | Type of accommodation (e.g., hotel, apartment)          |
| accMultiDesc      | string                   | Multi-language accommodation description                |
| accTypeDesc       | string                   | Accommodation type description                          |
| address           | string                   | Full hotel address                                      |
| street            | string                   | Street name                                             |
| city              | string                   | City where the hotel is located                         |
| postalCode        | string                   | Postal code of the hotel                                |
| s2C               | string                   | Simplified star classification (e.g., 3\*)              |
| ranking           | integer                  | Ranking score (internal or public rating)               |
| hotelSegments     | array of Segment objects | Hotel features such as "Spa", "Business-friendly", etc. |
| hotelBoard        | array of Board objects   | Available board types (e.g., AI = All Inclusive)        |
| HotelFacility     | array of FacilityGroup   | Grouped facilities offered by the hotel                 |
| HotelAmenities    | array of string          | List of hotel amenities (e.g., Free Wi-Fi, Parking)     |

***

### 🧩 hotelSegments Array Fields

| Field | Type   | Description         |
| ----- | ------ | ------------------- |
| code  | string | Segment code        |
| name  | string | Segment description |

***

### 🍽️ hotelBoard Array Fields

| Field | Type   | Description                    |
| ----- | ------ | ------------------------------ |
| code  | string | Segment code (e.g., 39)        |
| name  | string | Segment name (Hotels with spa) |

***

### 🏋️ HotelFacility Array Fields

| Field             | Type                  | Description                                 |
| ----------------- | --------------------- | ------------------------------------------- |
| FacilityGroupName | string                | Name of the facility group (e.g., Wellness) |
| FacilityInfo      | array of FacilityInfo | List of individual facility items           |

***

### 🛠️ FacilityInfo Array Fields

| Field               | Type   | Description                      |
| ------------------- | ------ | -------------------------------- |
| FacilityName        | string | Name of the facility (e.g., Spa) |
| FacilityDescription | string | Description of the facility      |

***

### 📋 Common Board Codes

| Field | Type   | Description                      |
| ----- | ------ | -------------------------------- |
| code  | string | Board code (e.g., AI)            |
| name  | string | Board name (e.g., ALL INCLUSIVE) |

***

### 📝 Notes

* `images` may contain null if no URL is available.
* `hotelBoard` can be used to filter hotels based on board preferences (like breakfast included).

<br>

<br>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developer.rategain.com/our-products/smart-distribution/developer-guide/getbestproperty.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
