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

Featurecapture_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

Scout 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

Endpoints & parameters

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

POST /v1/extract

Extract plus matching XHR/fetch bodies in captured_xhr[].

Example request

json
{
  "url": "https://shop.example/pricing",
  "capture_xhr": "*/api/pricing*",
  "fields": [
    {
      "name": "headline",
      "selector": "h1",
      "type": "text"
    }
  ]
}

Parameters

  • urlstring required

    Target URL.

  • capture_xhrstring required

    Glob or substring for XHR/fetch URLs.

  • fieldsarray required

    DOM fields as in extract.

  • 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).