# Read the raw hotel documents by id

> Reads the cached hotel documents of up to 200 hotels, by id, exactly as FX-Port stores them: the FULL fields plus images_ext (the photos with their category) and policy_struct.

Endpoint: `POST /hotels/details`

Source: https://fx-port.com/docs/api/get-hotel-details

`POST /api/v1/hotels/details`

Requires an API key with **Read** permission; a **Read+Write** key works too.

The default `detail_level=full` is about 27% larger than `POST /hotels/search` for the same hotel and adds nothing most clients need: prefer `POST /hotels/search` (or `get_hotel_info` for one hotel). With `detail_level=minimal` the answer is the mini card, and `images_limit` keeps the first N photos of each card. Like `POST /hotels/search` it reads the cache only, returns a bare array in no particular order, leaves out ids it does not hold and also looks an id made of digits up as the supplier's numeric `hid`.

## Request

### Query parameters

- `detail_level` (string, optional): `full` (default): the raw document. `minimal` (alias `mini`): the compact card. One of `minimal`, `mini`, `full`. Default `full`.
- `images_limit` (integer, optional): With `detail_level=minimal` (alias `mini`): keep only the first N photos of each card, 0 to 30. With `detail_level=full` it is ignored and the answer carries a `coerced_value` warning. A number outside 0 to 30 answers `400 invalid_images_limit`. Between 0 and 30.
- `detailLevel` (string, deprecated, optional): Legacy name: use `detail_level`. The detail level, in its older spelling. Use `detail_level`.
- `imagesLimit` (integer, deprecated, optional): Legacy name: use `images_limit`. The photo limit, in its older spelling. Use `images_limit`.

### Body

Required, JSON.

- `hotel_ids` (array of string, required): The ids of the hotels, at most 200. An id made of digits is also looked up as the supplier's numeric `hid`: `[8473727]` finds the hotel. Spaces around an id are trimmed. Duplicates are dropped; the answer does not follow your order. At most 200 items.
- `hotelIds` (array of string, deprecated, optional): Legacy name: use `hotel_ids`. The hotel ids, in their older spelling. Use `hotel_ids`.
- `ids` (array of string, deprecated, optional): Legacy name: use `hotel_ids`. The hotel ids, in their older spelling. Use `hotel_ids`.

### Example request

```bash
curl 'https://api.fx-port.com/api/v1/hotels/details?detail_level=minimal&images_limit=1' \
  -H "Authorization: Bearer fxp_test_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "hotel_ids": [
    "test_hotel_do_not_book"
  ]
}'
```

## Response

### 200: The documents found, as a bare JSON array.

