Response shape
Whereimage and thumbnail already exist, their values remain unchanged.
The responsive metadata is additive:
All six fields describe only the first image. When the object has no image,
image, thumbnail, width, and height are null, variants is an empty
object, and alt contains the requested locale keys with null values.
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 hasw480
and w960, but no larger variants. Pass a hotel, room type, or visit type
object as image.
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.
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 emptyvariants object means that no responsive variant is available. It
does not mean that processing is still pending. Omit srcset and use
thumbnail ?? image as src.
There are two possible cases:
- A small original can have known
widthandheightbut no variant because its width is below 480 pixels. - An unavailable legacy image has
width: null,height: null, andvariants: {}.
srcset and try thumbnail, then image.
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 language keys:
- A missing or
nullhotel image translation falls back to the localized hotel name. - A missing or
nullroom image translation falls back to the localized room category, ornullwhen that category translation is unavailable. - A missing or
nullvisit type image 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.
alt="" when the image is decorative or redundant in its rendered context.
Compatibility
The responsive fields are additive. Existing hotel and room typeimage and
thumbnail values retain their behavior. Visit types expose the same
first-image fields.
See the Hotels endpoint, Hotel
endpoint, and Visit types
endpoint.