# WritersLogic DOM Recipe Match

> WritersLogic DOM Recipe Match is a paid API for AI agents from agents.writerslogic.com, paid per call via x402, $0.005/call, status unknown (last checked 2026-11-19).

Compares a saved DOM skeleton and an automation recipe (CSS-selector steps) against current page HTML to report whether each step's target element is matched, changed, moved, ambiguous, or missing.

## Facts

- Endpoint: POST https://agents.writerslogic.com/api/v1/dom-recipe-match?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-19
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/writerslogic-dom-recipe-match-e014cdb7
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_19jEHg2OpfxP9X-8qnthA

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability writerslogic-dom-recipe-match-e014cdb7 -d '<json body>'
```

Example prompt: Check whether my automation recipe's selectors still work on the current checkout page — here's the saved skeleton from last week and here's the latest page HTML; tell me which steps are matched, changed, moved, or missing.

## When to prefer this

Use this endpoint when you need to audit an existing DOM-based automation recipe against updated page HTML without executing it — especially after a site redesign or periodic monitoring. It is specifically designed to compare a previously captured DOM skeleton with current HTML and classify each selector's status, making it ideal for pre-flight checks before running browser automation. Prefer it over generic HTML diffing tools when you need actionable per-step selector status rather than raw HTML diffs.

## Known failure modes

- Selector not present in saved skeleton → step classified as unknown
- HTML too large (>100000 chars) → rejected with validation error
- saved array empty or >300 items → rejected
- recipe steps array empty or >100 items → rejected
- Ambiguous match when multiple elements share identical tag/type/role/name → ambiguous status returned
- Step selector missing or empty string → validation error

## How this service works

Pay-per-call agents settled in USDC on Base via x402. Every response carries a signed provenance envelope.

## Output

A per-step report classifying each recipe step as: matched (selector, tag, type, role, and name all the same), changed (selector exists but element attributes differ), moved (same element now has a different selector, with newSelector provided), ambiguous (multiple current elements look identical), missing (selector not found in current HTML), or unknown (selector was not in the saved skeleton). No scripts are executed and no judgment is made about whether the action still makes sense.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "html": {
   "type": "string",
   "maxLength": 100000,
   "minLength": 1,
   "description": "Current page HTML."
  },
  "saved": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "tag": {
      "type": "string"
     },
     "href": {
      "type": "string"
     },
     "name": {
      "type": "string",
      "description": "Best-effort accessible name (aria-label, aria-labelledby, label, text, placeholder, title, alt, value), at most 80 characters."
     },
     "role": {
      "type": "string"
     },
     "type": {
      "type": "string"
     },
     "repeats": {
      "type": "integer",
      "description": "Elements with the same tag, type, role, name and href collapsed into this one (the first)."
     },
     "disabled": {
      "type": "boolean"
     },
     "required": {
      "type": "boolean"
     },
     "selector": {
      "type": "string",
      "description": "CSS selector that matches exactly this element in the supplied HTML."
     },
     "nameSource": {
      "type": "string"
     },
     "selectorKind": {
      "enum": [
       "id",
       "data-testid",
       "name",
       "aria-label",
       "path"
      ],
      "type": "string"
     }
    },
    "additionalProperties": false
   },
   "maxItems": 300,
   "minItems": 1,
   "description": "elements from an earlier dom-skeleton response."
  },
  "recipe": {
   "type": "object",
   "required": [
    "steps"
   ],
   "properties": {
    "steps": {
     "type": "array",
     "items": {
      "type": "object",
      "required": [
       "selector"
      ],
      "properties": {
       "action": {
        "type": "string",
        "maxLength": 100,
        "description": "Free-form label, echoed back."
       },
       "selector": {
        "type": "string",
        "maxLength": 500,
        "minLength": 1,
        "description": "A selector from the saved skeleton."
       }
      },
      "additionalProperties": false
     },
     "maxItems": 100,
     "minItems": 1
    }
   },
   "additionalProperties": false
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json"
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/writerslogic-dom-recipe-match-e014cdb7/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agents.writerslogic.com](https://www.zero.xyz/host/agents.writerslogic.com/llms.txt)
