Scout · Endpoints

Screenshot

Capture pages as binary image/PDF, JSON (base64 + optional HAR), multi-viewport shots, or pixel-diff against a reference PNG.

All variants accept shared browse options (device, wait_for_selector, robots, …).

Binary capture

POST/v1/screenshotAPI key

Returns image/jpeg, image/png, or application/pdf bytes. 8 credits.

NameTypeRequiredDescription
urlstringrequiredPublic http(s) URL to capture.
modeviewport | fullpageoptionalDefault fullpage.
formatjpeg | png | pdfoptionalDefault jpeg.
quality1–100optionalJPEG quality.
width / heightnumberoptionalViewport (defaults 1280×800). Overridden by device.
max_page_heightnumberoptionalCap fullpage height.
wait_msnumberoptionalExtra settle delay after load.
bash
curl -X POST https://scout.macrocontent.dev/v1/screenshot \
  -H "Authorization: Bearer sk_scout_…" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com","format":"jpeg","mode":"fullpage"}' \
  --output shot.jpg

Success is a binary body with the matching Content-Type (not JSON). Non-2xx responses are JSON errors — see Errors.

JSON + optional HAR

POST/v1/screenshot/jsonAPI key

Base64 payload plus metadata; set record_har true for HAR. 8 credits.

json
{
  "url": "https://example.com",
  "format": "jpeg",
  "device": "iPhone 13",
  "wait_for_selector": "main",
  "record_har": false
}

Example response:

json
{
  "status": "success",
  "url": "https://example.com",
  "final_url": "https://example.com/",
  "capture_height": 2400,
  "content_type": "image/jpeg",
  "image_base64": "/9j/4AAQSkZJRgABAQ…",
  "har_base64": null,
  "timestamp": "2026-07-21T15:00:00.000Z"
}
Field name
The image field is image_base64 (not base64). Set include_image: false to omit it (metadata / HAR only).

Multi-viewport

POST/v1/screenshot/viewportsAPI key

One shot per viewport entry. Cost: 8 × count (max 8). Entries may use device presets.

NameTypeRequiredDescription
urlstringrequiredTarget URL.
viewportsarrayrequired1–8 entries with name + width/height or device.
viewports[].devicestringoptionalPreset name from GET /v1/devices.
json
{
  "url": "https://example.com",
  "viewports": [
    { "name": "desktop", "width": 1280, "height": 800 },
    { "name": "phone", "device": "iPhone 13" }
  ]
}

Example response (truncated):

json
{
  "status": "success",
  "url": "https://example.com",
  "final_url": "https://example.com/",
  "shots": [
    { "name": "desktop", "width": 1280, "height": 800, "content_type": "image/jpeg", "base64": "…" },
    { "name": "phone", "width": 390, "height": 844, "content_type": "image/jpeg", "base64": "…" }
  ],
  "timestamp": "…"
}

Pixel diff

POST/v1/screenshot/diffAPI key

Diff live capture vs client-supplied PNG (base64). Pass tolerance for pass/fail. 10 credits.

NameTypeRequiredDescription
urlstringrequiredLive page to capture.
reference_png_base64stringrequiredBaseline PNG as base64.
tolerancenumberoptionalAllowed differing pixel ratio / threshold for pass.
json
{
  "url": "https://example.com",
  "reference_png_base64": "<png-base64>",
  "tolerance": 0.01
}

Example response:

json
{
  "status": "success",
  "pass": true,
  "diff_ratio": 0.0021,
  "tolerance": 0.01,
  "width": 1280,
  "height": 800,
  "diff_png_base64": "iVBORw0KGgo…",
  "timestamp": "…"
}