Search page with map
A /search page whose first page of results is rendered on your server from the URL, with the search box, the filter bar and its More filters drawer, the results toolbar, listing cards, pagination, a map view with drawing tools, loading placeholders and the MLS disclaimers.
A search page at /search on your domain. The URL holds the whole search in the API's own parameter
names (where, bedsMin, priceMax, page and the rest), and your server renders the first page
of results from it, so every search has a shareable link and the cards are in the first HTML. The
search box and the map load on top. Searches with filters a visitor picked are marked
noindex,follow by the API, so your area pages
are the pages that rank.
What the visitor sees

<!--
The More filters drawer built from the account's filter list.
From the React component FiltersDrawer with filters. Generated by npm run idx:recipes-static from @ruuster/idx-recipes. Do not edit it by hand.
Fill each value from:
form[data-rw-filters-apply]: "submit"
form[data-rw-base-url]: your own route made with @ruuster/idx/route, for example /api/idx (it adds your secret key on your server). On a site with no server, leave it out: the browser calls https://idx.ruuster.com/v1 with no key, from your approved website address
.rw-field--price: the basic controls of filters-drawer.html come first, every one of them; this sample prints only the price row so the rows from the list are in view
.rw-filters__dynamic: one row per filter of GET /v1/filters `data`, in its order: `group` "based" first, then "advanced" inside details[data-rw-filters-section]. RuusterIdx.filterRowNodes builds the same rows from the list
[data-rw-filter]: the filter's key; the control follows its `type` (HOOKS.md lists each one)
input, select with a name: the parameter GET /v1/listings takes: f.{key}, f.{key}Min, f.{key}Max, f.{key}_o, or the filter's own name (sqftMin, yearMin, hoaMin, lotSqftMin and their Max, newConstruction, priceReduction, keywords); the value is the current one from the page's URL
details[data-rw-pick] [data-rw-pick-list]: one checkbox per choice of GET /v1/filters/options `data.options` when you have them; otherwise the values already in the URL, and the script loads the rest when the list opens
input[type=hidden]: the kept location parameters, and any filter in the URL that has no control in the form
Every data-rw-* attribute is a hook for ruuster-idx.js; see ../HOOKS.md.
-->
<div class="rw-recipes rw-morefilters-wrap" data-rw-drawer-root=""><button type="button" class="rw-morefilters" aria-haspopup="dialog" aria-expanded="false" aria-controls="rw-filters-1g3123o-drawer" data-rw-drawer-open="rw-filters-1g3123o-drawer"><svg class="rw-icon rw-morefilters__icon" viewBox="0 0 20 20" width="24" height="24" data-rw-icon="tuning-black" focusable="false" aria-hidden="true"><g fill="none"><path d="M7.7085 11.6654C9.08921 11.6654 10.2085 12.7847 10.2085 14.1654C10.2085 15.5461 9.08921 16.6654 7.7085 16.6654C6.32778 16.6654 5.2085 15.5461 5.2085 14.1654C5.2085 12.7847 6.32778 11.6654 7.7085 11.6654Z" fill="currentColor"/><path d="M11.8752 3.33203C10.4945 3.33203 9.37516 4.45132 9.37516 5.83203C9.37516 7.21274 10.4945 8.33203 11.8752 8.33203C13.2559 8.33203 14.3752 7.21274 14.3752 5.83203C14.3752 4.45132 13.2559 3.33203 11.8752 3.33203Z" fill="currentColor"/><path d="M7.29183 5.17247C7.63701 5.17247 7.91683 5.45229 7.91683 5.79747C7.91683 6.14264 7.63701 6.42247 7.29183 6.42247L1.4585 6.42246C1.11332 6.42246 0.833496 6.14264 0.833496 5.79746C0.833496 5.45229 1.11332 5.17247 1.4585 5.17247H7.29183Z" fill="currentColor"/><path d="M12.2918 13.5058C11.9467 13.5058 11.6668 13.7856 11.6668 14.1308C11.6668 14.476 11.9467 14.7558 12.2918 14.7558H18.1252C18.4703 14.7558 18.7502 14.476 18.7502 14.1308C18.7502 13.7856 18.4703 13.5058 18.1252 13.5058H12.2918Z" fill="currentColor"/><path d="M0.833496 14.1308C0.833496 13.7856 1.11332 13.5058 1.4585 13.5058H3.12516C3.47034 13.5058 3.75016 13.7856 3.75016 14.1308C3.75016 14.476 3.47034 14.7558 3.12516 14.7558H1.4585C1.11332 14.7558 0.833496 14.476 0.833496 14.1308Z" fill="currentColor"/><path d="M18.1252 5.17247C18.4703 5.17247 18.7502 5.45229 18.7502 5.79747C18.7502 6.14264 18.4703 6.42247 18.1252 6.42247L16.4585 6.42246C16.1133 6.42246 15.8335 6.14264 15.8335 5.79746C15.8335 5.45229 16.1133 5.17247 16.4585 5.17247H18.1252Z" fill="currentColor"/></g></svg><span class="rw-morefilters__label">More filters (5)</span><span class="rw-morefilters__badge" aria-hidden="true">5</span></button><dialog class="rw-drawer" id="rw-filters-1g3123o-drawer" aria-labelledby="rw-filters-1g3123o-drawer-title" data-rw-drawer=""><div class="rw-drawer__header"><h2 class="rw-drawer__title" id="rw-filters-1g3123o-drawer-title">More filters</h2><button type="button" class="rw-drawer__close" aria-label="Close the filters" data-rw-drawer-close=""><svg class="rw-icon" viewBox="0 0 24 24" width="24" height="24" data-rw-icon="drawer-header-close" focusable="false" aria-hidden="true"><g fill="none"><path d="M18 18L6 6" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><path d="M18 6L6 18" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></g></svg></button></div><div class="rw-drawer__body"><form class="rw-recipes rw-filters" method="get" action="/search" id="rw-filters-1g3123o-drawer-form" aria-label="Filter homes" data-rw-filters="" data-rw-filters-apply="submit" data-rw-base-url="/api/idx"><input type="hidden" name="city" value="Powder Springs"/><input type="hidden" name="state" value="GA"/><div class="rw-filters__row"><div class="rw-field rw-field--price"><label class="rw-field__label" for="rw-filters-1g3123o-drawer-form-pmin">Minimum price</label><input class="rw-input" id="rw-filters-1g3123o-drawer-form-pmin" name="priceMin" type="number" inputMode="numeric" min="0" step="1000" placeholder="Any price" value="300000"/><label class="rw-field__label" for="rw-filters-1g3123o-drawer-form-pmax">Maximum price</label><input class="rw-input" id="rw-filters-1g3123o-drawer-form-pmax" name="priceMax" type="number" inputMode="numeric" min="0" step="1000" placeholder="Any price" value=""/></div></div><div class="rw-filters__dynamic" data-rw-filters-dynamic=""><fieldset class="rw-field rw-field--pick" data-rw-filter="highSchool" data-rw-filter-label="schools"><legend class="rw-field__label">Schools</legend><details class="rw-pick" data-rw-pick="multi" data-rw-pick-key="highSchool"><summary class="rw-pick__summary" data-rw-pick-summary="">Select options</summary><div class="rw-pick__panel"><input class="rw-input rw-pick__narrow" type="search" placeholder="Type to narrow the list" aria-label="Schools: type to narrow the list" autoComplete="off" data-rw-pick-narrow=""/><div class="rw-pick__list" data-rw-pick-list=""></div><input class="rw-input rw-pick__free" type="text" name="f.highSchool" placeholder="Type a value" aria-label="Schools: type a value" autoComplete="off" data-rw-pick-free="" data-rw-val="highSchool"/><p class="rw-pick__status" role="status" data-rw-pick-status=""></p></div></details><details class="rw-field__more"><summary class="rw-field__more-toggle">More options</summary><div class="rw-field__more-panel"><label class="rw-field__label" for="rw-filters-1g3123o-drawer-form-f-highSchool-o">How to match</label><select class="rw-select" id="rw-filters-1g3123o-drawer-form-f-highSchool-o" name="f.highSchool_o" data-rw-op="highSchool"><option value="" selected="">The usual way</option><option value="and">Homes with all of these</option><option value="or">Homes with any of these</option><option value="not">Homes with none of these</option></select></div></details></fieldset><div class="rw-field" data-rw-filter="mainLevelPrimary" data-rw-filter-label="primary bedroom on main"><label class="rw-field__label" for="rw-filters-1g3123o-drawer-form-f-mainLevelPrimary">Primary Bedroom on Main</label><select class="rw-select" id="rw-filters-1g3123o-drawer-form-f-mainLevelPrimary" name="f.mainLevelPrimary" data-rw-val="mainLevelPrimary"><option value="" selected="">Any</option><option value="true">Yes</option><option value="false">No</option></select></div><fieldset class="rw-field rw-field--pick" data-rw-filter="basement" data-rw-filter-label="basement"><legend class="rw-field__label">Basement</legend><details class="rw-pick" data-rw-pick="multi" data-rw-pick-key="basement" data-rw-pick-loaded=""><summary class="rw-pick__summary" data-rw-pick-summary="">2 selected</summary><div class="rw-pick__panel"><div class="rw-pick__list" data-rw-pick-list=""><label class="rw-check"><input type="checkbox" name="f.basement" data-rw-val="basement" checked="" value="Finished"/><span>Finished (412)</span></label><label class="rw-check"><input type="checkbox" name="f.basement" data-rw-val="basement" checked="" value="Daylight"/><span>Daylight (268)</span></label><label class="rw-check"><input type="checkbox" name="f.basement" data-rw-val="basement" value="Unfinished"/><span>Unfinished (191)</span></label><label class="rw-check"><input type="checkbox" name="f.basement" data-rw-val="basement" value="Crawl Space"/><span>Crawl Space (144)</span></label><label class="rw-check"><input type="checkbox" name="f.basement" data-rw-val="basement" value="None"/><span>None (97)</span></label></div><p class="rw-pick__status" role="status" data-rw-pick-status=""></p></div></details><details class="rw-field__more"><summary class="rw-field__more-toggle">More options</summary><div class="rw-field__more-panel"><label class="rw-field__label" for="rw-filters-1g3123o-drawer-form-f-basement-o">How to match</label><select class="rw-select" id="rw-filters-1g3123o-drawer-form-f-basement-o" name="f.basement_o" data-rw-op="basement"><option value="" selected="">The usual way</option><option value="and">Homes with all of these</option><option value="or">Homes with any of these</option><option value="not">Homes with none of these</option></select></div></details></fieldset><fieldset class="rw-field rw-field--range" data-rw-filter="yearBuilt" data-rw-filter-label="year built"><legend class="rw-field__label">Year Built</legend><div class="rw-range"><input class="rw-input" id="rw-filters-1g3123o-drawer-form-f-yearBuilt-min" name="yearMin" type="number" inputMode="decimal" step="any" placeholder="No min" aria-label="Year Built, minimum" data-rw-val="yearBuilt" value="1990"/><span class="rw-range__sep" aria-hidden="true"></span><input class="rw-input" id="rw-filters-1g3123o-drawer-form-f-yearBuilt-max" name="yearMax" type="number" inputMode="decimal" step="any" placeholder="No max" aria-label="Year Built, maximum" data-rw-val="yearBuilt" value=""/></div></fieldset><fieldset class="rw-field rw-field--range" data-rw-filter="square" data-rw-filter-label="square feet"><legend class="rw-field__label">Square Feet</legend><div class="rw-range"><input class="rw-input" id="rw-filters-1g3123o-drawer-form-f-square-min" name="sqftMin" type="number" inputMode="decimal" step="any" placeholder="No min" aria-label="Square Feet, minimum" data-rw-val="square" value=""/><span class="rw-range__sep" aria-hidden="true"></span><input class="rw-input" id="rw-filters-1g3123o-drawer-form-f-square-max" name="sqftMax" type="number" inputMode="decimal" step="any" placeholder="No max" aria-label="Square Feet, maximum" data-rw-val="square" value=""/></div></fieldset><details class="rw-filters__section" data-rw-filters-section="advanced" open=""><summary class="rw-filters__section-title">Advanced filters (1)</summary><div class="rw-field rw-filters__find"><input class="rw-input" type="search" placeholder="Find a filter" aria-label="Find a filter" autoComplete="off" data-rw-filters-find=""/></div><fieldset class="rw-field rw-field--range" data-rw-filter="garageSpaces" data-rw-filter-label="garage spaces"><legend class="rw-field__label">Garage Spaces</legend><div class="rw-range"><input class="rw-input" id="rw-filters-1g3123o-drawer-form-f-garageSpaces-min" name="f.garageSpacesMin" type="number" inputMode="decimal" step="any" placeholder="No min" aria-label="Garage Spaces, minimum" data-rw-val="garageSpaces" value=""/><span class="rw-range__sep" aria-hidden="true"></span><input class="rw-input" id="rw-filters-1g3123o-drawer-form-f-garageSpaces-max" name="f.garageSpacesMax" type="number" inputMode="decimal" step="any" placeholder="No max" aria-label="Garage Spaces, maximum" data-rw-val="garageSpaces" value=""/></div><details class="rw-field__more"><summary class="rw-field__more-toggle">More options</summary><div class="rw-field__more-panel"><label class="rw-check"><input type="checkbox" name="f.garageSpaces_o" data-rw-op="garageSpaces" value="zbyes"/><span>Also show homes with no value for this</span></label></div></details></fieldset><div class="rw-field" data-rw-filter="hasVirtualTour" data-rw-filter-label="virtual tour"><label class="rw-field__label" for="rw-filters-1g3123o-drawer-form-f-hasVirtualTour">Virtual Tour</label><select class="rw-select" id="rw-filters-1g3123o-drawer-form-f-hasVirtualTour" name="f.hasVirtualTour" data-rw-val="hasVirtualTour"><option value="" selected="">Any</option><option value="true">Yes</option><option value="false">No</option></select></div><fieldset class="rw-field rw-field--pick" data-rw-filter="architecturalStyle" data-rw-filter-label="architectural style"><legend class="rw-field__label">Architectural Style</legend><details class="rw-pick" data-rw-pick="multi" data-rw-pick-key="architecturalStyle"><summary class="rw-pick__summary" data-rw-pick-summary="">Select options</summary><div class="rw-pick__panel"><input class="rw-input rw-pick__narrow" type="search" placeholder="Type to narrow the list" aria-label="Architectural Style: type to narrow the list" autoComplete="off" data-rw-pick-narrow=""/><div class="rw-pick__list" data-rw-pick-list=""></div><input class="rw-input rw-pick__free" type="text" name="f.architecturalStyle" placeholder="Type a value" aria-label="Architectural Style: type a value" autoComplete="off" data-rw-pick-free="" data-rw-val="architecturalStyle"/><p class="rw-pick__status" role="status" data-rw-pick-status=""></p></div></details><details class="rw-field__more"><summary class="rw-field__more-toggle">More options</summary><div class="rw-field__more-panel"><label class="rw-field__label" for="rw-filters-1g3123o-drawer-form-f-architecturalStyle-o">How to match</label><select class="rw-select" id="rw-filters-1g3123o-drawer-form-f-architecturalStyle-o" name="f.architecturalStyle_o" data-rw-op="architecturalStyle"><option value="" selected="">The usual way</option><option value="and">Homes with all of these</option><option value="or">Homes with any of these</option><option value="not">Homes with none of these</option></select></div></details></fieldset><div class="rw-field" data-rw-filter="waterfront" data-rw-filter-label="waterfront"><label class="rw-field__label" for="rw-filters-1g3123o-drawer-form-f-waterfront">Waterfront</label><select class="rw-select" id="rw-filters-1g3123o-drawer-form-f-waterfront" name="f.waterfront" data-rw-val="waterfront"><option value="">Any</option><option value="true" selected="">Yes</option><option value="false">No</option></select></div><div class="rw-field" data-rw-filter="levels" data-rw-filter-label="levels"><label class="rw-field__label" for="rw-filters-1g3123o-drawer-form-f-levels">Levels</label><input class="rw-input" id="rw-filters-1g3123o-drawer-form-f-levels" name="f.levels" type="text" placeholder="Type a value" list="rw-filters-1g3123o-drawer-form-f-levels-list" autoComplete="off" data-rw-pick="single" data-rw-pick-key="levels" data-rw-val="levels" value=""/><datalist id="rw-filters-1g3123o-drawer-form-f-levels-list"></datalist></div><div class="rw-field" data-rw-filter="listedOn" data-rw-filter-label="listed"><label class="rw-field__label" for="rw-filters-1g3123o-drawer-form-f-listedOn">Listed</label><select class="rw-select" id="rw-filters-1g3123o-drawer-form-f-listedOn" name="f.listedOn" data-rw-val="listedOn"><option value="" selected="">Any time</option><option value="1">In the past day</option><option value="7">In the past 7 days</option><option value="14">In the past 14 days</option><option value="30">In the past 30 days</option><option value="90">In the past 90 days</option></select></div><div class="rw-field" data-rw-filter="poolPrivate" data-rw-filter-label="private pool"><label class="rw-field__label" for="rw-filters-1g3123o-drawer-form-f-poolPrivate">Private Pool</label><select class="rw-select" id="rw-filters-1g3123o-drawer-form-f-poolPrivate" name="f.poolPrivate" data-rw-val="poolPrivate"><option value="" selected="">Any</option><option value="true">Yes</option><option value="false">No</option></select></div><fieldset class="rw-field rw-field--range" data-rw-filter="fireplacesTotal" data-rw-filter-label="fireplaces"><legend class="rw-field__label">Fireplaces</legend><div class="rw-range"><input class="rw-input" id="rw-filters-1g3123o-drawer-form-f-fireplacesTotal-min" name="f.fireplacesTotalMin" type="number" inputMode="decimal" step="any" placeholder="No min" aria-label="Fireplaces, minimum" data-rw-val="fireplacesTotal" value=""/><span class="rw-range__sep" aria-hidden="true"></span><input class="rw-input" id="rw-filters-1g3123o-drawer-form-f-fireplacesTotal-max" name="f.fireplacesTotalMax" type="number" inputMode="decimal" step="any" placeholder="No max" aria-label="Fireplaces, maximum" data-rw-val="fireplacesTotal" value=""/></div></fieldset><fieldset class="rw-field rw-field--pick" data-rw-filter="heating" data-rw-filter-label="heating"><legend class="rw-field__label">Heating</legend><details class="rw-pick" data-rw-pick="multi" data-rw-pick-key="heating"><summary class="rw-pick__summary" data-rw-pick-summary="">Select options</summary><div class="rw-pick__panel"><input class="rw-input rw-pick__narrow" type="search" placeholder="Type to narrow the list" aria-label="Heating: type to narrow the list" autoComplete="off" data-rw-pick-narrow=""/><div class="rw-pick__list" data-rw-pick-list=""></div><input class="rw-input rw-pick__free" type="text" name="f.heating" placeholder="Type a value" aria-label="Heating: type a value" autoComplete="off" data-rw-pick-free="" data-rw-val="heating"/><p class="rw-pick__status" role="status" data-rw-pick-status=""></p></div></details><details class="rw-field__more"><summary class="rw-field__more-toggle">More options</summary><div class="rw-field__more-panel"><label class="rw-field__label" for="rw-filters-1g3123o-drawer-form-f-heating-o">How to match</label><select class="rw-select" id="rw-filters-1g3123o-drawer-form-f-heating-o" name="f.heating_o" data-rw-op="heating"><option value="" selected="">The usual way</option><option value="and">Homes with all of these</option><option value="or">Homes with any of these</option><option value="not">Homes with none of these</option></select></div></details></fieldset><fieldset class="rw-field rw-field--pick" data-rw-filter="cooling" data-rw-filter-label="cooling"><legend class="rw-field__label">Cooling</legend><details class="rw-pick" data-rw-pick="multi" data-rw-pick-key="cooling"><summary class="rw-pick__summary" data-rw-pick-summary="">Select options</summary><div class="rw-pick__panel"><input class="rw-input rw-pick__narrow" type="search" placeholder="Type to narrow the list" aria-label="Cooling: type to narrow the list" autoComplete="off" data-rw-pick-narrow=""/><div class="rw-pick__list" data-rw-pick-list=""></div><input class="rw-input rw-pick__free" type="text" name="f.cooling" placeholder="Type a value" aria-label="Cooling: type a value" autoComplete="off" data-rw-pick-free="" data-rw-val="cooling"/><p class="rw-pick__status" role="status" data-rw-pick-status=""></p></div></details><details class="rw-field__more"><summary class="rw-field__more-toggle">More options</summary><div class="rw-field__more-panel"><label class="rw-field__label" for="rw-filters-1g3123o-drawer-form-f-cooling-o">How to match</label><select class="rw-select" id="rw-filters-1g3123o-drawer-form-f-cooling-o" name="f.cooling_o" data-rw-op="cooling"><option value="" selected="">The usual way</option><option value="and">Homes with all of these</option><option value="or">Homes with any of these</option><option value="not">Homes with none of these</option></select></div></details></fieldset><fieldset class="rw-field rw-field--pick" data-rw-filter="flooring" data-rw-filter-label="flooring"><legend class="rw-field__label">Flooring</legend><details class="rw-pick" data-rw-pick="multi" data-rw-pick-key="flooring"><summary class="rw-pick__summary" data-rw-pick-summary="">Select options</summary><div class="rw-pick__panel"><input class="rw-input rw-pick__narrow" type="search" placeholder="Type to narrow the list" aria-label="Flooring: type to narrow the list" autoComplete="off" data-rw-pick-narrow=""/><div class="rw-pick__list" data-rw-pick-list=""></div><input class="rw-input rw-pick__free" type="text" name="f.flooring" placeholder="Type a value" aria-label="Flooring: type a value" autoComplete="off" data-rw-pick-free="" data-rw-val="flooring"/><p class="rw-pick__status" role="status" data-rw-pick-status=""></p></div></details><details class="rw-field__more"><summary class="rw-field__more-toggle">More options</summary><div class="rw-field__more-panel"><label class="rw-field__label" for="rw-filters-1g3123o-drawer-form-f-flooring-o">How to match</label><select class="rw-select" id="rw-filters-1g3123o-drawer-form-f-flooring-o" name="f.flooring_o" data-rw-op="flooring"><option value="" selected="">The usual way</option><option value="and">Homes with all of these</option><option value="or">Homes with any of these</option><option value="not">Homes with none of these</option></select></div></details></fieldset><fieldset class="rw-field rw-field--pick" data-rw-filter="lotFeatures" data-rw-filter-label="lot features"><legend class="rw-field__label">Lot Features</legend><details class="rw-pick" data-rw-pick="multi" data-rw-pick-key="lotFeatures"><summary class="rw-pick__summary" data-rw-pick-summary="">Select options</summary><div class="rw-pick__panel"><input class="rw-input rw-pick__narrow" type="search" placeholder="Type to narrow the list" aria-label="Lot Features: type to narrow the list" autoComplete="off" data-rw-pick-narrow=""/><div class="rw-pick__list" data-rw-pick-list=""></div><input class="rw-input rw-pick__free" type="text" name="f.lotFeatures" placeholder="Type a value" aria-label="Lot Features: type a value" autoComplete="off" data-rw-pick-free="" data-rw-val="lotFeatures"/><p class="rw-pick__status" role="status" data-rw-pick-status=""></p></div></details><details class="rw-field__more"><summary class="rw-field__more-toggle">More options</summary><div class="rw-field__more-panel"><label class="rw-field__label" for="rw-filters-1g3123o-drawer-form-f-lotFeatures-o">How to match</label><select class="rw-select" id="rw-filters-1g3123o-drawer-form-f-lotFeatures-o" name="f.lotFeatures_o" data-rw-op="lotFeatures"><option value="" selected="">The usual way</option><option value="and">Homes with all of these</option><option value="or">Homes with any of these</option><option value="not">Homes with none of these</option></select></div></details></fieldset><div class="rw-field" data-rw-filter="seniorCommunity" data-rw-filter-label="senior community"><label class="rw-field__label" for="rw-filters-1g3123o-drawer-form-f-seniorCommunity">Senior Community</label><select class="rw-select" id="rw-filters-1g3123o-drawer-form-f-seniorCommunity" name="f.seniorCommunity" data-rw-val="seniorCommunity"><option value="" selected="">Any</option><option value="true">Yes</option><option value="false">No</option></select></div></details></div></form></div><div class="rw-drawer__footer"><a class="rw-drawer__reset" href="/search?city=Powder+Springs&state=GA" data-rw-drawer-reset="">Reset filters</a><button class="rw-button rw-drawer__show" type="submit" form="rw-filters-1g3123o-drawer-form">Show results</button></div></dialog></div>import { FiltersDrawer } from "@ruuster/idx-recipes";
<FiltersDrawer
action={action}
value={value}
fields={fields}
filters={filters}
choices={choices}
baseUrl={baseUrl}
/>

