How to Search Listings Using Keywords
Our real estate APIs offer a robust keyword search feature that allows API users to search listings using specific keywords. This feature is highly versatile and can be used to create a general search input for your users, enabling them to find listings by MLS number, address, or by searching text in descriptions. Additionally, you can implement an auto-complete function using this feature.
The search parameter enables users to find listings that contain specific keywords anywhere in the listing details. For example, to find listings containing the keyword "cul-de-sac", you can make the following request:
GET https://api.repliers.io/listings?search=cul-de-sac
This request will return all listings where "cul-de-sac" appears in any part of the listing.
You can search for multiple keywords or phrases by separating them with commas. This ensures that all specified terms are present in the listing data.
Example:
https://api.repliers.io/listings?search=cul-de-sac,high ceilings
This will retrieve listings where both "cul-de-sac" and "high ceilings" appear in the listing data.
The searchFields parameter allows you to isolate the search to specific fields. This is particularly useful for searches focused on addresses. For example, to find listings at "1 Yonge St", you can restrict the search to the address fields:
GET https://api.repliers.io/listings?search=1 Yonge St&searchFields=address.streetNumber,address.streetName
To exclude listings containing specific keywords, use the not: prefix. This allows you to filter out unwanted terms from the results.
Example:
https://api.repliers.io/listings?search=cul-de-sac,high ceilings,not:bungalow&searchFields=details.description
This will retrieve listings where both "cul-de-sac" and "high ceilings" appear in the details.description field but exclude any listings where the word "bungalow" is present.
Summary of Search Parameters
search: Specifies the keywords or phrases to search for.
searchFields: Specifies which fields to search within (e.g., details.description).
not:: Excludes listings containing specific keywords or phrases.
The fuzzySearch parameter, if set to true, accommodates small inconsistencies in user input. For example, if a user enters "236 Stratallan Wood" but they meant to type "236 Strathallan Wood", the search will still return relevant results for "Strathallan":
GET https://api.repliers.io/listings?search=236 Stratallan Wood&fuzzySearch=true
The search, searchFields, and fuzzySearch parameters can be combined with other search parameters to refine your query further. For example, to find listings at "1 Yonge St" with at least 3 bedrooms, you can use the following request:
GET https://api.repliers.io/listings?search=1 Yonge St&searchFields=address.streetNumber,address.streetName&minBeds=3
The keyword search feature in our real estate APIs provides powerful capabilities for searching listings by various criteria. By leveraging the search, searchFields, and fuzzySearch parameters, along with other search filters, you can offer a highly customizable search experience for your users. For further assistance or advanced implementation tips, please contact our support team.
The "search" Parameter
The search parameter enables users to find listings that contain specific keywords anywhere in the listing details. For example, to find listings containing the keyword "cul-de-sac", you can make the following request:
GET https://api.repliers.io/listings?search=cul-de-sac
This request will return all listings where "cul-de-sac" appears in any part of the listing.
Search for Multiple Keywords or Phrases
You can search for multiple keywords or phrases by separating them with commas. This ensures that all specified terms are present in the listing data.
Example:
https://api.repliers.io/listings?search=cul-de-sac,high ceilings
This will retrieve listings where both "cul-de-sac" and "high ceilings" appear in the listing data.
The "searchFields" Parameter
The searchFields parameter allows you to isolate the search to specific fields. This is particularly useful for searches focused on addresses. For example, to find listings at "1 Yonge St", you can restrict the search to the address fields:
GET https://api.repliers.io/listings?search=1 Yonge St&searchFields=address.streetNumber,address.streetName
Exclude Specific Keywords or Phrases
To exclude listings containing specific keywords, use the not: prefix. This allows you to filter out unwanted terms from the results.
Example:
https://api.repliers.io/listings?search=cul-de-sac,high ceilings,not:bungalow&searchFields=details.description
This will retrieve listings where both "cul-de-sac" and "high ceilings" appear in the details.description field but exclude any listings where the word "bungalow" is present.
Summary of Search Parameters
search: Specifies the keywords or phrases to search for.
searchFields: Specifies which fields to search within (e.g., details.description).
not:: Excludes listings containing specific keywords or phrases.
The "fuzzySearch" Parameter
The fuzzySearch parameter, if set to true, accommodates small inconsistencies in user input. For example, if a user enters "236 Stratallan Wood" but they meant to type "236 Strathallan Wood", the search will still return relevant results for "Strathallan":
GET https://api.repliers.io/listings?search=236 Stratallan Wood&fuzzySearch=true
Combining Parameters
The search, searchFields, and fuzzySearch parameters can be combined with other search parameters to refine your query further. For example, to find listings at "1 Yonge St" with at least 3 bedrooms, you can use the following request:
GET https://api.repliers.io/listings?search=1 Yonge St&searchFields=address.streetNumber,address.streetName&minBeds=3
Conclusion
The keyword search feature in our real estate APIs provides powerful capabilities for searching listings by various criteria. By leveraging the search, searchFields, and fuzzySearch parameters, along with other search filters, you can offer a highly customizable search experience for your users. For further assistance or advanced implementation tips, please contact our support team.
Updated on: 29/11/2024
Thank you!