# Booking.com Hotel Price API

This API will help you collect data specifically from ***Booking.com*** only. Each request to this API will cost **`1`** credit.&#x20;

### Parameters

| Parameter                                                       | Description                                                      |
| --------------------------------------------------------------- | ---------------------------------------------------------------- |
| <p>api\_key<br><br><mark style="color:red;">required</mark></p> | Your personal API key.                                           |
| <p>country<br><br><mark style="color:red;">required</mark></p>  | This is the ISO code of the country where the hotel is located.  |
| <p>hotelid<br><br><mark style="color:red;">required</mark></p>  | This is the unique hotel ID used by booking.com.                 |
| <p>adults<br><br><mark style="color:red;">required</mark></p>   | It is the number of adults. The minimum value should be **`1`**. |
| <p>rooms<br><mark style="color:red;">required</mark></p>        | It is the number of rooms.                                       |
| <p>checkin<br><br><mark style="color:red;">required</mark></p>  | <p>It is the check-in date.<br><br>Format - YYYY-MM-DD</p>       |
| <p>checkout<br><br><mark style="color:red;">required</mark></p> | <p>It is the check-out date.<br><br>Format - YYYY-MM-DD</p>      |
| <p>kids<br><br><mark style="color:red;">required</mark></p>     | It is the number of kids. The minimum value can be **`0`**.      |
| <p>currency<br><br><mark style="color:red;">required</mark></p> | It could be any currency like USD, INR, EUR, etc.                |

### API Example

{% tabs %}
{% tab title="cURL" %}

```markup
curl "https://api.makcorps.com/booking?country=us&hotelid=the-lenox&checkin=2024-12-05&checkout=2024-12-11&currency=USD&kids=0&adults=2&rooms=1&api_key=6576a85d9796563d73e34228401"
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.makcorps.com/booking"
params = {
    "country": "us",
    "hotelid": "the-lenox",
    "checkin": "2024-12-05",
    "checkout": "2024-12-11",
    "currency": "USD",
    "kids": 0,
    "adults": 2,
    "rooms": 1,
    "api_key": "6576a85d9796563d73e34228401"
}

response = requests.get(url, params=params)

if response.status_code == 200:
    print(response.json())
else:
    print(f"Request failed with status code {response.status_code}")

```

{% endtab %}

{% tab title="Nodejs" %}

```javascript
const axios = require('axios');

const url = "https://api.makcorps.com/booking";
const params = {
    country: "us",
    hotelid: "the-lenox",
    checkin: "2024-12-05",
    checkout: "2024-12-11",
    currency: "USD",
    kids: 0,
    adults: 2,
    rooms: 1,
    api_key: "6576a85d9796563d73e34228401"
};

axios.get(url, { params })
    .then(response => {
        console.log(response.data);
    })
    .catch(error => {
        console.error(`Request failed with status code ${error.response.status}`);
    });

```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

$url = "https://api.makcorps.com/booking?country=us&hotelid=the-lenox&checkin=2024-12-05&checkout=2024-12-11&currency=USD&kids=0&adults=2&rooms=1&api_key=6576a85d9796563d73e34228401";

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);

if (curl_errno($ch)) {
    echo 'Request Error:' . curl_error($ch);
} else {
    $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
    if ($http_code == 200) {
        $response_data = json_decode($response, true);
        print_r($response_data);
    } else {
        echo "Request failed with status code " . $http_code;
    }
}

curl_close($ch);

?>

```

{% endtab %}
{% endtabs %}

### Response

```json
[
  [
    {
      "room": "Classic Room",
      "price": "US$1,960",
      "payment_details": [
        "Free cancellation before 4 December 2024",
        "No prepayment needed – pay at the property"
      ]
    },
    {
      "room": "Superior Queen Room with Two Queen Beds",
      "price": "US$2,460",
      "payment_details": [
        "Free cancellation before 4 December 2024",
        "No prepayment needed – pay at the property"
      ]
    },
    {
      "room": "Superior Queen Room with Two Queen Beds",
      "price": "US$2,640",
      "payment_details": [
        "Free cancellation before 4 December 2024",
        "No prepayment needed – pay at the property"
      ]
    },
    {
      "room": "Superior Queen Room with Two Queen Beds",
      "price": "US$2,820",
      "payment_details": [
        "Free cancellation before 4 December 2024",
        "No prepayment needed – pay at the property"
      ]
    },
    {
      "room": "Superior King Room",
      "price": "US$2,730",
      "payment_details": [
        "Free cancellation before 4 December 2024",
        "No prepayment needed – pay at the property"
      ]
    },
    {
      "room": "Deluxe Room One King",
      "price": "US$2,860",
      "payment_details": [
        "Free cancellation before 4 December 2024",
        "No prepayment needed – pay at the property"
      ]
    },
    {
      "room": "Deluxe Room One King",
      "price": "US$3,040",
      "payment_details": [
        "Free cancellation before 4 December 2024",
        "No prepayment needed – pay at the property"
      ]
    },
    {
      "room": "Executive Queen Room with Two Queen Beds",
      "price": "US$2,940",
      "payment_details": [
        "Free cancellation before 4 December 2024",
        "No prepayment needed – pay at the property"
      ]
    },
    {
      "room": "Executive Queen Room with Two Queen Beds",
      "price": "US$3,120",
      "payment_details": [
        "Free cancellation before 4 December 2024",
        "No prepayment needed – pay at the property"
      ]
    },
    {
      "room": "Executive Queen Room with Two Queen Beds",
      "price": "US$3,300",
      "payment_details": [
        "Free cancellation before 4 December 2024",
        "No prepayment needed – pay at the property"
      ]
    },
    {
      "room": "Executive Room with One King",
      "price": "US$3,390",
      "payment_details": [
        "Free cancellation before 4 December 2024",
        "No prepayment needed – pay at the property"
      ]
    },
    {
      "room": "Executive Room with One King",
      "price": "US$3,570",
      "payment_details": [
        "Free cancellation before 4 December 2024",
        "No prepayment needed – pay at the property"
      ]
    }
  ],
  {
    "name": "The Lenox",
    "address": "61 Exeter Street, Back Bay, Boston, MA 02116, United States"
  }
]
```


---

# 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://docs.makcorps.com/hotel-price-apis/booking.com-hotel-price-api.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.
