# Free Hotel API

API endpoint for this API is: `https://api.makcorps.com/free`

### Guide

You can pass the name of any city from any country to this API and our API will respond results according to that.&#x20;

> **This API has some limitations which has been discussed at the bottom of this page.**

Here is the list of parameters you have to pass to this API:

| Parameters | Description      |
| ---------- | ---------------- |
| city       | Name of the city |

### Usage

You have to send a GET request to <https://api.makcorps.com/auth> along with the name of the city and the JWT token you might have received from the [JWT Token API](/jwt-token-api.md).

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

```bash
curl -X GET \
  -H "Authorization: JWT eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE1MTc2NzczNjAsImlkZW50aXR5IjozLCJuYmYiOjE1MTc2NzczNjAsImV4cCI6MTUxNzY3OTE2MH0.ytSqQj3VDymEaJz9EIdskWELwDQZRD1Dbo6TuHaPz9U" \
  https://api.makcorps.com/free/london

```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = 'https://api.makcorps.com/free/london'
headers = {
    'Authorization': 'JWT eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE1MTc2NzczNjAsImlkZW50aXR5IjozLCJuYmYiOjE1MTc2NzczNjAsImV4cCI6MTUxNzY3OTE2MH0.ytSqQj3VDymEaJz9EIdskWELwDQZRD1Dbo6TuHaPz9U'
}

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

# Print the response
print(response.json())

```

{% endtab %}

{% tab title="Nodejs" %}

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

const url = 'https://api.makcorps.com/free/london';
const headers = {
  'Authorization': 'JWT eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE1MTc2NzczNjAsImlkZW50aXR5IjozLCJuYmYiOjE1MTc2NzczNjAsImV4cCI6MTUxNzY3OTE2MH0.ytSqQj3VDymEaJz9EIdskWELwDQZRD1Dbo6TuHaPz9U'
};

axios.get(url, { headers })
  .then(response => {
    console.log(response.data);
  })
  .catch(error => {
    console.error(error);
  });

```

{% endtab %}
{% endtabs %}

### Response

The sample response of the API will look somewhat like this.

```json
[
      {
        "hotelName": "ITC Grand Central, Mumbai - a Luxury Collection Hotel",
        "hotelId": "503409"
      },
      [
        {
          "price1": "180",
          "tax1": "27",
          "vendor1": "Booking.com"
        },
        {
          "price2": "180",
          "tax2": "27",
          "vendor2": "Hotels.com"
        },
        {
          "price3": "182",
          "tax3": "29",
          "vendor3": "StayForLong"
        },
        {
          "price4": "153",
          "tax4": "0",
          "vendor4": "Priceline"
        }
      ]
    ],
    [
      {
        "hotelName": "Bloom Hotel - Worli",
        "hotelId": "23526565"
      },
      [
        {
          "price1": "78",
          "tax1": "8",
          "vendor1": "Booking.com"
        },
        {
          "price2": "77",
          "tax2": "0",
          "vendor2": "Priceline"
        },
        {
          "price3": "86",
          "tax3": "9",
          "vendor3": "Trip.com"
        },
        {
          "price4": null,
          "tax4": null,
          "vendor4": "Vio.com"
        }
      ]
    ],
    [
      {
        "hotelName": "Bloom Hotel - Juhu",
        "hotelId": "23337279"
      },
      [
        {
          "price1": "72",
          "tax1": "8",
          "vendor1": "Booking.com"
        },
        {
          "price2": "90",
          "tax2": "10",
          "vendor2": "Hotels.com"
        },
        {
          "price3": "94",
          "tax3": "13",
          "vendor3": "StayForLong"
        },
        {
          "price4": "79",
          "tax4": "8",
          "vendor4": "Trip.com"
        }
      ]
    ],
    [
      {
        "hotelName": "The Oberoi Mumbai",
        "hotelId": "304225"
      },
      [
        {
          "price1": "204",
          "tax1": "31",
          "vendor1": "Booking.com"
        },
        {
          "price2": "204",
          "tax2": "31",
          "vendor2": "Hotels.com"
        },
        {
          "price3": "209",
          "tax3": "35",
          "vendor3": "StayForLong"
        },
        {
          "price4": "173",
          "tax4": "0",
          "vendor4": "Priceline"
        }
      ]
    ],
    [
      {
        "hotelName": "Radisson Blu Mumbai International Airport",
        "hotelId": "21362523"
      },
      [
        {
          "price1": "202",
          "tax1": "31",
          "vendor1": "Booking.com"
        },
        {
          "price2": "202",
          "tax2": "31",
          "vendor2": "Hotels.com"
        },
        {
          "price3": "202",
          "tax3": "31",
          "vendor3": "Expedia.com"
        },
        {
          "price4": "171",
          "tax4": "0",
          "vendor4": "Priceline"
        }
      ]
    ],
    [
      {
        "hotelName": "The Fern - Goregaon",
        "hotelId": "11774410"
      },
      [
        {
          "price1": "223",
          "tax1": "34",
          "vendor1": "Hotels.com"
        },
        {
          "price2": "220",
          "tax2": "20",
          "vendor2": "StayForLong"
        },
        {
          "price3": "180",
          "tax3": "28",
          "vendor3": "Trip.com"
        },
        {
          "price4": "165",
          "tax4": "25",
          "vendor4": "Agoda.com"
        }
      ]
    ],
```

### Understand the Response

| Properties | Description                            |
| ---------- | -------------------------------------- |
| price      | Price offered by the vendor            |
| vendor     | Name of the vendor                     |
| tax        | Tax you will be charged at the booking |
| hotelName  | Name of the hotel                      |
| hoteId     | Id of the hotel in our system          |

### Limitations of this API

Since this is the free version of our API therefore this API has some limitations.

* You will get rates for any random future dates because users will not be able to pass check-in and check-out dates to this API.
* You will only get 30 hotels for any city.&#x20;
* You cannot pass pax count like the number of adults or the number of rooms in this API.

{% hint style="info" %}
If you want to bypass these limitations then you have to gain access to our premium APIs. You can sign up for our premium APIs or if you want to test those APIs before signing up then you can contact us [here](https://share.hsforms.com/1A-iwjye2SwWRv4VHhQbBqg439wf). Remember we provide access to companies only.
{% endhint %}


---

# 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.hotelapi.co/free-hotel-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.
