curl --request POST \
--url https://console.cloudblast.io/api/v2/sandboxes/{sandbox}/computer \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"action": "screenshot",
"format": "jpeg",
"quality": 70
}
'{
"data": {
"ok": true,
"width": 1280,
"height": 800,
"format": "jpeg",
"image": "aSDinaTvuI8gbWludGxpZnk=",
"x": 640,
"y": 360,
"windows": [
{
"id": "0x03a00004",
"title": "Example Domain - Mozilla Firefox",
"active": true
}
],
"window": {},
"nodes": [
{
"n": 4,
"role": "push button",
"name": "More information...",
"x": 512,
"y": 418
}
],
"truncated": true,
"screenshot": {
"width": 1280,
"height": 800,
"format": "jpeg",
"image": "/9j/4AAQSkZJRgABAQAAAQABAAD..."
}
}
}Computer Use
Sees and drives the desktop of a running sandbox, one action per call. Only sandboxes created from a desktop image (desktop: true) have one.
Coordinates are screen pixels from the top left. Take a screenshot (or call size) first to learn the screen size.
| Action | Fields | Answer |
|---|---|---|
screenshot | format (jpeg or png), quality | width, height, format, image (base64) |
size | width, height | |
cursor | x, y | |
move | x, y (required) | |
click | x, y, button, count | |
mouse_down, mouse_up | x, y, button | |
drag | from, to (required) | |
scroll | x, y, direction, amount | |
type | text (required) | |
key | keys (required), repeat | |
open | target (required), args, wait | |
windows | windows | |
focus | window (required) | |
read_screen | window, max_nodes | the window’s controls, numbered |
wait | seconds |
Without x and y, click, mouse_down, mouse_up and scroll act where the cursor is.
The actions that change the screen (move, click, mouse_down, mouse_up, drag, scroll, type, key, open, focus, wait) take "screenshot": true to return a picture taken just after, as screenshot, in the same answer.
Every action counts as activity and is in the sandbox’s logs (without pictures, and with only the first 200 characters of typed text). An action that fails answers 422 with data.ok: false and the reason in data.error.
Rate limit: 600 a minute, counted apart from the rest of the API, see Limits.
curl --request POST \
--url https://console.cloudblast.io/api/v2/sandboxes/{sandbox}/computer \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"action": "screenshot",
"format": "jpeg",
"quality": 70
}
'{
"data": {
"ok": true,
"width": 1280,
"height": 800,
"format": "jpeg",
"image": "aSDinaTvuI8gbWludGxpZnk=",
"x": 640,
"y": 360,
"windows": [
{
"id": "0x03a00004",
"title": "Example Domain - Mozilla Firefox",
"active": true
}
],
"window": {},
"nodes": [
{
"n": 4,
"role": "push button",
"name": "More information...",
"x": 512,
"y": 418
}
],
"truncated": true,
"screenshot": {
"width": 1280,
"height": 800,
"format": "jpeg",
"image": "/9j/4AAQSkZJRgABAQAAAQABAAD..."
}
}
}Authorizations
Path Parameters
Body
One action. Each action reads only the fields it uses. Coordinates are screen pixels from the top left, 0 to 16384.
type (required): the text to type, in any language.
20000