Performance
POST
/v1/performanceAPI keyRaw timing metrics for a URL (not a letter grade). 5 credits.
| Name | Type | Required | Description |
|---|---|---|---|
url | string | required | Page to measure. |
settle_ms | number | optional | Extra wait after navigation. |
goto_timeout_ms | number | optional | Navigation timeout. |
width / height | number | optional | Viewport size. |
curl -X POST https://scout.macrocontent.dev/v1/performance \
-H "Authorization: Bearer sk_scout_…" \
-H "Content-Type: application/json" \
-d '{"url":"https://example.com"}'{
"url": "https://example.com"
}Example response (truncated):
{
"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 keyLoad html (+ optional inlined resources) in an isolated page — used by Macro for Store bundle preview. 5 credits.
| Name | Type | Required | Description |
|---|---|---|---|
html | string | required | HTML document/snippet to load (max ~2MB). |
resources | array | optional | Optional { url, body, content_type?, status? } stubs (max 20). |
block_external | boolean | optional | Block non-stubbed network. |
wait_for_function | string | optional | Poll JS until truthy. |
evaluate | string | optional | JS expression after load — Pro / internal only (no domain verify). |
screenshot | boolean | optional | Include 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. {
"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:
{
"status": "success",
"final_url": "about:blank",
"evaluate_result": null,
"screenshot_base64": "/9j/4AAQ…",
"response_time_ms": 310,
"timestamp": "…"
}