DocsRecipesSitemap Monitor

Recipe: Sitemap New URL Monitor

Get notified when a website adds pages to its sitemap. It is the cheapest way to watch a competitor's blog, docs or product catalogue: one request a day reads the whole list of URLs, with no crawling and no selectors to maintain.

Create the monitor

POST /v1/monitors
curl -X POST https://api.verid.dev/v1/monitors \
  -H "Authorization: Bearer $VERID_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Competitor Blog New Posts",
    "url": "https://competitor.com/post-sitemap.xml",
    "schedule_interval_seconds": 86400,
    "extract_config": {
      "method": "regex",
      "fields": {
        "url_count": "<loc>",
        "first_lastmod": "<lastmod>([^<]+)</lastmod>"
      }
    },
    "diff_predicate": {
      "type": "field_increases_by_absolute",
      "field": "url_count",
      "threshold": 1
    },
    "deliveries": [
      { "type": "webhook", "url": "https://your-app.com/hooks/sitemap" }
    ]
  }'

A daily check (86400 seconds) uses about 30 runs a month, which fits every plan including the 14-day trial.

How the count works

A regex pattern without a capture group runs in count mode: url_count becomes the number of <loc> tags in the file. A pattern with a capture group returns the first match instead, so first_lastmod holds the first <lastmod> date as text. field_increases_by_absolute with a threshold of 1 fires when the count grows by one or more since the previous successful check. See Extraction for the regex rules.

Webhook payload

json
{
  "id": "uuid",
  "version": "2026-05-01",
  "monitor_id": "uuid",
  "run_id": "uuid",
  "fired_at": "2026-10-22T06:00:00Z",
  "diff": {
    "fields_changed": ["url_count", "first_lastmod"],
    "before": { "url_count": 214, "first_lastmod": "2026-10-15T08:12:00+00:00" },
    "after":  { "url_count": 216, "first_lastmod": "2026-10-21T14:30:00+00:00" }
  },
  "monitor": {
    "url":  "https://competitor.com/post-sitemap.xml",
    "name": "Competitor Blog New Posts"
  }
}

The payload tells you how many URLs were added, not which ones. Fetch the sitemap in your handler and diff it against your own stored list to get the new URLs. Verify the Verid-Signature header first, as shown on Webhooks.

Verify it worked

Trigger a run and inspect it
curl -X POST https://api.verid.dev/v1/monitors/$MONITOR_ID/run \
  -H "Authorization: Bearer $VERID_API_KEY" \
  -H "Content-Type: application/json" -d '{}'

curl "https://api.verid.dev/v1/monitors/$MONITOR_ID/runs?limit=1" \
  -H "Authorization: Bearer $VERID_API_KEY"

After a few seconds the run should show extracted.url_count as a number greater than 0. A 0 means the response had no <loc> tags: check the URL in a browser.

Common failures

Sitemap index files. Many sites publish /sitemap.xml as an index whose <loc> entries are other sitemaps, so the count only changes when a whole child sitemap is added. Point the monitor at the child file you care about, such as post-sitemap.xml. Swaps. If one URL is removed and another added between checks, the count stays the same and nothing fires. Use field_changes on url_count (what the template does) to hear about removals too.

Or: use the template

POST /v1/monitors/from-template/sitemap-new-url
curl -X POST https://api.verid.dev/v1/monitors/from-template/sitemap-new-url \
  -H "Authorization: Bearer $VERID_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "My Sitemap",
    "url": "https://competitor.com/sitemap.xml",
    "deliveries": [
      { "type": "webhook", "url": "https://your-app.com/hooks/sitemap" }
    ]
  }'

For why new-URL detection beats crawling and how to filter noise, see the Sitemap.xml new URL detection use case.