How to Add Natural Language Property Search to Your App
Published on · Updated · 4 minutes read

Filter forms are losing ground to a single search box. Users increasingly expect to type “three-bed house in Austin with a big yard under 700k” and get real results, the same way they talk to any AI assistant. Adding that to a real estate app sounds hard, because interpreting a sentence, mapping it to valid MLS fields, and running the search is genuinely complex, but a natural language search endpoint handles the hard part for you.
This tutorial shows how to add natural language property search to your app using Repliers and its /nlp endpoint, which converts plain-language prompts into structured listing queries. You will send a sentence, get back a ready-to-call search, and support conversational follow-ups. For the broader set of APIs behind conversational search, see Top 6 Real Estate APIs with Natural Language Search.
Key Takeaways
- The Repliers /nlp endpoint converts a plain-language prompt into a structured /listings request, so you do not build your own language parser.
- It normalizes wording to valid MLS values, so “enclosed balcony” becomes the correct field value automatically.
- Passing back the returned nlpId preserves context across prompts, making search conversational rather than one-shot.
- Irrelevant prompts return a 406 response, so you can ask the user to rephrase instead of running a broken query.
What You Will Build
- A search box that accepts plain-language property queries
- A pipeline that turns a sentence into a live listings search
- Conversational follow-ups that refine the same search
What You Will Need
- A Repliers API key (a test key works for building)
- An existing app or a simple React or Next.js page
- The /nlp and /listings endpoints
How the NLP Endpoint Works
| Step | Request | Result |
| Interpret the prompt | POST /nlp | A structured /listings URL plus an nlpId |
| Fetch the listings | GET the returned URL | Matching live listings |
| Refine the search | POST /nlp with nlpId | Updated query keeping prior context |
Step 1: Send a Prompt to the NLP Endpoint
The /nlp endpoint takes a natural language prompt and returns a structured request. It also normalizes wording to valid MLS values, so “enclosed balcony” becomes the correct field value automatically.
async function interpret(prompt, nlpId) {
const res = await fetch("https://api.repliers.io/nlp", {
method: "POST",
headers: {
"REPLIERS-API-KEY": process.env.REPLIERS_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify(nlpId ? { prompt, nlpId } : { prompt }),
});
if (res.status === 406) return null; // not a listing-related prompt
return res.json();
}
A prompt like “Find me a condo in Toronto with at least 1 bedroom in the Annex with underground parking” returns a request.url such as https://api.repliers.io/listings?city=Toronto&propertyType=Condo Apt&minBeds=1&neighborhood=Annex&garage=Underground, along with a plain-language summary and an nlpId.
Step 2: Fetch the Listings
The NLP response hands you a ready-to-call listings URL. Fetch it with the same API key to get results.
async function searchFromPrompt(prompt) {
const nlp = await interpret(prompt);
if (!nlp) return { listings: [], nlpId: null };
const res = await fetch(nlp.request.url, {
headers: { "REPLIERS-API-KEY": process.env.REPLIERS_KEY },
});
const data = await res.json();
return { listings: data.listings || [], nlpId: nlp.nlpId };
}
Step 3: Support Conversational Follow-Ups
The nlpId is what makes search feel conversational. Pass it back with the next prompt, and the endpoint keeps prior context instead of starting over.
// First prompt: "I'm looking for a condo to buy with 4 bedrooms."
// -> /listings?class=condo&minBeds=4&type=sale
// Follow-up with the same nlpId: "my budget is 500k and I need parking."
// -> /listings?class=condo&minBeds=4&type=sale&maxPrice=500000&minParkingSpaces=1
const first = await searchFromPrompt("condo to buy with 4 bedrooms");
const refined = await interpret("budget is 500k and I need parking", first.nlpId);
That single piece of state turns a search box into a genuine conversation, which is what users now expect from AI-driven interfaces.
Step 4: Handle Off-Topic Prompts
Not every prompt is a property search. When someone types “why is the sky blue,” the endpoint returns a 406 response, so you can prompt the user to rephrase rather than run a broken query. Handling that path keeps the experience clean.
const result = await interpret(userText);
if (!result) {
showMessage("Try describing the home you want, like '2-bed condo in Miami under 500k'.");
}
Add Conversational Search Today
You can build and test natural language search against sample data in minutes, then move to production once licensing is in place.
- Get an API key: https://auth.repliers.com/en/signup
- Schedule a demo: https://repliers.com/schedule-call/
Step 5: Combine With AI Image Search (Optional)
For visual queries like “white kitchen,” Repliers also supports AI image search on the /listings endpoint via a POST body with imageSearchItems, ranking listings by relevance. You can combine it with NLP for search that understands both words and visuals. For the end-to-end search experience, see Top 5 Real Estate APIs for AI-Powered Property Search.
Frequently Asked Questions
How do I turn a sentence into a property search?
Send the sentence to Repliers’ /nlp endpoint. It interprets the intent, maps it to valid MLS fields, and returns a structured /listings URL you can call directly. This removes the hardest part of natural language search, parsing and normalization, so you focus on the interface.
Can natural language search remember context across messages?
Yes. The /nlp endpoint returns an nlpId with each response. Pass it back on the next prompt and the search keeps prior context, so “add a garage” refines the existing query rather than starting fresh. That is what makes the experience conversational.
What happens if a user types something irrelevant?
The endpoint returns a 406 response for prompts that are not property searches, so your app can ask the user to rephrase instead of running an empty or broken query. Handling that case keeps the search reliable.
The Bottom Line
Natural language property search is quickly becoming the default expectation, and it no longer requires building your own language pipeline. Repliers’ /nlp endpoint interprets the prompt, normalizes it to real MLS values, returns a ready-to-run search, and preserves context across follow-ups. You supply the interface; the API supplies the intelligence and the live listings.
To add natural language search to your app, visit www.repliers.com to get an API key or schedule a demo.
Related articles
Ready to get started?
Get an API key and start testing within minutes — no credit card required.














