Best practices
Retry with Retry-After, never a fixed loop
Section titled “Retry with Retry-After, never a fixed loop”A 503 (overloaded) and a 429 rate_limited carry Retry-After in
seconds. Wait exactly that long before retrying — it’s not a decorative
number, it’s what the server knows it needs to stop being saturated. 429
quota_exceeded is different: it carries no Retry-After because retrying
in seconds changes nothing; the quota resets monthly.
max_age and caching
Section titled “max_age and caching”By default, GET /v1/quotes can respond with a cached quote up to 300
seconds old. If your use case tolerates prices from a few minutes ago,
don’t touch max_age — it’s faster and asks nothing new of any channel.
If you need the live price at this exact instant (for example, right before
showing the final total to a user who’s about to pay), pass max_age=0.
Identify by hotel_id, not by name
Section titled “Identify by hotel_id, not by name”Once you have a hotel’s hotel_id (you get it the first time you resolve
it by name), store it and use it from then on. Resolving by name does a
GPS-distance match that’s reliable but not free — skipping it once you
already know the id is faster and more predictable.
Batch, but no further than necessary
Section titled “Batch, but no further than necessary”POST /v1/quotes accepts up to 200 hotels per call (the
physical ceiling; your plan may cap you below that). The benefit of
batching is latency (one network round trip instead of many), not price:
it’s still charged per hotel-quote. Batch when you’re really going to show
several hotels at once; requesting 200 to use only 3 saves
nothing, and the practical recommended range for a client with a 60-second
timeout is 25 to 50 per call —
see batch quote.
price_per_night already includes taxes
Section titled “price_per_night already includes taxes”It’s the only field meant for comparing across channels: it always includes taxes. You don’t need to (and shouldn’t) add anything to it before showing it or comparing it between offers.