recipes
Sitemap Monitor

Recipe: Sitemap New URL Monitor

Get notified when a website adds new pages to its sitemap.

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

The regex extractor counts <loc> occurrences (no capture group → returns a count). When the count increases by 1 or more, the webhook fires.

Or: use the template

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