<!--
The result grid while a search loads (eight card placeholders).
From the React component ListingGridSkeleton. Generated by npm run idx:recipes-static from @ruuster/idx-recipes. Do not edit it by hand.
Fill each value from:
.rw-grid--loading: fixed markup; the shimmer starts after 200ms
Every data-rw-* attribute is a hook for ruuster-idx.js; see ../HOOKS.md.
-->
<div class="rw-recipes rw-grid rw-grid--loading" role="status" aria-label="Loading listings." data-rw-skeleton="grid">
<ul class="rw-grid__list" aria-hidden="true">
<li class="rw-grid__item">
<div class="rw-recipes rw-skel-card" aria-hidden="true" data-rw-skeleton="card">
<span class="rw-skel rw-skel-card__image"></span>
<span class="rw-skel-card__band">
<span class="rw-skel rw-skel-card__price"></span>
<span class="rw-skel rw-skel-card__params"></span>
<span class="rw-skel rw-skel-card__address"></span>
</span>
</div>
</li>
<li class="rw-grid__item">
<div class="rw-recipes rw-skel-card" aria-hidden="true" data-rw-skeleton="card">
<span class="rw-skel rw-skel-card__image"></span>
<span class="rw-skel-card__band">
<span class="rw-skel rw-skel-card__price"></span>
<span class="rw-skel rw-skel-card__params"></span>
<span class="rw-skel rw-skel-card__address"></span>
</span>
</div>
</li>
<li class="rw-grid__item">
<div class="rw-recipes rw-skel-card" aria-hidden="true" data-rw-skeleton="card">
<span class="rw-skel rw-skel-card__image"></span>
<span class="rw-skel-card__band">
<span class="rw-skel rw-skel-card__price"></span>
<span class="rw-skel rw-skel-card__params"></span>
<span class="rw-skel rw-skel-card__address"></span>
</span>
</div>
</li>
<li class="rw-grid__item">
<div class="rw-recipes rw-skel-card" aria-hidden="true" data-rw-skeleton="card">
<span class="rw-skel rw-skel-card__image"></span>
<span class="rw-skel-card__band">
<span class="rw-skel rw-skel-card__price"></span>
<span class="rw-skel rw-skel-card__params"></span>
<span class="rw-skel rw-skel-card__address"></span>
</span>
</div>
</li>
<li class="rw-grid__item">
<div class="rw-recipes rw-skel-card" aria-hidden="true" data-rw-skeleton="card">
<span class="rw-skel rw-skel-card__image"></span>
<span class="rw-skel-card__band">
<span class="rw-skel rw-skel-card__price"></span>
<span class="rw-skel rw-skel-card__params"></span>
<span class="rw-skel rw-skel-card__address"></span>
</span>
</div>
</li>
<li class="rw-grid__item">
<div class="rw-recipes rw-skel-card" aria-hidden="true" data-rw-skeleton="card">
<span class="rw-skel rw-skel-card__image"></span>
<span class="rw-skel-card__band">
<span class="rw-skel rw-skel-card__price"></span>
<span class="rw-skel rw-skel-card__params"></span>
<span class="rw-skel rw-skel-card__address"></span>
</span>
</div>
</li>
<li class="rw-grid__item">
<div class="rw-recipes rw-skel-card" aria-hidden="true" data-rw-skeleton="card">
<span class="rw-skel rw-skel-card__image"></span>
<span class="rw-skel-card__band">
<span class="rw-skel rw-skel-card__price"></span>
<span class="rw-skel rw-skel-card__params"></span>
<span class="rw-skel rw-skel-card__address"></span>
</span>
</div>
</li>
<li class="rw-grid__item">
<div class="rw-recipes rw-skel-card" aria-hidden="true" data-rw-skeleton="card">
<span class="rw-skel rw-skel-card__image"></span>
<span class="rw-skel-card__band">
<span class="rw-skel rw-skel-card__price"></span>
<span class="rw-skel rw-skel-card__params"></span>
<span class="rw-skel rw-skel-card__address"></span>
</span>
</div>
</li>
</ul>
</div>import { ListingGridSkeleton } from "@ruuster/idx-recipes";
<ListingGridSkeleton {...props} />What is on the page
- The filter bar. From 1741 pixels, Status, Price, Beds and baths, and Home type open as small panels with an Apply button. "More filters" opens a drawer from the right with every filter, "Reset filters" (which keeps the place) and "Show results". The button shows how many filters are on, such as "More filters (2)". Under 520 pixels it fills the width.
- Every filter your account offers. The drawer builds itself from
GET /v1/filters: after price, beds, baths, type, status and sort come the filters of your own Ruuster filter panel, in its order, then every other filter your MLSs offer under "Advanced filters". Each one gets the right control for its type, and a list's choices load when the visitor opens it. You write no field names. - The results toolbar. "Showing 37 listings", the "Sort by" menu, which applies as soon as the
visitor picks an order, and the Grid and Map switch. Each switch is a link to the same search, with
view=mapfor the map. Without JavaScript, the sort menu has its own button for screen readers and keyboards. - The grid of cards, one to four columns by width, with the page links under it.
- The map view at
?view=map: up to 200 price pins across the full width. Pins close together group into a circle with the number of homes, and a click zooms in on them. After the visitor pans or zooms, "Search this area" reloads the page for the box on screen withbbox=. The tools on the right draw an area or a circle (sent aspolygon=), lock the drawn area, and switch to the satellite view; "Clear the drawn area" removes it. A school search shows a school pin at the school's outline. - The loading state.
app/search/loading.tsxshows the outline of the count and eight cards. The shimmer starts only after 200 milliseconds and holds still for visitors who ask for less motion.
What the page calls
| When | Request | Key | Cached |
|---|---|---|---|
| Each page view | GET /v1/listings with the URL's parameters, limit=24 and pageHref=/search |
secret key, on your server | 5 minutes by Next.js (revalidate) |
The map view (?view=map) |
GET /v1/listings with the URL's parameters and view=map, up to 200 pins |
secret key, on your server | 5 minutes by Next.js |
| When the search is an outlined area and the map is on | GET /v1/boundaries/{boundaryId} for the outline |
secret key, on your server | 5 minutes by Next.js |
| Each page view | GET /v1/filters for the drawer's filter list |
secret key, on your server | 5 minutes by Next.js |
| When the visitor opens a list in the drawer | GET /v1/filters/options for that filter's choices, through your listings route |
secret key, added by your listings route | an hour at Ruuster's edge |
| As the visitor types in the search box | GET /v1/suggest, through your listings route |
secret key, added by your listings route | an hour at Ruuster's edge |
The results call, as the server sends it for a visitor who searched Midtown with 3 or more beds:
curl -s -G "https://idx.ruuster.com/v1/listings" \
--data-urlencode 'where={"label":"Atlanta, GA Midtown","value":"a0000000-0000-4000-8000-000000000001","source":"neighborhood","data":{"state":"GA"}}' \
--data-urlencode bedsMin=3 \
--data-urlencode limit=24 \
--data-urlencode pageHref=/search \
-H "Authorization: Bearer $IDX_SECRET_KEY"import { createClient } from "@ruuster/idx";
const idx = createClient({ secretKey: process.env.IDX_SECRET_KEY });
const r = await idx.search({
where: {
label: "Atlanta, GA Midtown",
value: "a0000000-0000-4000-8000-000000000001",
source: "neighborhood",
data: {
state: "GA",
},
},
bedsMin: 3,
limit: 24,
pageHref: "/search",
});
if (!r.ok) throw new Error(`${r.error.code}: ${r.error.message}`);
console.log(r.data);import os
import requests
res = requests.get(
"https://idx.ruuster.com/v1/listings",
params={
"where": "{\"label\":\"Atlanta, GA Midtown\",\"value\":\"a0000000-0000-4000-8000-000000000001\",\"source\":\"neighborhood\",\"data\":{\"state\":\"GA\"}}",
"bedsMin": "3",
"limit": "24",
"pageHref": "/search",
},
headers={"Authorization": "Bearer " + os.environ["IDX_SECRET_KEY"]},
timeout=30,
)
body = res.json()
if not body["ok"]:
raise RuntimeError(body["error"]["code"] + ": " + body["error"]["message"])
print(body["data"])<?php
$query = http_build_query([
'where' => '{"label":"Atlanta, GA Midtown","value":"a0000000-0000-4000-8000-000000000001","source":"neighborhood","data":{"state":"GA"}}',
'bedsMin' => '3',
'limit' => '24',
'pageHref' => '/search',
], '', '&', PHP_QUERY_RFC3986);
$ch = curl_init('https://idx.ruuster.com/v1/listings' . '?' . $query);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('IDX_SECRET_KEY')],
CURLOPT_TIMEOUT => 30,
]);
$body = json_decode(curl_exec($ch), true);
curl_close($ch);
if (!$body['ok']) {
throw new RuntimeException($body['error']['code'] . ': ' . $body['error']['message']);
}
print_r($body['data']);The answer holds listings (each card with its href on your site), total, page, pages,
viewport and boundary for the map, head for your page's metadata, jsonLd, and meta.mls with
every board's disclaimer.
Steps
- Add
lib/idx.ts,lib/site.tsandcomponents/results.tsxfrom the recipes overview, andlib/area-query.tsandlib/results.tsfrom below. - In
.env.local, setIDX_SECRET_KEY,SITE_ORIGINandSITE_NAME. For the map, setNEXT_PUBLIC_GOOGLE_MAPS_KEYandNEXT_PUBLIC_GOOGLE_MAP_ID(your own Google Maps key, restricted to your domains). - Add your listings route,
app/api/idx/[...path]/route.ts, withcreateListingsRoutefrom@ruuster/idx/route(No key in your pages), and giveSearchBoxandFiltersbaseUrl="/api/idx". The page carries no key, and the route works onlocalhostand on staging. - Create
app/search/page.tsx,app/search/loading.tsx,components/map-results.tsxandlib/search-view.tswith the code below. Before a visitor picks a place, the page shows your popular areas as links (fromcontent/areas.ts) and your own listings, so the page is never empty and search engines find your area pages from it. - Run
npm run dev, openhttp://localhost:3000/search, type a place in the search box and pick it. - Link to
/searchfrom your header.
The code
app/search/page.tsx
// /search: the first page of results is rendered on the server from the URL. The search box and the
// filters write the API's own parameter names into the URL, so every search has a shareable link.
// The API marks searches with visitor-picked filters noindex,follow, so your area pages are the ones that rank.
// Above the results: the filter bar (quick filters on wide screens, then "More filters" with the
// drawer, which lists every filter your account offers from GET /v1/filters) and the toolbar (the count, the sort order and the Grid and Map switch). `?view=map` swaps
// the grid for a full-width map; loading.tsx shows the card outlines while a search runs.
import { notFound } from "next/navigation";
import { fromSearchParams } from "@ruuster/idx";
import { Filters, ResultsToolbar, SearchBox } from "@ruuster/idx-recipes";
import Link from "next/link";
import { FeaturedStrip } from "@/components/featured-strip";
import { MapResults } from "@/components/map-results";
import { Results } from "@/components/results";
import { AREAS } from "@/content/areas";
import { idx } from "@/lib/idx";
import { hasLocation, PAGE_SIZE, type CardQuery } from "@/lib/area-query";
import { failureAction, resultsMetadata } from "@/lib/results";
import { currentHref, filterValue, SEARCH_KEEP, searchView } from "@/lib/search-view";
type Props = { searchParams: Record<string, string | string[] | undefined> };
function searchQuery(searchParams: Props["searchParams"]): CardQuery {
return { ...fromSearchParams(searchParams), limit: PAGE_SIZE, pageHref: "/search" };
}
export async function generateMetadata({ searchParams }: Props) {
const q = searchQuery(searchParams);
if (!hasLocation(q)) return { title: "Search homes for sale", robots: "noindex,follow" };
const r = await idx.search(q);
return r.ok ? resultsMetadata(r.data.head, "Homes for sale") : { title: "Search homes for sale", robots: "noindex,follow" };
}
export default async function SearchPage({ searchParams }: Props) {
const q = searchQuery(searchParams);
const box = <SearchBox action="/search" baseUrl="/api/idx" />;
if (!hasLocation(q)) {
return (
<main>
<h1>Search homes for sale</h1>
{box}
<p>Type a city, neighborhood, ZIP code or school, then pick it from the list.</p>
{/* Before a place is picked: your area pages and your own listings, server-rendered with real links. */}
<section aria-labelledby="popular-areas">
<h2 id="popular-areas">Popular areas</h2>
<ul className="site-chips">
{AREAS.map((a) => (
<li key={a.slug}>
<Link href={`/neighborhoods/${a.slug}`}>{a.name}</Link>
</li>
))}
</ul>
</section>
<FeaturedStrip title="Homes we're listing now" />
</main>
);
}
const view = searchView(searchParams);
// The grid asks for one page of cards; the map view asks for up to 200 price pins instead.
const cards = view === "list" ? await idx.search(q) : null;
const pins = view === "map" ? await idx.search({ ...q, view: "map", limit: undefined, pageHref: undefined }) : null;
const r = cards ?? pins!;
if (!r.ok) {
const action = failureAction(r);
if (action === "not_found") notFound();
if (action === "throw") throw new Error(`Listings API ${r.status} ${r.error.code}`);
return (
<main>
<h1>Search homes for sale</h1>
{box}
<p>We could not run that search. Try another place or fewer filters.</p>
</main>
);
}
const here = currentHref("/search", searchParams);
// Your account's own filters, in the order your panel shows them. If the call fails, the drawer
// keeps the basic controls (price, beds, baths, type, status, sort).
const filters = await idx.filters();
return (
<main>
<h1>{r.data.location?.label ? `Homes for sale in ${r.data.location.label}` : "Homes for sale"}</h1>
<Filters
value={filterValue(q, searchParams)}
action="/search"
layout="bar"
keep={SEARCH_KEEP}
search={box}
filters={filters.ok ? filters.data : undefined}
baseUrl="/api/idx"
/>
<ResultsToolbar total={r.data.total} view={view} basePath="/search" searchParams={searchParams} />
{pins?.ok ? <MapResults r={pins} searchHref={here} /> : null}
{cards?.ok ? <Results r={cards} basePath="/search" searchParams={searchParams} listName="Search results" searchHref={here} /> : null}
</main>
);
}
app/search/loading.tsx
// What the search page shows while a search runs: the count's outline and eight card outlines in the
// grid's own columns, with a soft shimmer that appears only when the wait passes 200 milliseconds.
import { ListingGridSkeleton, ResultsCountSkeleton } from "@ruuster/idx-recipes";
export default function SearchLoading() {
return (
<main>
<h1>Search homes for sale</h1>
<ResultsCountSkeleton />
<ListingGridSkeleton count={8} />
</main>
);
}
lib/search-view.ts
// The search page's two views and the parts of its URL the filters and the map keep.
import type { SearchParamsInput, SearchQuery } from "@ruuster/idx";
/** The grid of cards (the default) or the full-width map (`?view=map`). */
export type SearchView = "list" | "map";
/** `view=map` shows the map; anything else shows the grid. */
export function searchView(searchParams: SearchParamsInput): SearchView {
const raw = searchParams instanceof URLSearchParams ? searchParams.get("view") : searchParams.view;
const v = Array.isArray(raw) ? raw[0] : raw;
return v === "map" ? "map" : "list";
}
/**
* The parameters the filter forms carry as hidden fields: the location the visitor picked, the area
* they drew or moved the map to, and the view, so a filter change keeps the same place and view.
*/
export const SEARCH_KEEP: readonly string[] = ["where", "boundariesId", "zip", "city", "state", "shape", "bbox", "polygon", "view"];
/**
* The query the filter forms start from: the search itself, plus the two things a filter change must
* keep that the search does not hold as text, the map view and the map box as the URL wrote it.
*/
export function filterValue(q: SearchQuery, searchParams: SearchParamsInput): SearchQuery {
const out: SearchQuery = { ...q };
if (searchView(searchParams) === "map") out.view = "map";
const raw = searchParams instanceof URLSearchParams ? searchParams.get("bbox") : searchParams.bbox;
const bbox = Array.isArray(raw) ? raw[0] : raw;
if (typeof bbox === "string" && q.bbox) out.bbox = bbox;
return out;
}
/** The page's own path and query, which the map's "Search this area" and drawing tools start from. */
export function currentHref(basePath: string, searchParams: SearchParamsInput): string {
const q = new URLSearchParams();
const pairs: [string, string][] =
searchParams instanceof URLSearchParams
? Array.from(searchParams.entries())
: Object.entries(searchParams).flatMap(([k, v]) => (v === undefined ? [] : (Array.isArray(v) ? v : [v]).map((one): [string, string] => [k, String(one)])));
for (const [k, v] of pairs) q.append(k, v);
const s = q.toString();
return s ? `${basePath}?${s}` : basePath;
}
components/map-results.tsx
// The search page's map view: up to 200 price pins over the full width, the area's outline, the map's
// drawing tools and "Search this area", then every board's disclaimer. The grid view is results.tsx.
import type { IdxSuccess, ListingPin, SearchResult } from "@ruuster/idx";
import { AreaMap, MlsDisclaimers } from "@ruuster/idx-recipes";
import { idx } from "@/lib/idx";
type Props = {
r: IdxSuccess<SearchResult<ListingPin>>;
/** The page's own path and query (lib/search-view.ts currentHref), which the map tools start from. */
searchHref: string;
};
export async function MapResults({ r, searchHref }: Props) {
const mls = r.meta.mls;
const mapsKey = process.env.NEXT_PUBLIC_GOOGLE_MAPS_KEY;
const b = mapsKey && r.data.boundary ? await idx.boundary(r.data.boundary.id) : null;
return (
<>
{/* Without NEXT_PUBLIC_GOOGLE_MAPS_KEY the frame asks for the key, so a missing key shows in development. */}
<AreaMap
googleMapsKey={mapsKey ?? ""}
mapId={process.env.NEXT_PUBLIC_GOOGLE_MAP_ID || null}
viewport={r.data.viewport}
boundary={b?.ok ? b.data.geometry : null}
boundaryKind={b?.ok ? b.data.kind : null}
listings={r.data.listings}
mls={mls}
searchHref={searchHref}
/>
<MlsDisclaimers mls={mls} asOf={r.meta.freshness.asOf} />
</>
);
}
components/results.tsx
// The body of every results page: cards, pagination, the map, the MLS disclaimers and the JSON-LD.
import type { IdxSuccess, ListingCard, SearchResult } from "@ruuster/idx";
import { AreaMap, JsonLd, ListingGrid, MlsDisclaimers, Pagination } from "@ruuster/idx-recipes";
import { idx } from "@/lib/idx";
import { pageCount } from "@/lib/results";
type Props = {
r: IdxSuccess<SearchResult<ListingCard>>;
/** The page's own path, for the pagination links. */
basePath: string;
searchParams?: Readonly<Record<string, string | readonly string[] | undefined>>;
/** GA4 item_list_name for the cards. */
listName: string;
emptyText?: string;
/** Draw the map (needs NEXT_PUBLIC_GOOGLE_MAPS_KEY). */
map?: boolean;
/** The page's own path and query, which the map's "Search this area" and drawing tools start from. */
searchHref?: string;
};
export async function Results({ r, basePath, searchParams, listName, emptyText, map = true, searchHref }: Props) {
const mls = r.meta.mls;
const mapsKey = process.env.NEXT_PUBLIC_GOOGLE_MAPS_KEY;
// The outline of the searched area, when the search was a boundary and the map is on.
const b = map && mapsKey && r.data.boundary ? await idx.boundary(r.data.boundary.id) : null;
const boundary = b?.ok ? b.data.geometry : null;
return (
<>
<ListingGrid listings={r.data.listings} mls={mls} ga4ListName={listName} emptyText={emptyText ?? "No homes match this search right now."} />
<Pagination page={r.data.page} pages={pageCount(r.data)} basePath={basePath} searchParams={searchParams} />
{map && mapsKey && r.data.listings.length > 0 ? (
<AreaMap googleMapsKey={mapsKey} mapId={process.env.NEXT_PUBLIC_GOOGLE_MAP_ID || null} viewport={r.data.viewport} boundary={boundary} boundaryKind={b?.ok ? b.data.kind : null} listings={r.data.listings} mls={mls} searchHref={searchHref} drawing={Boolean(searchHref)} />
) : null}
<MlsDisclaimers mls={mls} asOf={r.meta.freshness.asOf} />
<JsonLd docs={r.data.jsonLd ?? []} />
</>
);
}
lib/area-query.ts
// Turns an area and the page's URL into the search the page sends.
// The area fixes the location; the visitor's URL may add filters, a sort order and a page.
import { fromSearchParams, type SearchParamsInput, type SearchQuery } from "@ruuster/idx";
import type { Area } from "@/content/areas";
/** A search that answers listing cards (the default view). */
export type CardQuery = Omit<SearchQuery, "view">;
/** URL names a visitor may not change on an area page: the location, the key-level options and the page size. */
const FIXED = ["where", "bbox", "polygon", "boundariesId", "zip", "city", "state", "shape", "ownListings", "agent", "office", "view", "detailHref", "pageHref", "indexable", "limit"] as const;
/** Results per page on every results page of this site. */
export const PAGE_SIZE = 24;
/** The visitor's filters, sort and page from the URL, without anything that would change the location. */
export function visitorQuery(searchParams: SearchParamsInput): CardQuery {
const q: Record<string, unknown> = { ...fromSearchParams(searchParams) };
for (const k of FIXED) delete q[k];
return q as CardQuery;
}
/** The API's default order; there is no "newest" sort. */
/** /neighborhoods/<slug>: the area's active listings in the API's recommended order unless the visitor picked another. */
export function areaQuery(area: Area, searchParams: SearchParamsInput): CardQuery {
return {
...visitorQuery(searchParams),
status: "active",
where: area.where,
limit: PAGE_SIZE,
pageHref: `/neighborhoods/${area.slug}`,
};
}
/** /neighborhoods/<slug>/sold: homes sold in the last 6 months, most recent first. */
export function soldQuery(area: Area, searchParams: SearchParamsInput): CardQuery {
const v = visitorQuery(searchParams);
return {
...v,
status: "closed",
soldPeriod: "6m",
sort: "close_date_desc",
where: area.where,
limit: PAGE_SIZE,
pageHref: `/neighborhoods/${area.slug}/sold`,
};
}
/** True when the query names a location (or own, agent or office listings), which every search needs. */
export function hasLocation(q: SearchQuery): boolean {
const where = Array.isArray(q.where) ? q.where.length > 0 : Boolean(q.where);
return where || Boolean(q.bbox || q.polygon || q.boundariesId || q.zip || q.city || q.state || q.shape || q.ownListings || q.agent || q.office);
}
/**
* True when at least one of your boards shows sold data (GET /v1/meta capabilities.sold).
* Sold pages are published only then.
*/
export function showsSoldData(capabilities: Readonly<Record<string, unknown>> | null | undefined): boolean {
const sold = capabilities?.sold;
return Array.isArray(sold) && sold.some((b) => typeof b === "object" && b !== null && (b as { allowed?: unknown }).allowed === true);
}
lib/results.ts
// What a page does with an API answer that is not a success, and the head tags of a results page.
import { toMetadata, type IdxFailure, type PageHead } from "@ruuster/idx";
/** The error codes after which the page should not exist at all (HTTP 404). */
const PAGE_DOES_NOT_EXIST = new Set(["not_found", "boundary_not_found", "agent_not_found", "shape_not_found", "mls_not_in_scope", "location_not_supported", "filter_not_supported", "sold_not_permitted", "own_listings_unconfigured"]);
/**
* "not_found": answer 404 (call notFound()).
* "throw": throw, so Next.js keeps serving the last good page and tries again later (429, 503, network).
* "empty": render the page with no listings (a filter value the visitor typed was refused).
*/
export function failureAction(r: Pick<IdxFailure, "status" | "error">): "not_found" | "throw" | "empty" {
if (r.status === 404 || PAGE_DOES_NOT_EXIST.has(r.error.code)) return "not_found";
if (r.error.retryable || r.status === 0 || r.status === 429 || r.status >= 500) return "throw";
return "empty";
}
/** The number of result pages: the API's own `pages` when the answer carries it. */
export function pageCount(data: { total: number; limit: number; pages?: number }): number {
if (typeof data.pages === "number") return data.pages;
if (data.total <= 0 || data.limit <= 0) return 0;
// The API pages through the first 2,000 results of a search.
return Math.min(Math.ceil(data.total / data.limit), Math.floor(2000 / data.limit));
}
/** Next.js metadata for a results page: the head the API built, or a plain title until it has one. */
export function resultsMetadata(head: PageHead | undefined, fallbackTitle: string) {
return head ? toMetadata(head) : { title: fallbackTitle };
}
Forms and your CRM
The search page carries no forms. Tour and contact forms belong on your listing pages, and they send leads to your CRM through your own route (Registration, tour and contact forms, Your CRM).
Rules this page follows
MUST
- Call
GET /v1/listingsfrom your server with the secret key. - Show the attribution line on every card whose board requires one (
ListingGriddoes it) and every board's disclaimer with the "Data last updated" line (MlsDisclaimers). - Keep pagination, card links and the Grid and Map switch as plain
<a href>links. - Keep the place, the drawn area and the view on every filter change (
SEARCH_KEEPdoes it). - Use the
headthe API returns for the page's metadata, so filtered searches staynoindex,follow. - Throw on a 429 or 503, so Next.js keeps serving the last good page.
NEVER
- Put
IDX_SECRET_KEYin browser code or a URL. - Build or edit a
whereobject by hand: the search box writes the row/v1/suggestanswered. - Show a street address or map pin the API left out.
Test it
curl -s "http://localhost:3000/search?where=%7B%22label%22%3A%22Atlanta%2C%20GA%20Midtown%22%2C%22value%22%3A%22a0000000-0000-4000-8000-000000000001%22%2C%22source%22%3A%22neighborhood%22%2C%22data%22%3A%7B%22state%22%3A%22GA%22%7D%7D&bedsMin=3" | grep -o 'name="robots" content="[^"]*"'
The answer is name="robots" content="noindex,follow", because bedsMin is a filter the visitor
picked. Then view source on the page and find the first card's address and a link that starts with
/homes/. Turn JavaScript off in your browser and reload: every card is still there. Click "More
filters", pick 3 bedrooms and click "Show results": the URL has bedsMin=3 and the place you
picked. Click Map: the URL has view=map and the pins appear; drag the map and click "Search this
area": the URL has bbox=.
Build it with AI
Read RUUSTER_IDX.md first and follow its MUST and NEVER rules. Ask me if it doesn't cover something.
Build a search page at /search that follows the recipe at <https://help.ruuster.com/idx/recipe-search-page>. Render the first page of results on the server with GET /v1/listings and my secret key, reading the page's own URL parameters (the API's names, through fromSearchParams from @ruuster/idx). Show the Filters, ListingGrid, Pagination, AreaMap and MlsDisclaimers components from @ruuster/idx-recipes, put the SearchBox at the top with baseUrl="/api/idx" (and the same baseUrl on Filters), and set the page's metadata from the head object the API returns (toMetadata). Pagination and card links must be plain <a href> links.
Use these environment variables: IDX_SECRET_KEY (server only), SITE_ORIGIN and SITE_NAME. Never paste a secret key into a chat, and never put IDX_SECRET_KEY in browser code, a URL or a log. No key goes in any page: my pages call my own /api/idx route, made with createListingsRoute from @ruuster/idx/route, which adds my secret key on the server (on a site with no server, the widgets call the API with no key from my approved website address). The map uses NEXT_PUBLIC_GOOGLE_MAPS_KEY and NEXT_PUBLIC_GOOGLE_MAP_ID.
Fair housing: describe homes, places and amenities only. Never describe the people who live in an area or who a home or area suits, and never rank schools as a reason to buy.
When you are done, show me how to check with curl that the first page of cards is in the HTML, and that a search with filters I picked has a noindex,follow robots tag.On a site without React, such as PHP, Python, Ruby on Rails, Go or plain HTML, Build without React: HTML, CSS and JavaScript gives you the same markup, the stylesheet and the script for every widget.