Sandbox Desktop Screenshots & Streaming
Compared with other VM solutions that rely on novnc, Lybic’s streaming stack uses our in-house low-latency, high-performance screen capture and encoding pipeline built for cloud gaming. It supports more codecs, delivers better compatibility and UX, and lets you embed the stream in your product via the SDK/API.
Screenshots
Users often need to capture the current desktop during their workflow. Lybic sandboxes expose convenient screenshot APIs to fetch high-quality captures of the current desktop.
Option 1: Preview Endpoint
The easiest way to grab a screenshot is calling the preview endpoint, which returns the current sandbox screenshot along with cursor position data (cursor info is only available for Computer sandboxes).
curl -X POST https://api.lybic.cn/api/orgs/{orgId}/sandboxes/{sandboxId}/preview \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json"Response Example:
{
"screenShot": "https://sandbox-screenshots.lybic.cn/...",
"cursorPosition": {
"x": 512,
"y": 384,
"screenWidth": 1920,
"screenHeight": 1080,
"screenIndex": 0
}
}Option 2: Screenshot Action
Run a screenshot action to capture the desktop while executing other actions. This approach is more flexible and lets you control whether to include the screenshot.
curl -X POST https://api.lybic.cn/api/orgs/{orgId}/sandboxes/{sandboxId}/actions/execute \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"action": {
"type": "screenshot"
},
"includeScreenShot": true,
"includeCursorPosition": true
}'Response Example:
{
"screenShot": "https://sandbox-screenshots.lybic.cn/...",
"cursorPosition": {
"x": 512,
"y": 384,
"screenWidth": 1920,
"screenHeight": 1080,
"screenIndex": 0
},
"actionResult": {}
}Desktop Streaming
Experience the desktop stream via our online demo or the Dashboard > Sandboxes > Details > Connect section for an ultra-smooth experience.
Next Steps
Embed the desktop stream into your product using the UI SDK—see the UI SDK docs for details.