Skip to content
Console

web_capture

Capture any HTTPS page — dashboards, scoreboards, lower thirds — as a video source. Supports cookie auth, HTTP basic auth, and waiting for DOM readiness.

Terminal window
curl -X POST "https://api.avflow.dev/v1/jobs" \
-H "Authorization: Bearer ${AVFLOW_API_KEY}" \
-H "Content-Type: application/json" \
-d '{
"name": "overlay-capture",
"sources": [{
"name": "board_src",
"type": "web_capture",
"config": {
"url": "https://app.example.com/scoreboard",
"viewport": { "width": 1920, "height": 1080 },
"fps": 5,
"waitForSelector": { "selector": "#ready", "timeout": 10000 }
}
}],
"nodes": [],
"sinks": [{
"name": "preview",
"type": "rtmp_push",
"inputs": ["board_src"],
"config": {
"urls": ["rtmp://live.example.com/app/key"],
"encoding": { "videoCodec": "h264" }
}
}]
}'
{
"name": "dash_src",
"type": "web_capture",
"config": {
"url": "https://app.example.com/dashboard",
"cookies": [
{
"name": "session",
"value": "<session-value>",
"domain": "app.example.com",
"path": "/"
}
],
"viewport": { "width": 1280, "height": 720 },
"fps": 5
}
}
FieldTypeDefaultDescription
urlstringrequiredPage URL (HTTPS).
viewportobjectsee belowCapture viewport. See viewport.
fpsint5Capture rate. Full-page paths capped lower (CPU-heavy); element capture allows up to 60.
captureElementstringCSS selector for element-level capture (el.captureStream). When set, getDisplayMedia is skipped.
captureAudioboolfalseCapture page audio when available.
cookiesarrayHTTP cookies. See cookies.
authenticateobjectHTTP Basic auth. See authenticate.
setExtraHTTPHeadersmapExtra request headers (string → string).
gotoOptionsobjectpage.goto options. See gotoOptions.
waitForSelectorobjectWait for a CSS selector before capture. See waitForSelector.
waitForTimeoutintExtra delay after load (ms).
bestAttemptbooltrueSoft-fail awaited events (goto waitUntil, waitForSelector) instead of failing the source.
FieldTypeDefaultDescription
widthintpath-dependentViewport width. Full-page: filled / clamped to max 1920×1080. Element capture: 0 keeps the element’s intrinsic size; non-zero scales via OffscreenCanvas.
heightintpath-dependentViewport height (same rules as width).
deviceScaleFactornumberDevice pixel ratio (screencast / EmulateViewport).
hasTouchboolEmulate touch events.
isLandscapeboolScreen orientation landscape flag.
isMobileboolMobile user-agent / metrics emulation.
FieldTypeDefaultDescription
waitUntilstring | string[]["load"]Navigation lifecycle events: load, domcontentloaded, networkidle0, networkidle2 (case-insensitive). A single string is accepted and normalized to a one-element array. Other values are rejected.
timeoutintNavigation timeout in ms (max 60000).
refererstringHTTP Referer header.
referrerPolicystringReferrer-Policy for the navigation.
FieldTypeDescription
usernamestringHTTP Basic username (both fields required to enable).
passwordstringHTTP Basic password.

Each entry:

FieldTypeDescription
namestringCookie name (required).
valuestringCookie value (required).
domainstringCookie domain.
pathstringCookie path.
urlstringAssociated URL (Puppeteer / CF style).
expiresnumberExpiry as Unix timestamp (seconds).
httpOnlyboolHttpOnly flag.
secureboolSecure flag.
sameSitestringStrict | Lax | None.
FieldTypeDefaultDescription
selectorstringrequiredCSS selector to wait for.
timeoutintWait timeout in ms.
visibleboolRequire the element to be visible.
hiddenboolRequire the element to be hidden.
ModeWhenNotes
Display capturecaptureElement empty (local Chrome)getDisplayMedia; viewport sizes Xvfb / EmulateViewport.
Element streamcaptureElement setel.captureStream(fps); viewport is optional scale target.
CDP screencastRemote headless without element selectorPage.captureScreenshot poll; JPEG ≈ width×deviceScaleFactor by height×deviceScaleFactor; typically no audio.

Tiered by resolution×fps (30/60 buckets) at 1.5× stream-source rates. Source pricing.