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.
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"import { createClient } from "@ruuster/idx";
const idx = createClient({ secretKey: process.env.IDX_SECRET_KEY });
const r = await idx.ids({
limit: 1000,
});
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/ids",
params={
"limit": "1000",
},
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([
'limit' => '1000',
], '', '&', PHP_QUERY_RFC3986);
$ch = curl_init('https://idx.ruuster.com/v1/listings/ids' . '?' . $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']);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"import { createClient } from "@ruuster/idx";
const idx = createClient({ secretKey: process.env.IDX_SECRET_KEY });
const r = await idx.changes({
since: "2026-10-21T15:00:00Z",
limit: 500,
});
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/changes",
params={
"since": "2026-10-21T15:00:00Z",
"limit": "500",
},
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([
'since' => '2026-10-21T15:00:00Z',
'limit' => '500',
], '', '&', PHP_QUERY_RFC3986);
$ch = curl_init('https://idx.ruuster.com/v1/changes' . '?' . $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']);Each row has a kind:
upsert: the listing is new or changed. Re-render its page.changesays what changed (created,price_changed,status_changedorupdated), withpreviousandcurrentprice 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.idis that board's id. Drop every listing whosemlsis that id.
How to poll:
- Call again at once while
hasMoreis true, and again in a few minutes when it is false. A page can be short, even empty, while more is waiting, so followhasMore, 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/changeswithsinceset 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,
revalidatePathre-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 asIf-None-Matchwhen you check a page: a304 Not Modifiedcosts 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.