Skip to main content

Listing AI Search

Endpoints​

Full AI Search (AI + listing search + pricing)​

POST /api/v1/crs/listings/ai-search
{
"query": "Pet-friendly villas in Goa for 6 adults this weekend under 20k",
"rawParams": [
{ "filterName": "channelId", "filterValues": ["B2C"] }
]
}

Response:

{
"intent": {
"listingIds": ["lst_abc", "lst_def"],
"checkInDate": "2026-04-05",
"checkOutDate": "2026-04-07",
"adultCount": 6,
"city": "Goa",
"propertyType": "Villa",
"budgetPerNight": 20000,
"petFriendly": true,
"originalQuery": "Pet-friendly villas in Goa..."
},
"results": {
"singleListings": [ ... full listing cards with pricing ... ],
"combinations": []
}
}

Intent Only (for populating filter UI)​

POST /api/v1/crs/listings/ai-search/intent
{ "query": "3 BHK villa in Lonavala for 8 people next weekend" }

Response:

{
"listingIds": ["lst_abc", "lst_def"],
"checkInDate": "2026-04-05",
"checkOutDate": "2026-04-07",
"adultCount": 8,
"city": "Lonavala",
"propertyType": "Villa"
}

Use this to auto-fill the search filter UI from a natural language query.

Extracted Fields​

The LLM extracts these structured filters from the natural language:

FieldExample
checkInDate / checkOutDate2026-04-05 (resolved from "this weekend")
adultCount / childCount6, 2
cityGoa
propertyTypeVilla
budgetPerNight20000
petFriendlytrue

A party stated as a range resolves to its largest number — "for 7-8 people" is adultCount: 8 — so the stays returned fit the whole party. This is read off the query itself, not left to the model, so the same query always yields the same count.

A query that names no dates still searches a real stay: the filters fall back to next week in IST — check-in today + 7 days, check-out two nights later — which is the window the search page's own date pickers show. Dates the guest stated, in the prompt or already on the request, always win. The default lives server-side precisely so that a client sending its pickers along cannot override what the guest typed, and it is why an AI search reports nights: 2 rather than nights: 0.