Capture and extract
POST /v1/extract
Adaptive Selectors
Relocate CSS selectors when markup drifts, collect similar cards, and generate a CSS path for the next run.
What adaptive selectors can do
When a CSS selector no longer matches after a deploy, ScoutAPI searches by classes, IDs, and text. similar collects card-like siblings; selector returns a generated CSS path.
- adaptive + match_text on extract fields and assert rules
- selector_relocations[] shows from → to
- type: similar for lists/cards
- type: selector generates a CSS path for monitoring
API Call
editable
Request bodyJSON
{'{'}
:,
:,
:,
:,
:,
:,
:,
:,
:
{'}'}
Extract: adjust selector and viewport.
p.missing-hero
No result yet — run the API call.
Endpoints & parameters
Pick an endpoint for a sample request and a clear list of parameters.
POST /v1/extract
Fields with relocation, similar lists, and generated path.
Example request
{
"url": "https://shop.example/pricing",
"fields": [
{
"name": "cta",
"selector": "a.btn-primary",
"type": "text",
"adaptive": true,
"match_text": "Buy"
},
{
"name": "cards",
"selector": "article.plan",
"type": "similar"
},
{
"name": "cta_path",
"selector": "a.btn-primary",
"type": "selector"
}
]
}Parameters
| Name | Type | Description |
|---|---|---|
urlreq | string | Target URL. |
fields[].adaptive | boolean | Re-resolve selector when it is missing. |
fields[].match_text | string | Text hint for relocation. |
fields[].type | enum | similar = sibling cards, selector = CSS path. |
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). |