Scout · Endpoints

Performance & sandbox

Navigation timing / Web Vitals-style raw metrics, and an isolated HTML/JS sandbox for bundle previews.

Performance

POST/v1/performanceAPI key

Raw timing metrics for a URL (not a letter grade). 5 credits.

NameTypeRequiredDescription
urlstringrequiredPage to measure.
settle_msnumberoptionalExtra wait after navigation.
goto_timeout_msnumberoptionalNavigation timeout.
width / heightnumberoptionalViewport size.
bash
curl -X POST https://scout.macrocontent.dev/v1/performance \
  -H "Authorization: Bearer sk_scout_…" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com"}'
json
{
  "url": "https://example.com"
}

Example response (truncated):

json
{
  "status": "success",
  "url": "https://example.com",
  "final_url": "https://example.com/",
  "http_status": 200,
  "metrics": {
    "ttfb_ms": 120,
    "dom_content_loaded_ms": 450,
    "load_event_ms": 890,
    "fcp_ms": 510,
    "lcp_ms": 720,
    "cls": 0.01,
    "resource_count": 42,
    "transfer_size_bytes": 380000
  },
  "console_errors": [],
  "console_warnings": [],
  "page_errors": [],
  "network": [{ "url": "https://example.com/", "status": 200, "method": "GET" }],
  "response_time_ms": 2100,
  "timestamp": "…"
}

Sandbox

POST/v1/sandboxAPI key

Load html (+ optional inlined resources) in an isolated page — used by Macro for Store bundle preview. 5 credits.

NameTypeRequiredDescription
htmlstringrequiredHTML document/snippet to load (max ~2MB).
resourcesarrayoptionalOptional { url, body, content_type?, status? } stubs (max 20).
block_externalbooleanoptionalBlock non-stubbed network.
wait_for_functionstringoptionalPoll JS until truthy.
evaluatestringoptionalJS expression after load — Pro / internal only (no domain verify).
screenshotbooleanoptionalInclude a capture in the response.
evaluate is Pro / internal — same as journeys
Optional evaluate runs arbitrary JS in the sandbox page. It requires a Pro (or internal) key — Free/Basic get 403. Domain verify is not required here because you supply the HTML yourself (no third-party live target). That is intentional and different from journey evaluate, which still needs a verified navigate host.
json
{
  "html": "<!doctype html><html><body><div id='root'>hello</div></body></html>",
  "block_external": true,
  "wait_for_function": "document.getElementById('root') !== null",
  "screenshot": true
}

Example response:

json
{
  "status": "success",
  "final_url": "about:blank",
  "evaluate_result": null,
  "screenshot_base64": "/9j/4AAQ…",
  "response_time_ms": 310,
  "timestamp": "…"
}