Scout in development · launch 1 Dec 2026. Try it live · docs

FeaturePOST /v1/assert

Assert API

Several DOM rules in one navigation — pass/fail with results[] for CI and smoke tests.

What you can do with assert

Multiple DOM rules in one navigation: visible, text, counts, href, attribute — pass/fail including soft fails for CI gates and smoke tests.

  • Up to 25 rules per call
  • Operators: visible, exists, count_min/max, contains, matches, href_contains, attr, adaptive, …
  • Soft fails that do not kill the entire run
  • Clear passed boolean plus results[]
API Call
editable
Request body
{'{'}
:,
:,
:,
:,
:,
:,
:,
:
{'}'}

Two rules in one call — selector, visible, and count_min are editable.

Response

Not run yet

h1 visible=true · a count_min=1

curl
No request yet
json
{
  "message": "Not run yet"
}

Endpoints & parameters

Choose an endpoint — below you'll see an example request and explanations for all relevant parameters.

POST /v1/assert

Multi-rule assertions after one page load.

Example request

json
{
  "url": "https://example.com/pricing",
  "width": 1280,
  "height": 720,
  "scroll_into_view": true,
  "dismiss_cookie_banner": true,
  "assert": [
    {
      "selector": "h1",
      "visible": true,
      "contains": "Pricing"
    },
    {
      "selector": "a[href*=\"signup\"]",
      "visible": true,
      "href_contains": "signup"
    },
    {
      "selector": ".plan",
      "count_min": 3
    }
  ]
}

Parameters

  • urlstring required

    Target URL.

  • assertarray (1–25) required

    Rules; each requires selector.

  • assert[].visible / exists / not_coveredboolean

    Visibility/existence expectations.

  • assert[].count / count_min / count_maxnumber

    Count expectations.

  • assert[].contains / text / matchesstring

    Check text content.

  • assert[].href_contains / attrvarious

    Link and attribute checks.

  • assert[].softboolean

    Soft fail counts but does not kill passed.

  • scroll_into_view / ignore_selectorsvarious

    Helpers for overlays.

  • width / heightnumber

    Viewport.

  • dismiss_cookie_bannerboolean

    Attempts to dismiss known cookie banners before measuring or checking.

  • wait_for_selectorstring

    Waits for a CSS selector before continuing.

  • wait_ms / settle_msnumber

    Additional wait time after loading (depends on endpoint).

  • devicestring

    Playwright device preset; overrides width/height/UA when set.

  • color_scheme'light'|'dark'|'no-preference'

    Preferred color scheme in the browser.

  • block_adsboolean

    Blocks known ad and tracker requests.

  • capture_xhrstring

    Glob or substring for XHR/fetch URLs whose bodies Scout captures (max. 20).

  • fetch_mode'browser'|'http'

    http loads without JavaScript (static document). Default: browser.

  • solve_captchaboolean

    Best-effort Turnstile/checkbox on your own sites. Cloud: domain verify. Self-host: always allowed.

  • record_harboolean

    Optionally records HAR (where supported by the endpoint).

  • respect_robotsboolean

    Respect robots.txt (default: on).