1. Four-Endpoint Hospitality Data Architecture
Modern travel apps need four tightly coupled datasets: destination resolution, date-aware nightly availability, room-level cancellation/tax breakdowns, and verified guest sentiment.
- GET /v1/hotels/search: Accepts ?city=Paris or ?location_id=... with checkin, checkout, adults, rooms, and currency. Computes price_per_night automatically alongside price_total and excluded_taxes.
- GET /v1/hotels/detail: Hydrates room-by-room rate blocks, breakfast inclusion, free-cancellation deadlines, Wi-Fi/breakfast scores, and full property amenities.
- GET /v1/hotels/reviews: Streams paginated verified guest reviews with structured pros, cons, travel_purpose, and hotelier responses.
- GET /v1/locations/search: Resolves long-tail towns, airports, and landmarks into permanent location_id & dest_id handles cached forever in PostgreSQL.
Fetch Paris Nightly Hotel Rates & Computed Per-Night Pricing
Pass ?city=Paris directly — our pre-seeded destination registry resolves location_id internally in <1ms.
curl -sS "https://api.hotelpricesapi.com/v1/hotels/search?city=Paris&checkin=2026-12-15&checkout=2026-12-17&adults=2¤cy=USD&limit=10" \
-H "x-api-key: hp_live_your_api_key"import requests
res = requests.get(
"https://api.hotelpricesapi.com/v1/hotels/search",
params={
"city": "Paris",
"checkin": "2026-12-15",
"checkout": "2026-12-17",
"adults": 2,
"currency": "USD",
"limit": 10,
},
headers={"x-api-key": "hp_live_your_api_key"},
timeout=20,
).json()
for h in res["data"]["items"]:
print(h["name"], f"${h['price_per_night']}/night", "Score:", h["review_score"])const qs = new URLSearchParams({
city: "Paris",
checkin: "2026-12-15",
checkout: "2026-12-17",
adults: "2",
currency: "USD",
limit: "10",
});
const res = await fetch(`https://api.hotelpricesapi.com/v1/hotels/search?${qs}`, {
headers: { "x-api-key": "hp_live_your_api_key" },
});
const { data } = await res.json();
console.log(data.items.map((h: any) => ({ name: h.name, nightly: h.price_per_night })));{
"code": 0,
"provider": "https://hotelpricesapi.com",
"status": "ok",
"data": {
"city": "Paris",
"checkin": "2026-12-15",
"checkout": "2026-12-17",
"nights": 2,
"currency": "USD",
"total_available": 20,
"items": [
{
"hotel_id": "59015",
"name": "Ibis Styles Paris Batignolles",
"stars": 3,
"review_score": 8.3,
"review_score_word": "Very Good",
"review_count": 1711,
"price_total": 304.14,
"price_per_night": 152.07,
"excluded_taxes": 18.2,
"currency": "USD",
"coordinates": {
"lat": 48.8902,
"lng": 2.3175
},
"checkin_window": {
"from": "14:00",
"until": "23:59"
}
}
]
},
"meta": {
"endpoint": "/v1/hotels/search",
"credits_charged": 2,
"cached": true,
"took_ms": 24
}
}2. Cache TTL Strategy & Credit Unit Economics
Hospitality rate shoppers waste 60%+ of their API spend re-fetching static city IDs and property descriptions. HotelPrices API splits caching by volatility tier.
| Endpoint | Cache TTL | Credit Rate | Business Tier / 1K |
|---|---|---|---|
| GET /v1/locations/search | Permanent PG + 30d Redis | 2 Credits / call | $0.08 / 1K calls |
| GET /v1/hotels/search | 15 min Redis/PG (?fresh=1 bypass) | 2 Credits / hotel | $0.08 / 1K hotels |
| GET /v1/hotels/detail | 12 hours Redis/PG | 10 Credits / property | $0.40 / 1K dossiers |
| GET /v1/hotels/reviews | 12 hours Redis/PG | 2 Credits / review | $0.08 / 1K reviews |
Interactive Hospitality Rate-Shopper Lab · GET /v1/hotels/search
Verify live gateway latency, rate-sweep credit math & JSON schema
Frequently Asked Questions
- How many currencies are supported on /v1/hotels/search?
- Pass any ISO-4217 currency code via ?currency=USD, EUR, GBP, JPY, AUD, CAD, SGD, AED, CHF, and more. Both price_total and price_per_night are returned in your requested currency.
- Do I pay if a city or check-in window is sold out?
- No. Any query returning 0 available properties or an HTTP 4xx/5xx error deducts strictly 0 Credits.