JavaScript
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" });
// Take full screenshot
const screenshot = await box.action.screenshot({
outputFormat: "base64"
});
}
main();import os
from gbox_sdk import GboxSDK
def main():
gbox_sdk = GboxSDK(api_key=os.environ["GBOX_API_KEY"])
# Create Android box
box = gbox_sdk.create(type="android")
# Take full screenshot
screenshot = box.action.screenshot(output_format="base64")
if __name__ == "__main__":
main()curl --request POST \
--url https://gbox.ai/api/v1/boxes/{boxId}/actions/screenshot \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'{
"uri": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA..."
}
UI Action
Take screenshot
Captures a screenshot of the current box screen
POST
/
boxes
/
{boxId}
/
actions
/
screenshot
JavaScript
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" });
// Take full screenshot
const screenshot = await box.action.screenshot({
outputFormat: "base64"
});
}
main();import os
from gbox_sdk import GboxSDK
def main():
gbox_sdk = GboxSDK(api_key=os.environ["GBOX_API_KEY"])
# Create Android box
box = gbox_sdk.create(type="android")
# Take full screenshot
screenshot = box.action.screenshot(output_format="base64")
if __name__ == "__main__":
main()curl --request POST \
--url https://gbox.ai/api/v1/boxes/{boxId}/actions/screenshot \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'{
"uri": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA..."
}
Authorizations
Enter your API Key in the format: Bearer . Get it from https://gbox.ai
Body
application/json
Screenshot capture action configuration
Was this page helpful?