```json
[
  {
    "id": "test_hotel_do_not_book",
    "hid": 8473727,
    "name": "Test Hotel (Do Not Book) test",
    "kind": "Apartment",
    "hotel_chain": "No chain",
    "address": "Avenida Roble, Frente al Mall Multiplaza, Tegucigalpa",
    "postal_code": null,
    "latitude": 14.079872,
    "longitude": -87.21677,
    "region": {
      "id": 3421,
      "country_code": "HN",
      "iata": "TGU",
      "name": "Tegucigalpa",
      "type": "City",
      "type_v2": "city"
    },
    "star_rating": 0,
    "star_certificate": null,
    "email": "test@example.com",
    "phone": "+15555550123",
    "check_in_time": "14:00:00",
    "check_out_time": "12:00:00",
    "front_desk_time_start": "00:00:00",
    "front_desk_time_end": "00:00:00",
    "images": [
      "https://cdn.worldota.net/t/{size}/extranet/b5/d3/b5d3d33394494c68321246882c1bd93a6832dcd5.jpeg"
    ],
    "amenity_groups": [
      {
        "amenities": [
          "24-hour reception",
          "Early check-in",
          "Late check-out"
        ],
        "non_free_amenities": [],
        "group_name": "General"
      }
    ],
    "serp_filters": [
      "has_internet",
      "has_parking",
      "kitchen"
    ],
    "description_struct": [
      {
        "title": "Location",
        "paragraphs": [
          "A perfect fit for a big group of travellers: apartment «Test Hotel (Do Not Book)» ..."
        ]
      }
    ],
    "metapolicy_struct": {
      "internet": [
        {
          "inclusion": "included",
          "price": "0.00",
          "currency": null,
          "price_unit": "unspecified",
          "internet_type": "unspecified",
          "work_area": "hotel"
        }
      ],
      "meal": [
        {
          "inclusion": "not_included",
          "price": "300.00",
          "currency": "USD",
          "meal_type": "breakfast"
        }
      ],
      "children_meal": [
        {
          "inclusion": "not_included",
          "price": "200.00",
          "currency": "USD",
          "meal_type": "breakfast",
          "age_start": 0,
          "age_end": 5
        }
      ],
      "extra_bed": [
        {
          "inclusion": "not_included",
          "price": "100.00",
          "currency": "ALL",
          "price_unit": "per_guest_per_night",
          "amount": 1
        }
      ],
      "cot": [
        {
          "inclusion": "not_included",
          "price": "0.00",
          "currency": "USD",
          "price_unit": "per_room_per_night",
          "amount": 1
        }
      ],
      "pets": [
        {
          "inclusion": "not_included",
          "price": "560.00",
          "currency": "USD",
          "price_unit": "per_room_per_stay",
          "pets_type": "unspecified"
        }
      ],
      "shuttle": [
        {
          "inclusion": "not_included",
          "price": "100.00",
          "currency": "EUR",
          "shuttle_type": "one_way",
          "destination_type": "train"
        }
      ],
      "parking": [
        {
          "inclusion": "not_included",
          "price": "100.00",
          "currency": "USD",
          "price_unit": "per_car_per_night",
          "territory_type": "unspecified"
        }
      ],
      "children": [
        {
          "age_start": 0,
          "age_end": 3,
          "price": "500.00",
          "currency": "CHF",
          "extra_bed": "available"
        }
      ],
      "visa": {
        "visa_support": "support_enable"
      },
      "deposit": [
        {
          "availability": "available",
          "price": "123.00",
          "currency": "HNL",
          "price_unit": "per_room_per_stay",
          "pricing_method": "fixed",
          "payment_type": "cash",
          "deposit_type": "unspecified"
        }
      ],
      "no_show": {
        "availability": "available",
        "time": "09:00:00",
        "day_period": "after_midday"
      },
      "add_fee": [],
      "check_in_check_out": []
    },
    "metapolicy_extra_info": "Front desk is open 24/7.",
    "room_groups": [
      {
        "room_group_id": 95,
        "name": "Standard Double room full double bed",
        "name_struct": {
          "main_name": "Standard Double room",
          "bedding_type": "full double bed",
          "bathroom": "shared bathroom"
        },
        "rg_ext": {
          "class": 3,
          "quality": 2,
          "sex": 0,
          "bathroom": 1,
          "bedding": 3,
          "family": 0,
          "capacity": 2,
          "club": 0,
          "bedrooms": 0,
          "balcony": 0,
          "floor": 0,
          "view": 0
        },
        "room_amenities": [
          "bath",
          "heating"
        ],
        "images": [
          "https://cdn.worldota.net/t/{size}/extranet/b5/d3/b5d3d33394494c68321246882c1bd93a6832dcd5.jpeg"
        ]
      }
    ],
    "facts": {
      "floors_number": null,
      "rooms_number": null,
      "year_built": null,
      "year_renovated": null,
      "electricity": {
        "frequency": [
          60
        ],
        "voltage": null,
        "sockets": [
          "a",
          "b"
        ]
      },
      "register": null
    },
    "payment_methods": [
      "visa",
      "maestro",
      "cash"
    ],
    "keys_pickup": {
      "type": "lockbox",
      "phone": "+15555550123",
      "email": "test@example.com",
      "apartment_office_address": null,
      "apartment_extra_information": "The keys are in the box by the front door.",
      "is_contactless": true
    },
    "is_closed": false,
    "is_gender_specification_required": false,
    "deleted": false,
    "images_ext": [
      {
        "url": "https://cdn.worldota.net/t/{size}/extranet/b5/d3/b5d3d33394494c68321246882c1bd93a6832dcd5.jpeg",
        "category_slug": "others"
      },
      {
        "url": "https://cdn.worldota.net/t/{size}/extranet/15/44/15440558c952ec4c3488730d1563dc9e8d25832c.JPEG",
        "category_slug": "outside"
      }
    ],
    "policy_struct": [
      {
        "title": "Meals",
        "paragraphs": [
          "Price of an additional breakfast: 300.00 USD per person."
        ]
      }
    ]
  }
]
```

## Errors

| Status | Code | Example message |
| --- | --- | --- |
| 400 | `invalid_body` | The request body must be a JSON list of hotel id strings. |
| 400 | `invalid_images_limit` | 'images_limit' must be an integer from 0 to 30. |

See [Errors](https://fx-port.com/docs/errors.md) for every code and how to react.

## Related guides

- [Mini and full hotel data](https://fx-port.com/docs/hotels/hotel-data.md)
