The Display Screenshot API captures, retrieves, and manages visual state from a running container’s X11 display. Use these endpoints to grab a fresh PNG for monitoring or vision pipelines, browse the screenshot history by Unix timestamp, fetch compact thumbnails for UI overviews, inspect the window tree, and read or write the clipboard buffer. Image responses are available as raw PNG bytes (the default) or as a base64 JSON envelope for clients that cannot handle binary payloads.
Captures a fresh screenshot of the display and returns the image file. By default, the response is a binary PNG; pass base64=true to receive a JSON envelope instead.
A capture spans the whole screen, so these are screen coordinates: the same ones POST /input/click-at takes and GET /input/display-geometry describes. The cropped image starts at x1,y1: its pixel (x, y) is screen point (x1 + x, y1 + y).
Return a base64-encoded JSON response instead of a binary image. Accepted values: true, 1, or empty for base64; false, 0 for binary (default).
displayId
query
integer
No
Display ID to use (overrides the *-display-N.* hostname pattern). Valid range: 1-999999
region
query
string
No
Crop the returned image to x1,y1,x2,y2. Minimum 10x10 px, maximum 65535 on each axis, x2 > x1 and y2 > y1; anything else is a 400. A capture spans the whole screen, so these are screen coordinates: the same ones POST /input/click-at takes and GET /input/display-geometry describes. The cropped image starts at x1,y1: its pixel (x, y) is screen point (x1 + x, y1 + y).
cursor
query
boolean
No
Include the pointer position in the response. Only affects the base64 JSON form. Accepted values: true, 1, or empty. Anything else is off.
"message":"A display ID is required for this endpoint. It can be provided via a \"displayId\" query parameter or a domain in the format \"-display-X\".",
"help":"Use a display-specific domain or pass ?displayId=N."
}
}
Error Code
Title
Description
Resolution
NO_DISPLAY_CONTEXT
No display context
—
—
Screenshot capture failed.
{
"error":"Screenshot capture failed",
"code":"SCREENSHOT_FAILED",
"details":{
"message":"Screenshot payload was unavailable",
"help":"Check if the display is active and accessible"
Unix timestamp of the screenshot. Use the timestamp field returned by screenshot metadata/list endpoints. Do not use timestamp_human for path queries. Must be numeric only for security.
base64
query
boolean
No
Return a base64-encoded JSON response instead of a binary image. Accepted values: true, 1, or empty for base64; false, 0 for binary (default).
displayId
query
integer
No
Display ID to use (overrides the *-display-N.* hostname pattern). Valid range: 1-999999
The supplied timestamp is not a numeric Unix value.
{
"error":"Invalid timestamp",
"code":"VALIDATION_ERROR",
"details":{
"message":"Timestamp must be a numeric Unix seconds value.",
"help":"Use the timestamp field returned by screenshot metadata or list endpoints."
}
}
Error Code
Title
Description
Resolution
VALIDATION_ERROR
Validation error
—
—
NO_DISPLAY_CONTEXT
No display context
The request names no display: it has neither a displayId query parameter nor a display-specific hostname.
Pass ?displayId=N, or call the display through its display-specific hostname.
No screenshot exists for the supplied timestamp.
{
"error":"Screenshot not found",
"code":"SCREENSHOT_NOT_FOUND",
"details":{
"message":"No screenshot found for the supplied timestamp",
"help":"List available screenshots to discover valid timestamps."
}
}
Error Code
Title
Description
Resolution
SCREENSHOT_NOT_FOUND
Screenshot not found
—
—
Screenshot retrieval failed. The response has error: "Failed to get screenshot", code: "SCREENSHOT_FAILED", and details containing the underlying error message and help.
{
"error":"Failed to get screenshot",
"code":"SCREENSHOT_FAILED",
"details":{
"message":"Screenshot file not found: 1749541160.png",
"help":"Check if the timestamp is valid and the display is accessible"
"message":"A display ID is required for this endpoint. It can be provided via a \"displayId\" query parameter or a domain in the format \"-display-X\".",
"help":"Use a display-specific domain or pass ?displayId=N."
}
}
Error Code
Title
Description
Resolution
NO_DISPLAY_CONTEXT
No display context
—
—
The screenshot operation failed. Two named examples are possible.
Display inactive:
{
"error":"Failed to take screenshot",
"code":"SCREENSHOT_FAILED",
"details":{
"message":"No screenshot data was returned for display 10. The display may be inactive or have no running programs.",
"help":"Check if the display is active and accessible"
}
}
Invalid screenshot payload:
{
"error":"Failed to take screenshot",
"code":"SCREENSHOT_FAILED",
"details":{
"message":"Invalid screenshot data was returned for display 10. The display may be inactive or have no running programs.",
"help":"Check if the display is active and accessible"
"message":"A display ID is required for this endpoint. It can be provided via a \"displayId\" query parameter or a domain in the format \"-display-X\".",
"help":"Use a display-specific domain or pass ?displayId=N."
}
}
Error Code
Title
Description
Resolution
NO_DISPLAY_CONTEXT
No display context
—
—
No screenshot exists for the display yet.
{
"error":"Screenshot not found",
"code":"SCREENSHOT_NOT_FOUND",
"details":{
"message":"No screenshots found",
"help":"Capture a screenshot first, then retry."
}
}
Error Code
Title
Description
Resolution
SCREENSHOT_NOT_FOUND
Screenshot not found
—
—
Latest screenshot retrieval failed. The response has error: "Failed to get latest screenshot", code: "SCREENSHOT_FAILED", and details containing the underlying error message and help.
{
"error":"Failed to get latest screenshot",
"code":"SCREENSHOT_FAILED",
"details":{
"message":"Screenshot file not found: 1749541160.png",
"help":"Check if the display is active and accessible"
Latest screenshot metadata retrieval failed. The response has error: "Failed to get latest screenshot info", code: "SCREENSHOT_FAILED", and details containing the underlying error message and help.
{
"error":"Failed to get latest screenshot info",
"code":"SCREENSHOT_FAILED",
"details":{
"message":"<underlying error message>",
"help":"Check if the display is active and accessible"
A thumbnail is the capture scaled to 20% (ImageMagick convert -resize 20%), not a fixed size. A seamless capture’s dimensions follow the windows it composited, so the thumbnail’s do too.
Unix timestamp of the screenshot. Use the timestamp field returned by screenshot metadata/list endpoints. Do not use timestamp_human for path queries. Must be numeric only for security.
base64
query
boolean
No
Return a base64-encoded JSON response instead of a binary image. Accepted values: true, 1, or empty for base64; false, 0 for binary (default).
displayId
query
integer
No
Display ID to use (overrides the *-display-N.* hostname pattern). Valid range: 1-999999
The supplied timestamp is not a numeric Unix value.
{
"error":"Invalid timestamp format",
"code":"VALIDATION_ERROR",
"details":{
"message":"Timestamp must be numeric (Unix timestamp)",
"help":"Use format like 1749541160"
}
}
Error Code
Title
Description
Resolution
VALIDATION_ERROR
Validation error
—
—
NO_DISPLAY_CONTEXT
No display context
The request names no display: it has neither a displayId query parameter nor a display-specific hostname.
Pass ?displayId=N, or call the display through its display-specific hostname.
Returns 404 THUMBNAIL_NOT_FOUND when no thumbnail exists for the supplied timestamp.
{
"error":"Thumbnail not found",
"code":"THUMBNAIL_NOT_FOUND",
"details":{
"message":"No thumbnail available for the supplied timestamp",
"help":"List available screenshots to discover valid timestamps with thumbnails."
}
}
Error Code
Title
Description
Resolution
THUMBNAIL_NOT_FOUND
Thumbnail not found
—
—
SCREENSHOT_NOT_FOUND
Screenshot not found
No stored screenshot matches the request.
Take a screenshot first with GET /screenshot, or list the stored ones.
Thumbnail retrieval failed. The response has error: "Failed to get thumbnail", code: "THUMBNAIL_FAILED", and details containing the underlying error message and help.
{
"error":"Failed to get thumbnail",
"code":"THUMBNAIL_FAILED",
"details":{
"message":"Screenshot file not found: 1749541160.png",
"help":"Check if the timestamp is valid and the display is accessible"
Returns 404 THUMBNAIL_NOT_FOUND when no thumbnail exists for the latest screenshot.
{
"error":"Thumbnail not available",
"code":"THUMBNAIL_NOT_FOUND",
"details":{
"message":"No thumbnail available for the latest screenshot",
"help":"Thumbnails are automatically generated when screenshots are taken"
}
}
Error Code
Title
Description
Resolution
THUMBNAIL_NOT_FOUND
Thumbnail not found
—
—
SCREENSHOT_NOT_FOUND
Screenshot not found
No stored screenshot matches the request.
Take a screenshot first with GET /screenshot, or list the stored ones.
Latest thumbnail retrieval failed. The response has error: "Failed to get latest thumbnail", code: "THUMBNAIL_FAILED", and details containing the underlying error message and help.
{
"error":"Failed to get latest thumbnail",
"code":"THUMBNAIL_FAILED",
"details":{
"message":"Screenshot file not found: 1749541160.png",
"help":"Check if the display is active and accessible"
Display ID to use (overrides the *-display-N.* hostname pattern). Valid range: 1-999999
onlyVisible
query
boolean
No
If true, drop windows carrying _NET_WM_STATE_HIDDEN. A minimized window carries that state, so this does exclude minimized windows. It is a different test from the onlyVisible on window/search and input/wait-until, which ask the X server whether the window is viewable and, under xpra, still match a minimized one.
"message":"A display ID is required for this endpoint. It can be provided via a \"displayId\" query parameter or a domain in the format \"-display-X\".",
"help":"Use a display-specific domain or pass ?displayId=N."
}
}
Error Code
Title
Description
Resolution
NO_DISPLAY_CONTEXT
No display context
—
—
Listing windows failed.
{
"error":"Failed to list windows",
"code":"WINDOW_LIST_FAILED",
"details":{
"message":"Window query failed: ...",
"help":"Check if the display is active and wmctrl is available"
}
}
Error Code
Title
Description
Resolution
WINDOW_LIST_FAILED
Window list failed
—
—
The display backend is not currently reachable.
{
"error":"Display is not available or not running",
"code":"DISPLAY_NOT_AVAILABLE",
"details":{
"message":"Display is not available or not running",
"help":"Check if the display is running and the displayId is correct"
"message":"A display ID is required for this endpoint. It can be provided via a \"displayId\" query parameter or a domain in the format \"-display-X\".",
"help":"Use a display-specific domain or pass ?displayId=N."
}
}
Error Code
Title
Description
Resolution
NO_DISPLAY_CONTEXT
No display context
—
—
The requested window is not known to the display.
{
"error":"Window not found",
"code":"WINDOW_NOT_FOUND",
"details":{
"message":"Window not found",
"help":"Check if the window still exists using /window/search. Windows the window manager does not manage (override-redirect, withdrawn, never mapped) also report this."
}
}
Error Code
Title
Description
Resolution
WINDOW_NOT_FOUND
Window not found
—
—
Reading window properties failed.
{
"error":"Failed to get window properties",
"code":"WINDOW_PROPERTIES_FAILED",
"details":{
"message":"Window query failed: ...",
"help":"Check if the display is active and xprop is available"
}
}
Error Code
Title
Description
Resolution
WINDOW_PROPERTIES_FAILED
Window properties failed
—
—
The display backend is not currently reachable.
{
"error":"Display is not available or not running",
"code":"DISPLAY_NOT_AVAILABLE",
"details":{
"message":"Display is not available or not running",
"help":"Check if the display is running and the displayId is correct"
"message":"A display ID is required for this endpoint. It can be provided via a \"displayId\" query parameter or a domain in the format \"-display-X\".",
"help":"Use a display-specific domain or pass ?displayId=N."
}
}
Error Code
Title
Description
Resolution
NO_DISPLAY_CONTEXT
No display context
—
—
Reading the clipboard failed.
{
"error":"Failed to read clipboard",
"code":"CLIPBOARD_FAILED",
"details":{
"message":"Clipboard operation failed: ...",
"help":"Check if the display is active and xsel is available"
}
}
Error Code
Title
Description
Resolution
CLIPBOARD_FAILED
Clipboard failed
—
—
The display backend is not currently reachable.
{
"error":"Display is not available or not running",
"code":"DISPLAY_NOT_AVAILABLE",
"details":{
"message":"Display is not available or not running",
"help":"Check if the display is running and the displayId is correct"
"message":"A display ID is required for this endpoint. It can be provided via a \"displayId\" query parameter or a domain in the format \"-display-X\".",
"help":"Use a display-specific domain or pass ?displayId=N."
}
}
Error Code
Title
Description
Resolution
NO_DISPLAY_CONTEXT
No display context
—
—
INVALID_JSON
Invalid JSON body
The request body could not be parsed as JSON, or a body was sent without Content-Type: application/json.
Send a valid JSON body with Content-Type: application/json.
Writing the clipboard failed.
{
"error":"Failed to read clipboard",
"code":"CLIPBOARD_FAILED",
"details":{
"message":"Clipboard operation failed: ...",
"help":"Check if the display is active and xsel is available"
}
}
Error Code
Title
Description
Resolution
CLIPBOARD_FAILED
Clipboard failed
—
—
The display backend is not currently reachable.
{
"error":"Display is not available or not running",
"code":"DISPLAY_NOT_AVAILABLE",
"details":{
"message":"Display is not available or not running",
"help":"Check if the display is running and the displayId is correct"