Menu · Recipes
Recipes

New listings this week

This week's new listings in an area and price range, newest first, for a weekly report, a social post or a page, with your own listings by default and every board on request.

View as Markdownopenapi.json

This week's new listings in an area and price range, newest first. listedSince=7d keeps the listings first on the market since midnight UTC seven days ago, and sort=newest puts the newest first. Use it for a weekly email or report, a scheduled job that drafts social posts, or a /new-listings page.

What it calls

When Request Key Cached
Your own listings (the default) GET /v1/listings?ownListings=1&listedSince=7d&sort=newest secret key, on your server or in your scheduled job no need: it runs once a week
Every board, on request GET /v1/listings?where=…&listedSince=7d&sort=newest secret key no need
In Claude listings_search with listedSince and sort your MCP connection no

The search pages through results 50 at a time with page. priceMax, bedsMin and the other filters narrow it like any search.

Your own listings by default

Start from your brokerage's own listings: they are the ones you can always post and promote.

GET /v1/listings?ownListings=1&listedSince=7d&sort=newest&priceMax=600000&limit=50

To keep your own listings inside one area, narrow them with bbox, polygon or near. A where, zip or city next to ownListings=1 answers 400, because a location adds listings rather than narrowing them.

Every board, on request

Switch to every board your brokerage belongs to only when the person asks for the whole market, for example for an internal market report. Send the area as a where object from /v1/suggest (or zip, city, near) and leave out ownListings:

GET /v1/listings?where=%7B%22label%22%3A%22Naples%2C%20FL%22%2C%22value%22%3A%22Naples%22%2C%22source%22%3A%22crm-system%22%2C%22city%22%3A%22Naples%22%2C%22state%22%3A%22FL%22%7D&listedSince=7d&sort=newest&priceMax=600000&limit=50

Featuring another broker's listing publicly, on social media or in an ad, needs that broker's permission under most boards' advertising rules. Keep listings from other brokers in internal reports, and post your own.

In Claude

Connected through the MCP tools, ask in plain words:

New listings in Naples under $600,000 this week.

The assistant finds Naples with listings_suggest, then calls listings_search with that location, listedSince 7d, sort newest and priceMax 600000. Ask for "our new listings" to get your own only. Those answers are for your brokerage's internal use; a post still follows the rule above.

A weekly job

import { createClient } from "@ruuster/idx";

const idx = createClient({ secretKey: process.env.IDX_SECRET_KEY });

/** This week's new listings, newest first: your own unless allBoards is set. */
export async function newListingsThisWeek(o: { priceMax?: number; allBoards?: boolean; where?: Parameters<typeof idx.search>[0]["where"] }) {
  const rows = [];
  for (let page = 1; page <= 40; page++) {
    const r = await idx.search({
      ...(o.allBoards ? { where: o.where } : { ownListings: true }),
      listedSince: "7d",
      sort: "newest",
      priceMax: o.priceMax,
      limit: 50,
      page,
    });
    if (!r.ok) throw new Error(`${r.status} ${r.error.code}: ${r.error.message}`);
    rows.push(...r.data.listings);
    if (page >= r.data.pages) break;
  }
  return rows.map((l) => ({ address: l.address.display, price: l.price, beds: l.beds, baths: l.baths, href: l.href }));
}

Run it once a week from a cron job, a Zapier or n8n schedule, or your own server.

What to know

  • First on the market. For active listings, listedSince reads the first on-market date the MLS sent, so a relisted home keeps its first date; a date in the future counts as today. For other statuses it reads the board's days-on-market count.
  • Boards without Days on Market. A board that doesn't show Days on Market (Maine's, for one) is left out of listedSince searches, since a site may not show how long those listings have been for sale.
  • Recent changes. modifiedSince=7d finds every listing the MLS changed this week instead: new prices, statuses, photos or remarks.

Rules this page follows

MUST

  • Default to your own listings for anything public, and switch to every board only when asked.
  • Show each listing's attribution and every board's disclaimer wherever you show listings.

NEVER

  • Post or advertise another broker's listing without that broker's permission.
  • Describe a listing by who it suits (Fair housing).

Test it

curl -s -H "Authorization: Bearer $IDX_SECRET_KEY" "https://idx.ruuster.com/v1/listings?ownListings=1&listedSince=7d&sort=newest&limit=5"

The listings come back newest first, each first on the market in the last seven days.

Build it with AI

Prompt
Read RUUSTER_IDX.md first and follow its MUST and NEVER rules. Ask me if it doesn't cover something.

Build an "Our listings" page at /our-listings that follows <https://help.ruuster.com/idx/recipe-our-listings>. Call GET /v1/listings with ownListings=1 on the server and render the ListingGrid, Pagination and MlsDisclaimers components. Each card links to my listing page, and the listing page carries the TourForm, which posts to my own lead route and from there to my CRM (<https://help.ruuster.com/idx/recipe-forms>). If the API answers own_listings_unconfigured, stop and tell me, because Ruuster needs my agents' MLS ids first.

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).

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 send a test tour request and find it in my CRM.