> ## Documentation Index
> Fetch the complete documentation index at: https://docs.spaportal.cz/llms.txt
> Use this file to discover all available pages before exploring further.

# Expand

> Include optional related data with the expand parameter.

Use the `expand` query parameter to embed related data inline in the response
instead of fetching it with a second request. Depending on the endpoint this
can be a referenced object, a related collection, or inlined labels. Nothing is
expanded by default. Pass a comma-separated list to expand more than one thing
in a single request.

<Warning>
  **Draft:** Room-type endpoints and both room-type expansions
  (`expand=roomTypes` on hotels and `expand=hotel` on room types) are still in
  progress. Their response shapes may change before they are finalized.
</Warning>

```bash theme={null}
# Inline the localized amenity labels on each hotel
GET /api/v2/hotels?expand=amenityLabels

# Embed each hotel's room types
GET /api/v2/hotels?expand=roomTypes

# Both at once
GET /api/v2/hotels?expand=roomTypes,amenityLabels

# Embed each room type's hotel
GET /api/v2/room-types?expand=hotel
```

## With and without expand

A hotel does not include its room types by default. Without `expand` you get the
hotel on its own; with `expand=roomTypes` the full `roomTypes` array is embedded
inline — no second request needed. The only difference between the two responses
is the added `roomTypes` block.

The snippets below show only the fields relevant to expansion. The remaining
hotel fields are unchanged and follow the complete [Hotel](/api/objects/hotel)
schema. `priceFrom` may be `null` when no usable price is available.

<CodeGroup>
  ```json Relevant fields without expand theme={null}
  {
    "id": "66f16191f739705faa020001",
    "name": { "cs-CZ": "Pawlik", "de": "Pawlik-Aquaforum" },
    "address": {
      "addressLine": "Americká 384/26",
      "city": "Františkovy Lázně",
      "postalCode": "351 01",
      "country": "cze"
    },
    "priceFrom": {
      "CZK": {
        "perNight": { "amountMinor": 284000, "currency": "CZK", "currencyExponent": 2 },
        "perNightOriginal": null,
        "minimumStay": { "amountMinor": 568000, "currency": "CZK", "currencyExponent": 2 },
        "minimumStayOriginal": null,
        "guests": 2,
        "minimumNights": 2
      }
    }
  }
  ```

  ```json Relevant fields with expand=roomTypes theme={null}
  {
    "id": "66f16191f739705faa020001",
    "name": { "cs-CZ": "Pawlik", "de": "Pawlik-Aquaforum" },
    "address": {
      "addressLine": "Americká 384/26",
      "city": "Františkovy Lázně",
      "postalCode": "351 01",
      "country": "cze"
    },
    "priceFrom": {
      "CZK": {
        "perNight": { "amountMinor": 284000, "currency": "CZK", "currencyExponent": 2 },
        "perNightOriginal": null,
        "minimumStay": { "amountMinor": 568000, "currency": "CZK", "currencyExponent": 2 },
        "minimumStayOriginal": null,
        "guests": 2,
        "minimumNights": 2
      }
    },
    "roomTypes": [
      {
        "id": "66f16191f739705faa020003",
        "hotelId": "66f16191f739705faa020001",
        "code": "SUPERIOR-DBL",
        "category": { "cs-CZ": "Superior dvoulůžkový pokoj", "de": "Superior Doppelzimmer" },
        "beds": 2,
        "facilities": ["shower", "toilet"],
        "images": [],
        "description": { "cs-CZ": "Pokoj s koupelnou.", "de": "Zimmer mit Bad." }
      }
    ]
  }
  ```
</CodeGroup>

The same pattern applies in the other direction: `GET /api/v2/room-types?expand=hotel`
embeds each room type's `hotel`. For a paginated, filterable list of a single
hotel's room types, use `GET /api/v2/room-types?hotelId=<id>` instead of expanding.

## Amenity labels

By default a hotel's `amenityCategories` carry codes only, and you resolve
labels against the [amenity dictionary](/api/amenities). `expand=amenityLabels`
inlines the localized `label` on each category, amenity, and option so the
response is self-contained — useful when you would rather not fetch and join the
dictionary. For apps that render many hotels, caching the dictionary once is
usually leaner than expanding labels on every request.

Each endpoint lists the `expand` values it supports and what each adds.
