Skip to main content
Hotel, room type, and visit type responses include the same responsive image metadata. Embedded room types use the same fields as top-level room type responses.

Response shape

Every image contains all five fields:

Build a responsive image

Use only the variant URLs returned by the API. Do not construct a URL for a missing width. Images are never enlarged, so an 1100-pixel original has w480 and w960, but no larger variants. Pass one item from the images array as image.
Set srcset only when the resulting string is non-empty. Set sizes to the actual layout slot, for example (max-width: 768px) 100vw, 50vw. The browser then selects the best available variant for the viewport and device pixel density. Use non-null width and height as the HTML intrinsic dimensions. They reserve the correct aspect ratio before the image loads. Do not replace them with the CSS slot size.
Use loading="eager" and fetchpriority="high" only for the single image that is the page’s likely largest contentful paint (LCP). Lazy-load images outside the initial viewport.

Empty variants and fallbacks

An empty variants object means that no responsive variant is available. It does not mean that processing is still pending. Omit srcset and use url as src. There are two possible cases:
  • A small original can have known width and height but no variant because its width is below 480 pixels.
  • An image with unavailable dimensions has width: null, height: null, and variants: {}.
As a final error fallback, remove srcset and use url. This is useful if a cached client encounters a missing variant, but it does not replace normal HTTP error monitoring.

Alternative text

alt follows Accept-Language. The response contains the requested locale keys:
  • A missing or null hotel image translation falls back to the localized hotel name.
  • A missing or null room image translation falls back to the single room name in each requested language, or null when the name is empty.
  • In the visit type object, a missing or null image alt translation falls back to the localized visit type name.
  • An explicit empty string remains "". Preserve it when the image is decorative.
  • A non-empty stored value is trimmed.
The API provides recommended alternative text. Your client can still use alt="" when the image is decorative or redundant in its rendered context.

Previews

Use an available variants URL for previews and url when no variant is available. See the Hotel and Room type object references.