DocsRecipesLLM Extraction

Recipe: AI-Powered Extraction

Use LLM extraction for pages that are hard to scrape with CSS or XPath: markup that changes every deploy, prices split across several elements, or facts buried in a paragraph. You describe the fields in plain English and Verid returns them as JSON, which the normal predicates can then compare check to check.

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": "Product Page AI Monitor",
    "url": "https://example.com/product/42",
    "schedule_interval_seconds": 86400,
    "extract_config": {
      "method": "prompt",
      "prompt": "Extract the product name, current price (as a number without currency symbol), availability status, and any active discount percentage from this page. Use null for anything not shown.",
      "schema": {
        "name": "string",
        "price": "number",
        "available": "boolean",
        "discount_pct": "number or null"
      }
    },
    "diff_predicate": {
      "type": "composite",
      "operator": "OR",
      "conditions": [
        { "type": "field_changes", "field": "available" },
        { "type": "field_decreases_by_percent", "field": "price", "threshold": 5 }
      ]
    },
    "deliveries": [
      { "type": "webhook", "url": "https://your-app.com/hooks/product-change" }
    ]
  }'

The composite OR fires when stock flips or the price falls by 5% or more. Asking for the price "as a number without currency symbol" matters: the percent predicate only works on numbers.

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": ["price", "discount_pct"],
    "before": { "price": 129, "discount_pct": null },
    "after":  { "price": 99,  "discount_pct": 23 }
  },
  "monitor": {
    "url":  "https://example.com/product/42",
    "name": "Product Page AI Monitor"
  }
}

Only changed fields appear in diff. Verify the Verid-Signature header 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's extracted object should contain name, price, available and discount_pct with the types from your schema. Run it twice: the second run on an unchanged page is served from cache.

LLM extraction caching

LLM results are cached for 30 days using a hash of the page content, the prompt and the schema. If the page content doesn't change between runs, the cached result is returned at no LLM cost.

LLM calls are only counted against your monthly quota on cache misses. Plans include 50 AI calls on the trial, 250 on Lite, 500 on Starter, 5,000 on Pro and 25,000 on Scale.

Models used

Verid runs your prompt against a fast, JSON-capable LLM. If the primary model returns malformed JSON or is unreachable, Verid automatically falls back to a secondary model so extraction stays resilient. You don't pick the model - Verid manages this for you.

The page content sent to the model is truncated at 50,000 characters.

Prompt rules

  • Minimum 10 characters, maximum 2,000 characters
  • Be specific about the keys you want returned
  • Mention how to handle missing fields (e.g. "use null if not listed")
  • Provide a schema when you need consistent output shape

Common failure

Pages that change on every load (timestamps, rotating reviews, ad slots) miss the cache on every check, so each run spends an AI call. A daily check on one such page uses about 30 calls a month; an hourly one uses about 720. Check less often, or use a CSS or JSONPath field where the page allows it and keep the prompt for the hard parts.

Prompt-based extraction powers Competitor tech-stack changes and competitor ad & landing copy tracking.