← TemplatesRequest API template

Page change monitor

Render a page on a schedule, hash the markdown, and alert only when the content actually changes.

Request APIMonitoringScheduling

Use this when you need to know that a page changed — a competitor’s pricing, a supplier’s terms, a regulator’s guidance — without re-reading it every day. The Request API renders the page as a real user sees it, and a content hash decides whether anything happened.

Executable starters

change-monitor.ts
import { createHash } from 'node:crypto';import { readFile, writeFile } from 'node:fs/promises';const apiKey = process.env.BROWSERCITY_API_KEY;if (!apiKey) {  throw new Error('Set BROWSERCITY_API_KEY before running this script.');}const url = 'https://example.com/terms';const stateFile = './change-monitor-state.json';const response = await fetch('https://api.browser.city/v1/requests', {  method: 'POST',  headers: { Authorization: `Bearer ${apiKey}`, 'Content-Type': 'application/json' },  body: JSON.stringify({ url, markdown: true }),});if (!response.ok) {  throw new Error(`Request failed: ${response.status} ${await response.text()}`);}const page = await response.json();const hash = createHash('sha256').update(page.content).digest('hex');const previous = await readFile(stateFile, 'utf-8')  .then((raw) => JSON.parse(raw) as { hash: string })  .catch(() => null);if (previous && previous.hash !== hash) {  console.log(`CHANGED: ${url}`);  // Notify your channel of choice here (webhook, email, queue message).} else if (!previous) {  console.log(`Baseline recorded for ${url}`);} else {  console.log(`No change for ${url}`);}await writeFile(stateFile, JSON.stringify({ hash, checkedAt: new Date().toISOString() }));

Production hardening checklist

  • Normalize the markdown (strip timestamps, session tokens, rotating banners) before hashing, or every check fires.
  • Keep the previous content alongside the hash so alerts can include a diff.
  • Run checks from a scheduler (cron, CI, task queue) and treat a failed render as its own alert.
  • Track consecutive failures separately from changes — a page going down is not a content change.

Cost and plan notes

Each check is one Request API render. At hourly frequency that is ~720 renders per page per month; put that number and your page weight into /pricing-calculator to see the real monthly figure before adding pages.

[ 08 / 08 ] — Get Started

Give your AI agents the web.

We're in private beta — request access and we'll get you set up. Private sessions by default.