Menu · Guides
Guides

Keeping pages fresh: ids, changes and webhooks

Keep server-rendered pages current with the listing ids feed for sitemaps, the change feed and listing-change webhooks, and re-render only what changed.

View as Markdownopenapi.json

Prices and statuses change through the day, and listings leave the market. Three tools keep your pages current, and you can use them together.

Tool Use it for Key
GET /v1/listings/ids Your listing sitemap, and a full resync Secret
GET /v1/changes Polling for what changed since your last call Secret
Listing-change webhooks Being told within minutes, without polling None. Each delivery is signed

The simplest setup: cache pages for five minutes (ISR or your CDN), rebuild the sitemap hourly from the ids feed, and add the webhook so changed listings re-render at once.

The listing ids feed

/v1/listings/ids walks every listing your boards let you show, a page at a time. Each row has the listing's id, slug, mlsNumber, mls, updatedAt and modifiedAt.

curl -s -G "https://idx.ruuster.com/v1/listings/ids" \
  --data-urlencode limit=1000 \
  -H "Authorization: Bearer $IDX_SECRET_KEY"

Follow nextCursor until it is null. Build each URL from slug with your detail template, and use modifiedAt as the sitemap's lastmod (updatedAt also moves when nothing a page shows changed). A cursor is tied to your boards: when they change, the API refuses it, and you start the walk again. Step 5 of the SEO guide has the sitemap code.

The change feed

/v1/changes answers what changed since a time, then since each cursor. Send since (an ISO time within the last seven days) on the first call, then the nextCursor of each answer.

curl -s -G "https://idx.ruuster.com/v1/changes" \
  --data-urlencode since=2026-10-21T15:00:00Z \
  --data-urlencode limit=500 \
  -H "Authorization: Bearer $IDX_SECRET_KEY"

Each row has a kind:

  • upsert: the listing is new or changed. Re-render its page. change says what changed (created, price_changed, status_changed or updated), with previous and current price and status where the history has them.
  • removed: the listing left the market or your scope. Its page answers 410 from now on; drop it from your sitemap.
  • scope_removed: a whole board left your key's scope. id is that board's id. Drop every listing whose mls is that id.

How to poll:

  • Call again at once while hasMore is true, and again in a few minutes when it is false. A page can be short, even empty, while more is waiting, so follow hasMore, not the row count.
  • Delivery is at least once: a listing can repeat, and a removal can be reported again. Treat every row as idempotent; re-rendering twice is harmless.
  • A cursor is valid for seven days. An older one answers 410 cursor_expired: rebuild from the ids feed, then call /v1/changes with since set to 15 minutes before you started the rebuild.

Webhooks

A listing-change webhook calls your server when a listing in your boards is created, changes price, changes status or is removed, so you don't poll at all. Listing-change webhooks covers setup, signatures, retries and batches.

Re-rendering cheaply

  • In Next.js, revalidatePath re-renders one page on its next request. The webhook route in the examples repo does this for each changed listing and for your area pages.
  • A listing answer carries an ETag. Send it back as If-None-Match when you check a page: a 304 Not Modified costs no units.
  • Re-render the area pages a changed listing appears on, too: their counts and cards change with it.

How current the data is explains how quickly a change on a board reaches the API.