Test and verify
POST /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 bodyJSON
{'{'}
:,
:,
:,
:,
:,
:,
:,
:
{'}'}
Two rules in one call — selector, visible, and count_min are editable.
Not run yet
p visible=true · a count_min=1
Run assert to see pass/fail and rule evidence.
Endpoints & parameters
Pick an endpoint for a sample request and a clear list of parameters.
POST /v1/assert
Multi-rule assertions after one page load.
Example request
{
"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
| Name | Type | Description |
|---|---|---|
urlreq | string | Target URL. |
assertreq | array (1–25) | Rules; each requires selector. |
assert[].visible / exists / not_covered | boolean | Visibility/existence expectations. |
assert[].count / count_min / count_max | number | Count expectations. |
assert[].contains / text / matches | string | Check text content. |
assert[].href_contains / attr | various | Link and attribute checks. |
assert[].soft | boolean | Soft fail counts but does not kill passed. |
scroll_into_view / ignore_selectors | various | Helpers for overlays. |
width / height | number | Viewport. |
dismiss_cookie_banner | boolean | Attempts to dismiss known cookie banners before measuring or checking. |
wait_for_selector | string | Waits for a CSS selector before continuing. |
wait_ms / settle_ms | number | Additional wait time after loading (depends on endpoint). |
device | string | Playwright device preset; overrides width/height/UA when set. |
color_scheme | 'light'|'dark'|'no-preference' | Preferred color scheme in the browser. |
block_ads | boolean | Blocks known ad and tracker requests. |
capture_xhr | string | Glob or substring for XHR/fetch URLs whose bodies ScoutAPI captures (max. 20). |
fetch_mode | 'browser'|'http' | http loads without JavaScript (static document). Default: browser. |
solve_captcha | boolean | Owned-site Cloudflare JS / Turnstile checkbox. Pair with stealth. Cloud: domain verify. Self-host: always allowed. Not an image-puzzle solver. |
record_har | boolean | Optionally records HAR (where supported by the endpoint). |
respect_robots | boolean | Respect robots.txt (default: on). |