Prerequisites
Before building a calendar, make sure you have:- A working Best Price call. If not, follow the Quick start first.
- A hotel ID and a group ID for the property you display.
- A target date window (typically 30 to 90 days).
How it works
The Calendar endpoint returns one entry per arrival date in your requested range. Each entry contains the cheapest offer for that day. You map the response array directly onto your calendar cells: one date, one price, one availability indicator. A single call covers the whole window. No iteration, no per-day requests.Build the calendar
The examples below assume the OAuth signing setup from the Quick start.
Request the date range you display
Call Best Price once with the first and last dates your UI shows. The default
behaviour of LowestLengthOfStay fits a browse experience: it returns the best price compatible with the shortest stay, instead of pushing the user toward longer mandatory stays.Render available dates with their price
For each entry where
status is Available, display totalPrice with currency. The arrivalDate field tells you which calendar cell the entry belongs to.Tips
- Mind the minimum stay. The
totalPriceis already a per-night average, so calendar cells are visually comparable without any computation on your side. What changes whenminimumStayis greater than 1 is the booking constraint: the visitor must commit to that many nights to pay that rate. Two strategies, depending on your hotel type:- City or business hotels: force a single-night view by setting
filter.maximumStay: 1. The API only returns days bookable as 1-night stays, so visitors never face a stay-length surprise at booking. - Resorts or luxury properties: display the price as-is and surface the constraint with a small label on the cell (“min 3 nights”). Multi-night stays are the norm here, and hiding those days would empty most of the calendar.
- Seasonal mix: default to displaying as-is so you never hide bookable days, then switch to the 1-night view on date ranges where short stays are the rule.
- City or business hotels: force a single-night view by setting
- Cache the response. Best Price data is browse-heavy and changes slowly. A short cache cuts response time on repeat views.
- Watch closedOnDeparture. When
true, guests cannot check out that day. It does not affect arrival, but it constrains the departure dates compatible with the arrival.
Related
Reference
Full schema for every field returned by Best Price.
Best practices
Caching, performance, and resilience patterns.