# Hotel API - Search by City ID

In this API you will get a complete list of hotels in a city with the top 4 cheapest vendors.&#x20;

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

### Parameters

| Parameter                                                         | Description                                                                                                 |
| ----------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
| <p>api\_key<br><br><mark style="color:red;">required</mark></p>   | Your personal API key.                                                                                      |
| <p>cityid<br><br><mark style="color:red;">required</mark></p>     | ID of the city                                                                                              |
| <p>pagination<br><br><mark style="color:red;">required</mark></p> | It is a page number. It starts with 0 and each page will provide you almost 30 hotels.                      |
| <p>cur<br><br><mark style="color:red;">required</mark></p>        | It could be any currency like USD, INR, EUR, etc.                                                           |
| <p>rooms<br><br><mark style="color:red;">required</mark></p>      | It is the number of rooms.                                                                                  |
| <p>adults<br><br><mark style="color:red;">required</mark></p>     | It is the number of adults.                                                                                 |
| <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>                                                 |
| tax                                                               | It is a boolean. If it is set as ***`true`*** then you will get prices including tax otherwise without tax. |
| children                                                          | It represents the number of children. It has a maximum value of **10** and a minimum value of **0**.        |

###

{% hint style="info" %}
To get the ID of the city refer to our [Mapping API](https://docs.makcorps.com/mapping-api).&#x20;
{% endhint %}

### API Example

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

```bash
curl "https://api.makcorps.com/city?cityid=60763&pagination=0&cur=USD&rooms=1&adults=2&checkin=2023-12-25&checkout=2023-12-26&api_key=6576a85d9796563d73e34228401"
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.makcorps.com/city"
params = {
    'cityid': '60763',
    'pagination': '0',
    'cur': 'USD',
    'rooms': '1',
    'adults': '2',
    'checkin': '2023-12-25',
    'checkout': '2023-12-26',
    'api_key': '6576a85d9796563d73e34228401'
}

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

# Check if the request was successful (status code 200)
if response.status_code == 200:
    # Parse JSON response
    json_data = response.json()
    
    # Print or use the parsed JSON data
    print(json_data)
else:
    # Print an error message if the request was not successful
    print(f"Error: {response.status_code}, {response.text}")

```

{% endtab %}

{% tab title="Nodejs" %}

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

const url = 'https://api.makcorps.com/city';
const params = {
    cityid: '60763',
    pagination: '0',
    cur: 'USD',
    rooms: '1',
    adults: '2',
    checkin: '2023-12-25',
    checkout: '2023-12-26',
    api_key: '6576a85d9796563d73e34228401'
};

axios.get(url, { params })
    .then(response => {
        // Log or process the response data
        console.log(response.data);
    })
    .catch(error => {
        // Log or handle the error
        console.error(`Error: ${error.message}`);
    });

```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

$url = 'https://api.makcorps.com/city';
$params = array(
    'cityid' => '60763',
    'pagination' => '0',
    'cur' => 'USD',
    'rooms' => '1',
    'adults' => '2',
    'checkin' => '2023-12-25',
    'checkout' => '2023-12-26',
    'api_key' => '6576a85d9796563d73e34228401'
);

$queryString = http_build_query($params);
$fullUrl = $url . '?' . $queryString;

$response = file_get_contents($fullUrl);

// Check if the request was successful
if ($response !== false) {
    // Parse JSON response
    $json_data = json_decode($response, true);

    // Print or use the parsed JSON data
    print_r($json_data);
} else {
    // Handle the error
    echo "Error: Unable to fetch data.";
}
?>

```

{% endtab %}
{% endtabs %}

### Response

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

```json
[
  {
    "geocode": {
      "latitude": 40.762447,
      "longitude": -73.97927
    },
    "telephone": "+1 646-459-6565",
    "name": "Hilton Club The Residences New York",
    "hotelId": 14013137,
    "reviews": {
      "rating": 4.5,
      "count": 193
    },
    "vendor1": "Hilton",
    "price1": "$1,443"
  },
  {
    "geocode": {
      "latitude": 40.755814,
      "longitude": -73.96907
    },
    "telephone": "+1 844-763-7666",
    "name": "Pod 51 Hotel",
    "hotelId": 93358,
    "reviews": {
      "rating": 4,
      "count": 6176
    },
    "vendor1": "Expedia.com",
    "price1": "$215",
    "vendor2": "Booking.com",
    "price2": "$215",
    "vendor3": "Hotels.com",
    "price3": "$215",
    "vendor4": "Priceline",
    "price4": "$161"
  },
  {
    "geocode": {
      "latitude": 40.754547,
      "longitude": -73.98559
    },
    "telephone": "+1 212-730-0099",
    "name": "Luma Hotel Time Square",
    "hotelId": 10679074,
    "reviews": {
      "rating": 5,
      "count": 2583
    },
    "vendor1": "Expedia.com",
    "price1": "$375",
    "vendor2": "Booking.com",
    "price2": "$395",
    "vendor3": "Hotels.com",
    "price3": "$375",
    "vendor4": "Vio.com",
    "price4": "$359"
  },
  {
    "geocode": {
      "latitude": 40.75743,
      "longitude": -73.96978
    },
    "telephone": "+1 212-644-1300",
    "name": "Courtyard by Marriott New York Manhattan / Midtown East",
    "hotelId": 99371,
    "reviews": {
      "rating": 4.5,
      "count": 3041
    },
    "vendor1": "Expedia.com",
    "price1": "$467",
    "vendor2": "Hotels.com",
    "price2": "$467",
    "vendor3": "ZenHotels.com",
    "price3": "$478",
    "vendor4": "Algotels",
    "price4": "$419"
  },
  {
    "geocode": {
      "latitude": 40.71263,
      "longitude": -74.00919
    },
    "telephone": "+1 646-880-1999",
    "name": "Four Seasons Hotel New York Downtown",
    "hotelId": 10330604,
    "reviews": {
      "rating": 4.5,
      "count": 768
    },
    "vendor1": "Expedia.com",
    "price1": "$970",
    "vendor2": "Hotels.com",
    "price2": "$970",
    "vendor3": "FourSeasons.com",
    "price3": "$970",
    "vendor4": "Skyscanner.com",
    "price4": "$911"
  },
  {
    "geocode": {
      "latitude": 40.722992,
      "longitude": -73.997345
    },
    "telephone": "+1 212-226-6400",
    "name": "Crosby Street Hotel",
    "hotelId": 1572980,
    "reviews": {
      "rating": 5,
      "count": 916
    },
    "vendor1": "Design Hotels",
    "price1": "$965",
    "vendor2": "Booking.com",
    "price2": "$965",
    "vendor3": "Priceline",
    "price3": "$965",
    "vendor4": "Skyscanner.com",
    "price4": "$965"
  },
  {
    "geocode": {
      "latitude": 40.76444,
      "longitude": -73.978035
    },
    "telephone": "+1 212-379-0103",
    "name": "Hilton Club West 57th Street New York",
    "hotelId": 1308397,
    "reviews": {
      "rating": 4.5,
      "count": 1930
    },
    "vendor1": "Hilton",
    "price1": "$637"
  },
  {
    "geocode": {
      "latitude": 40.75642,
      "longitude": -73.98555
    },
    "telephone": "+1 212-869-1212",
    "name": "Casablanca Hotel by Library Hotel Collection",
    "hotelId": 113317,
    "reviews": {
      "rating": 5,
      "count": 7421
    },
    "vendor1": "Expedia.com",
    "price1": "$332",
    "vendor2": "Hotels.com",
    "price2": "$332",
    "vendor3": "Orbitz.com",
    "price3": "$332",
    "vendor4": "ZenHotels.com",
    "price4": "$324"
  },
  {
    "geocode": {
      "latitude": 40.7552,
      "longitude": -73.9815
    },
    "telephone": "+1 212-354-8844",
    "name": "Sofitel New York",
    "hotelId": 208454,
    "reviews": {
      "rating": 4.5,
      "count": 7856
    },
    "vendor1": "Expedia.com",
    "price1": "$569",
    "vendor2": "Hotels.com",
    "price2": "$569",
    "vendor3": "travelup.com",
    "price3": "$601",
    "vendor4": "Algotels",
    "price4": "$450"
  },
  {
    "geocode": {
      "latitude": 40.762115,
      "longitude": -73.98277
    },
    "telephone": "+1 212-581-3300",
    "name": "The Manhattan at Times Square Hotel",
    "hotelId": 93545,
    "reviews": {
      "rating": 3.5,
      "count": 12624
    },
    "vendor1": "Expedia.com",
    "price1": "$192",
    "vendor2": "Booking.com",
    "price2": "$263",
    "vendor3": "Trip.com",
    "price3": "$359",
    "vendor4": "Vio.com",
    "price4": "$177"
  },
  {
    "geocode": {
      "latitude": 40.77442,
      "longitude": -73.96312
    },
    "telephone": "+1 212-744-1600",
    "name": "The Carlyle, A Rosewood Hotel",
    "hotelId": 93419,
    "reviews": {
      "rating": 4.5,
      "count": 93
    },
    "vendor1": "Expedia.com",
    "price1": "$1,275",
    "vendor2": "Official Site",
    "price2": "$1,275",
    "vendor3": "Hotels.com",
    "price3": "$1,275",
    "vendor4": "Skyscanner.com",
    "price4": "$828"
  },
  {
    "geocode": {
      "latitude": 40.759712,
      "longitude": -73.977776
    },
    "telephone": "+1 212-863-0550",
    "name": "The Jewel Hotel",
    "hotelId": 1913413,
    "reviews": {
      "rating": 4.5,
      "count": 3371
    },
    "vendor1": "Expedia.com",
    "price1": "$342",
    "vendor2": "Hotels.com",
    "price2": "$342",
    "vendor3": "Trip.com",
    "price3": "$350",
    "vendor4": "Algotels",
    "price4": "$301"
  },
  {
    "geocode": {
      "latitude": 40.756653,
      "longitude": -73.9926
    },
    "telephone": "+1 212-706-6100",
    "name": "Distrikt Hotel New York City",
    "hotelId": 1503474,
    "reviews": {
      "rating": 4.5,
      "count": 6517
    },
    "vendor1": "Tapestry",
    "price1": "$212"
  },
  {
    "geocode": {
      "latitude": 40.764847,
      "longitude": -73.976456
    },
    "telephone": "+1 833-625-4111",
    "name": "1 Hotel Central Park",
    "hotelId": 6883205,
    "reviews": {
      "rating": 4.5,
      "count": 2629
    },
    "vendor1": "Expedia.com",
    "price1": "$499",
    "vendor2": "Booking.com",
    "price2": "$499",
    "vendor3": "Hotels.com",
    "price3": "$499",
    "vendor4": "Vio.com",
    "price4": "$470"
  },
  {
    "geocode": {
      "latitude": 40.742035,
      "longitude": -73.984634
    },
    "telephone": "+1 212-685-7700",
    "name": "Hotel Giraffe by Library Hotel Collection",
    "hotelId": 99762,
    "reviews": {
      "rating": 5,
      "count": 5228
    },
    "vendor1": "Expedia.com",
    "price1": "$302",
    "vendor2": "Hotels.com",
    "price2": "$302",
    "vendor3": "Priceline",
    "price3": "$365",
    "vendor4": "Booking.com",
    "price4": "$328"
  },
  {
    "geocode": {
      "latitude": 40.706505,
      "longitude": -74.007774
    },
    "telephone": "+1 646-598-0100",
    "name": "Mint House at 70 Pine",
    "hotelId": 8501479,
    "reviews": {
      "rating": 5,
      "count": 1361
    },
    "vendor1": "Expedia.com",
    "price1": "$274",
    "vendor2": "Hotels.com",
    "price2": "$274",
    "vendor3": "Prestigia.com",
    "price3": "$310",
    "vendor4": "Official Hotel",
    "price4": "$274"
  },
  {
    "geocode": {
      "latitude": 40.75043,
      "longitude": -73.98583
    },
    "telephone": "+1 212-239-9100",
    "name": "Hyatt Place New York / Midtown - South",
    "hotelId": 2554351,
    "reviews": {
      "rating": 4,
      "count": 3211
    },
    "vendor1": "Expedia.com",
    "price1": "$290",
    "vendor2": "Hotels.com",
    "price2": "$290",
    "vendor3": "ZenHotels.com",
    "price3": "$352",
    "vendor4": "StayForLong",
    "price4": "$277"
  },
  {
    "geocode": {
      "latitude": 40.76507,
      "longitude": -73.975266
    },
    "telephone": "+1 212-371-4000",
    "name": "Park Lane Hotel NY",
    "hotelId": 93579,
    "reviews": {
      "rating": 4,
      "count": 466
    },
    "vendor1": "Expedia.com",
    "price1": "$516",
    "vendor2": "Hotels.com",
    "price2": "$516",
    "vendor3": "Priceline",
    "price3": "$549",
    "vendor4": "ZenHotels.com",
    "price4": "$422"
  },
  {
    "geocode": {
      "latitude": 40.75643,
      "longitude": -73.98067
    },
    "telephone": "+1 646-569-6740",
    "name": "Hilton Garden Inn New York Times Square North",
    "hotelId": 23753245,
    "reviews": {
      "rating": 4.5,
      "count": 1383
    },
    "vendor1": "Hilton Garden Inn",
    "price1": "$291"
  },
  {
    "geocode": {
      "latitude": 40.756016,
      "longitude": -73.97144
    },
    "telephone": "+1 212-755-1800",
    "name": "San Carlos Hotel",
    "hotelId": 80112,
    "reviews": {
      "rating": 4.5,
      "count": 2117
    },
    "vendor1": "Expedia.com",
    "price1": "$319",
    "vendor2": "Booking.com",
    "price2": "$319",
    "vendor3": "travelup.com",
    "price3": "$320",
    "vendor4": "Algotels",
    "price4": "$255"
  },
  {
    "geocode": {
      "latitude": 40.72143,
      "longitude": -73.99933
    },
    "telephone": "+1 212-431-2929",
    "name": "The Broome",
    "hotelId": 5072714,
    "reviews": {
      "rating": 5,
      "count": 697
    },
    "vendor1": "Expedia.com",
    "price1": "$309",
    "vendor2": "Hotels.com",
    "price2": "$309",
    "vendor3": "Trip.com",
    "price3": "$1,026",
    "vendor4": "Orbitz.com",
    "price4": "$309"
  },
  {
    "geocode": {
      "latitude": 40.759163,
      "longitude": -73.99547
    },
    "telephone": "+1 646-449-7700",
    "name": "YOTEL New York Times Square",
    "hotelId": 2079052,
    "reviews": {
      "rating": 4,
      "count": 14858
    },
    "vendor1": "Expedia.com",
    "price1": "$191",
    "vendor2": "Hotels.com",
    "price2": "$191",
    "vendor3": "ZenHotels.com",
    "price3": "$203",
    "vendor4": "Algotels",
    "price4": "$168"
  },
  {
    "geocode": {
      "latitude": 40.758045,
      "longitude": -73.983574
    },
    "telephone": "+1 212-485-2400",
    "name": "The Muse New York",
    "hotelId": 217616,
    "reviews": {
      "rating": 4.5,
      "count": 3864
    },
    "vendor1": "Expedia.com",
    "price1": "$325",
    "vendor2": "Hotels.com",
    "price2": "$325",
    "vendor3": "travelup.com",
    "price3": "$448",
    "vendor4": "Algotels",
    "price4": "$273"
  },
  {
    "geocode": {
      "latitude": 40.72203,
      "longitude": -73.98859
    },
    "telephone": "1.877.460.8888",
    "name": "Sixty LES",
    "hotelId": 1128769,
    "reviews": {
      "rating": 4,
      "count": 1564
    },
    "vendor1": "Expedia.com",
    "price1": "$259",
    "vendor2": "Hotels.com",
    "price2": "$259",
    "vendor3": "Algotels",
    "price3": "$322",
    "vendor4": "ZenHotels.com",
    "price4": "$232"
  },
  {
    "geocode": {
      "latitude": 40.75048,
      "longitude": -73.983925
    },
    "telephone": "+1 212-645-0080",
    "name": "The Draper New York, Tapestry Collection by Hilton",
    "hotelId": 20021058,
    "reviews": {
      "rating": 4.5,
      "count": 559
    },
    "vendor1": "Tapestry",
    "price1": "$228"
  },
  {
    "geocode": {
      "latitude": 40.75747,
      "longitude": -73.98409
    },
    "telephone": "+1 646-364-1234",
    "name": "Hyatt Centric Times Square New York",
    "hotelId": 4799063,
    "reviews": {
      "rating": 4.5,
      "count": 6727
    },
    "vendor1": "Expedia.com",
    "price1": "$359",
    "vendor2": "Booking.com",
    "price2": "$359",
    "vendor3": "Lol.travel",
    "price3": "$1,285",
    "vendor4": "Hotels.com",
    "price4": "$359"
  },
  {
    "geocode": {
      "latitude": 40.764202,
      "longitude": -73.97852
    },
    "telephone": "+1 212-245-5000",
    "name": "Thompson Central Park New York",
    "hotelId": 93464,
    "reviews": {
      "rating": 4.5,
      "count": 486
    },
    "vendor1": "Booking.com",
    "price1": "$506",
    "vendor2": "Expedia.com",
    "price2": "$506",
    "vendor3": "ZenHotels.com",
    "price3": "$527",
    "vendor4": "Algotels",
    "price4": "$448"
  },
  {
    "geocode": {
      "latitude": 40.747093,
      "longitude": -73.98998
    },
    "telephone": "+1 212-564-4567",
    "name": "Kimpton Hotel Eventi",
    "hotelId": 1456560,
    "reviews": {
      "rating": 4.5,
      "count": 4205
    },
    "vendor1": "Expedia.com",
    "price1": "$288",
    "vendor2": "Hotels.com",
    "price2": "$288",
    "vendor3": "Trip.com",
    "price3": "$317",
    "vendor4": "Algotels",
    "price4": "$206"
  },
  {
    "geocode": {
      "latitude": 40.75757,
      "longitude": -73.9891
    },
    "telephone": "+1 212-201-2700",
    "name": "The Westin New York at Times Square",
    "hotelId": 249712,
    "reviews": {
      "rating": 4,
      "count": 4099
    },
    "vendor1": "Expedia.com",
    "price1": "$381",
    "vendor2": "Hotels.com",
    "price2": "$381",
    "vendor3": "travelup.com",
    "price3": "$439",
    "vendor4": "Algotels",
    "price4": "$302"
  },
  {
    "geocode": {
      "latitude": 40.748455,
      "longitude": -73.97804
    },
    "telephone": "+1 212-689-5200",
    "name": "The Shelburne Sonesta New York",
    "hotelId": 93543,
    "reviews": {
      "rating": 4.5,
      "count": 5813
    },
    "vendor1": "Expedia.com",
    "price1": "$240",
    "vendor2": "Booking.com",
    "price2": "$194",
    "vendor3": "Lol.travel",
    "price3": "$363",
    "vendor4": "ZenHotels.com",
    "price4": "$167"
  },
  {
    "geocode": {
      "latitude": 40.750298,
      "longitude": -73.986435
    },
    "telephone": "+1 212-564-3688",
    "name": "Hampton Inn Manhattan-35th St/Empire State Bldg",
    "hotelId": 1158763,
    "reviews": {
      "rating": 4,
      "count": 2968
    },
    "vendor1": "Hampton",
    "price1": "$257"
  },
  {
    "geocode": {
      "latitude": 40.746418,
      "longitude": -73.99081
    },
    "telephone": "+1 212-514-6699",
    "name": "Moxy NYC Chelsea",
    "hotelId": 14149815,
    "reviews": {
      "rating": 4.5,
      "count": 1202
    },
    "vendor1": "Moxy Hotels",
    "price1": "$229",
    "vendor2": "Expedia.com",
    "price2": "$229",
    "vendor3": "Algotels",
    "price3": "$253",
    "vendor4": "Booking.com",
    "price4": "$229"
  },
  {
    "geocode": {
      "latitude": 40.76442,
      "longitude": -73.98197
    },
    "telephone": "+1 212-247-2000",
    "name": "Dream Midtown",
    "hotelId": 75688,
    "reviews": {
      "rating": 4,
      "count": 1295
    },
    "vendor1": "Expedia.com",
    "price1": "$200",
    "vendor2": "Booking.com",
    "price2": "$235",
    "vendor3": "Hotels.com",
    "price3": "$200",
    "vendor4": "Orbitz.com",
    "price4": "$200"
  },
  {
    "geocode": {
      "latitude": 40.76242,
      "longitude": -73.981804
    },
    "telephone": "+1 212-581-1000",
    "name": "Sheraton New York Times Square Hotel",
    "hotelId": 93555,
    "reviews": {
      "rating": 4,
      "count": 11794
    },
    "vendor1": "Expedia.com",
    "price1": "$305",
    "vendor2": "Sheraton.com",
    "price2": "$305",
    "vendor3": "ZenHotels.com",
    "price3": "$364",
    "vendor4": "Algotels",
    "price4": "$290"
  },
  {
    "geocode": {
      "latitude": 40.720634,
      "longitude": -73.99511
    },
    "telephone": "+1 212-925-2555",
    "name": "The Nolitan Hotel",
    "hotelId": 1746459,
    "reviews": {
      "rating": 4.5,
      "count": 1100
    },
    "vendor1": "Expedia.com",
    "price1": "$187",
    "vendor2": "Hotels.com",
    "price2": "$187",
    "vendor3": "Booking.com",
    "price3": "$187",
    "vendor4": "Orbitz.com",
    "price4": "$187"
  },
  {
    "geocode": {
      "latitude": 40.75894,
      "longitude": -73.98448
    },
    "telephone": "+1 212-262-8100",
    "name": "Tempo by Hilton New York Times Square",
    "hotelId": 25364031,
    "reviews": {
      "rating": 4.5,
      "count": 157
    },
    "vendor1": "Tempo",
    "price1": "$276",
    "vendor2": "Expedia.com",
    "price2": "$276",
    "vendor3": "Booking.com",
    "price3": "$310",
    "vendor4": "Hotels.com",
    "price4": "$276"
  },
  {
    "geocode": {
      "latitude": 40.72794,
      "longitude": -73.99078
    },
    "telephone": "+1 212-475-5700",
    "name": "The Standard, East Village",
    "hotelId": 1149402,
    "reviews": {
      "rating": 4.5,
      "count": 1440
    },
    "vendor1": "Expedia.com",
    "price1": "$295",
    "vendor2": "Hotels.com",
    "price2": "$295",
    "vendor3": "Priceline",
    "price3": "$329",
    "vendor4": "Agoda.com",
    "price4": "$247"
  },
  [
    {
      "totalHotelCount": 910,
      "totalpageCount": 30,
      "currentPageHotelsCount": 37,
      "currentPageNumber": 1
    }
  ]
]
```

### Understand the Response

| Properties             | Description                               |
| ---------------------- | ----------------------------------------- |
| price                  | Price offered by the vendor               |
| vendor                 | Name of the vendor                        |
| telephone              | Telephone number of the hotel             |
| geocode                | Geolocation of the hotel                  |
| rating                 | Average rating of the hotel               |
| count                  | Number of reviews                         |
| hotelId                | ID of the hotel                           |
| name                   | Name of the hotel                         |
| totalHotelCount        | Total  Number of Hotels in this city      |
| totalpageCount         | Total Pages                               |
| currentPageHotelsCount | Total hotels returned with this API call. |
| currentPageNumber      | This is the current page number.          |

{% hint style="info" %}
Each call in this pattern to our API will be counted as 1 API request. That means for every request to our API you will get 30 hotels in that target city.
{% 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.makcorps.com/hotel-price-apis/hotel-api-search-by-city-id.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.
