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"
  });

  // Take screenshot with clip
  const clippedScreenshot = await box.action.screenshot({
    clip: {
      x: 100,
      y: 50,
      width: 800,
      height: 600
    }
  });
}

main();
{
"uri": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA..."
}

Authorizations

Authorization
string
header
required

Enter your API Key in the format: Bearer <token>. Get it from https://gbox.ai

Path Parameters

boxId
string
required

Box ID

Example:

"c9bdc193-b54b-4ddb-a035-5ac0c598d32d"

Body

application/json

Screenshot capture action configuration

Response

200 - application/json

Result of screenshot capture action