Capture and extract
capture_xhr
XHR Capture
Record matching XHR and fetch bodies from a real browser load — when the data lives in JSON, not in the DOM.
What you can do with XHR capture
ScoutAPI captures XHR and fetch bodies whose URL matches a glob or substring. Ideal when prices, cart, or search arrive as JSON, not in the DOM.
- Glob or substring, e.g. */api/pricing*
- Up to 20 responses, bodies up to 32k (truncated flag)
- Available on extract, inspect, assert, and journey
- +1 credit per request with capture_xhr
API Call
editable
Request bodyJSON
{'{'}
:,
:,
:,
:,
:,
:,
:,
:,
:
{'}'}
Extract: adjust selector and viewport.
p
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
Extract plus matching XHR/fetch bodies in captured_xhr[].
Example request
{
"url": "https://shop.example/pricing",
"capture_xhr": "*/api/pricing*",
"fields": [
{
"name": "headline",
"selector": "h1",
"type": "text"
}
]
}Parameters
| Name | Type | Description |
|---|---|---|
urlreq | string | Target URL. |
capture_xhrreq | string | Glob or substring for XHR/fetch URLs. |
fieldsreq | array | DOM fields as in extract. |
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). |