import GboxSDK from "gbox-sdk";
const gboxSDK = new GboxSDK({
apiKey: process.env["GBOX_API_KEY"] // This is the default and can be omitted
});
async function main() {
const box = await gboxSDK.create({ type: "android" });
await box.action.click({
x: 100,
y: 100
});
// Natural language click
await box.action.click({
target: "login button"
});
}
main();import os
from gbox_sdk import GboxSDK
def main():
gbox_sdk = GboxSDK(api_key=os.environ["GBOX_API_KEY"]) # This is the default and can be omitted
# Create Android box
box = gbox_sdk.create(type="android")
# Perform click action
box.action.click(x=100, y=100)
# Natural language click
box.action.click(target="login button")
if __name__ == "__main__":
main()curl --request POST \
--url https://gbox.ai/api/v1/boxes/{boxId}/actions/click \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"x": 100,
"y": 100
}
'{
"message": "Action executed successfully",
"actionId": "c9bdc193-b54b-4ddb-a035-5ac0c598d32d",
"actual": {
"x": 350,
"y": 250,
"button": "left",
"double": false,
"modifierKeys": [
"control"
]
},
"screenshot": {
"trace": {
"uri": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA..."
},
"before": {
"uri": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA..."
},
"after": {
"uri": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA..."
}
}
}Click
Simulates a click action on the box.
import GboxSDK from "gbox-sdk";
const gboxSDK = new GboxSDK({
apiKey: process.env["GBOX_API_KEY"] // This is the default and can be omitted
});
async function main() {
const box = await gboxSDK.create({ type: "android" });
await box.action.click({
x: 100,
y: 100
});
// Natural language click
await box.action.click({
target: "login button"
});
}
main();import os
from gbox_sdk import GboxSDK
def main():
gbox_sdk = GboxSDK(api_key=os.environ["GBOX_API_KEY"]) # This is the default and can be omitted
# Create Android box
box = gbox_sdk.create(type="android")
# Perform click action
box.action.click(x=100, y=100)
# Natural language click
box.action.click(target="login button")
if __name__ == "__main__":
main()curl --request POST \
--url https://gbox.ai/api/v1/boxes/{boxId}/actions/click \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"x": 100,
"y": 100
}
'{
"message": "Action executed successfully",
"actionId": "c9bdc193-b54b-4ddb-a035-5ac0c598d32d",
"actual": {
"x": 350,
"y": 250,
"button": "left",
"double": false,
"modifierKeys": [
"control"
]
},
"screenshot": {
"trace": {
"uri": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA..."
},
"before": {
"uri": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA..."
},
"after": {
"uri": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA..."
}
}
}Authorizations
Enter your API Key in the format: Bearer . Get it from https://gbox.ai
Path Parameters
Box ID
"c9bdc193-b54b-4ddb-a035-5ac0c598d32d"
Body
- Click Action
- Click Action with Natural Language
- Click Action by Element
Mouse click action configuration
X coordinate of the click
350
Y coordinate of the click
250
Mouse button to click
left, right, middle "left"
Whether to perform a double click
false
Modifier keys to hold while performing the click (e.g., control, shift, alt). Supports the same key values as the pressKey action.
a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, control, alt, shift, meta, win, cmd, option, arrowUp, arrowDown, arrowLeft, arrowRight, home, end, pageUp, pageDown, enter, space, tab, escape, backspace, delete, insert, capsLock, numLock, scrollLock, pause, printScreen, ;, =, ,, -, ., /, `, [, \, ], ', numpad0, numpad1, numpad2, numpad3, numpad4, numpad5, numpad6, numpad7, numpad8, numpad9, numpadAdd, numpadSubtract, numpadMultiply, numpadDivide, numpadDecimal, numpadEnter, numpadEqual, volumeUp, volumeDown, volumeMute, mediaPlayPause, mediaStop, mediaNextTrack, mediaPreviousTrack ["control", "shift"]
Action options. When options.screenshot is provided, ALL deprecated screenshot fields (outputFormat, presignedExpiresIn, screenshotDelay, screenshotRange, includeScreenshot) will be completely ignored.
Show child attributes
Show child attributes
{
"screenshot": {
"outputFormat": "base64",
"presignedExpiresIn": "30m",
"delay": "500ms",
"phases": ["before", "after"]
}
}
Response
Click action executed successfully. The response includes the actual coordinates where the click was performed, which is especially useful when using natural language targeting.
Result of click action execution with actual parameters used. The actual field shows the exact parameters used when performing the click, which is especially useful when using natural language or element-based targeting to understand exactly what action was performed.
message
"Action executed successfully"
Unique identifier for each action. Use this ID to locate the action and report issues.
"c9bdc193-b54b-4ddb-a035-5ac0c598d32d"
Actual parameters used when executing the click action, including coordinates (x, y), button type (left/right/middle), modifier keys (control/shift/alt), and whether it was a double click. Field names match the input parameters.
Show child attributes
Show child attributes
{
"x": 350,
"y": 250,
"button": "left",
"double": false,
"modifierKeys": ["control"]
}
Optional screenshot data. Only present when screenshots are requested via options.screenshot.phases or deprecated fields
Show child attributes
Show child attributes
{
"trace": {
"uri": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA..."
},
"before": {
"uri": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA..."
},
"after": {
"uri": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA..."
}
}
Was this page helpful?