Utilizing AI-Powered NLP for Real Estate Listing Searches

Our real estate APIs include an advanced AI-powered natural language processing (NLP) feature that enables you to collect natural language prompts from your users and seamlessly convert them into search API requests. This cutting-edge functionality is rapidly becoming essential in real estate listing searches, particularly for chat-bot and voice applications.

How It Works



The NLP feature processes natural language prompts provided by your users and generates the corresponding search API requests. This functionality not only enhances user experience but also streamlines the process of finding relevant listings based on specific criteria.

Example Scenario


Let's say a user inputs the following prompt:

Find me a condo in Toronto with at least 1 bedroom in the Annex. It must have underground parking.

By sending this prompt to the NLP endpoint, you can obtain a formatted API request ready for use.

Request:


POST https://api.repliers.io/nlp

{
    "prompt": "Find me a condo in toronto with at least 1 bedroom in the annex. It must have underground parking."
}


Response:


{
    "request": {
        "url": "https://api.repliers.io/listings?area=Toronto&city=Toronto&propertyType=Condo%20Apt&minBeds=1&neighborhood=Annex&garage=Underground",
        "body": null,
        "summary": "Searching for a condominium apartment in Toronto with a minimum of 1 bedroom located in the Annex neighborhood. The property must have underground parking."
    },
    "nlpId": "12345"
}


In this example, the NLP feature has converted the user's natural language input into a structured search request, which can be sent directly to our Listings API to retrieve relevant property listings.

Context-Aware NLP with NLP IDs



Our system is designed to support context-aware interactions using NLP IDs, enabling a more conversational and intuitive search experience. When you send a new prompt to our NLP tool, the system returns an NLP ID in the response. This ID can be included in subsequent prompts to maintain context, allowing the NLP tool to consider both the original and new prompts when generating the API request.

Prompt 1:

I'm looking for a condo to buy with 4 bedrooms.

Request:


POST https://api.repliers.io/nlp

{
    "prompt": "I'm looking for a condo to buy with 4 bedrooms.",
}


Response:


{
    "request": {
        "url": "https://api.repliers.io/listings?class=condo&minBeds=4&type=sale",
        "body": null,
        "summary": "Searching for a condo to buy with a minimum of 4 bedrooms."
    },
    "nlpId": "12345"
}


Prompt 2:

Also, I forgot, my budget is 500k, and I need at least 1 parking spot.

Request:


POST https://api.repliers.io/nlp

{
    "nlpId": "12345"
    "prompt": "Also, I forgot, my budget is 500k, and I need at least 1 parking spot."
}


Response:


{
    "request": {
         "url": "https://api.repliers.io/listings?class=condo&minBeds=4&type=sale&minParkingSpaces=1&maxPrice=500000",
         "body": null,
         "summary": "Searching for a Condo Apt to buy with at least 4 bedrooms, within a budget of 500,000, and at least 1 parking spot."
     },
    "nlpId": "12345"
}


In this example, the initial request (Prompt 1) generates an nlpId which can be used in subsequent requests to maintain context. When the user adds new criteria or changes the existing prompt, the nlpId is passed along with the new prompt, allowing the system to consider both prompts and refine the search results accordingly.

To start a new NLP search, you simply do not use an nlpId in the request.



If the user's prompt includes visual preferences, the NLP feature will generate a requestBody that incorporates AI image search functionality. This is particularly useful for refining searches based on aesthetic or design elements mentioned by the user.

Example with Visual Input:


Prompt:

Find me a condo in Toronto with at least 1 bedroom in the Annex. It must have underground parking and a white kitchen.


Request:


POST https://api.repliers.io/nlp

{
    "prompt": "Find me a condo in toronto with at least 1 bedroom in the annex. It must have underground parking and a white kitchen."
}


Response:


{
    "request": {
        "url": "https://api.repliers.io/listings?propertyType=Condo%20Apt&area=Toronto&minBeds=1&neighborhood=Annex&garage=Underground",
        "body": {
            "imageSearchItems": [
                {
                    "type": "text",
                    "value": "white kitchen",
                    "boost": 1
                }
            ]
        },
       "summary": "Searching for a condo apartment in Toronto with at least 1 bedroom in the Annex. The property should have underground parking. Properties with white kitchens are preferred."
    },
    "nlpId": "12345"
}


The AI image search integrates the visual preference "white kitchen" into the search, enabling users to find properties that match their aesthetic desires.

AI-Powered Data Normalization



Our NLP feature also includes AI-powered data normalization, ensuring that user inputs match the acceptable values from the MLS. This feature is crucial for maintaining consistency and accuracy when translating user prompts into API requests.

Example of Data Normalization:


Prompt:

Find me a condo with an enclosed balcony.


Request:


POST https://api.repliers.io/nlp

{
    "prompt": "Find me a condo with an enclosed balcony."
}


Response:


{
    "request": {
        "url": "https://api.repliers.io/listings?class=condo&balcony=encl",
        "body": null,
        "summary": "Searching for condos with enclosed balconies."
    },
    "nlpId": "12345"
}


In this case, "enclosed balcony" has been normalized to "encl," which is the expected MLS value for the parameter balcony.

Filtering NLP Sessions



You can filter NLP sessions using the GET /nlp endpoint. This endpoint allows you to retrieve all NLP prompts and the sessions they are associated with, identified by a unique nlpId for each session.

Available Filters:


clientId: Filter sessions based on the clientId to see all NLP sessions associated with a specific client.
nlpId: Filter by nlpId to retrieve details about a specific NLP session.

Pagination:


If you have a large number of NLP sessions, you can paginate through the results to efficiently manage and review the data.

For more detailed information on how to implement these filters and paginate results, please visit our API Reference.

In Closing



The AI-powered NLP feature in our real estate APIs is designed to enhance user experience and improve search relevance. By converting natural language prompts into precise API requests, integrating visual preferences through AI image search, and normalizing data for MLS compatibility, our NLP feature offers a powerful tool for real estate applications.

If you have any questions or need further assistance, please contact our support team.

Updated on: 15/08/2024

Was this article helpful?

Share your feedback

Cancel

Thank you!