---
title: "Extract data"
method: POST
path: "/boxes/{boxId}/actions/extract"
tags: ["UI Action"]
---

# Extract data

`POST /boxes/{boxId}/actions/extract`

Extract data from the UI interface using a JSON schema.

## Path parameters

- `boxId` string, required

## Request body

- ExtractAction — Action to extract data from the UI interface
  - `instruction` string, required — The instruction of the action to extract data from the UI interface
  - `schema` object — JSON Schema defining the structure of data to extract. Supports object, array, string, number, boolean types with validation rules. Common use cases: - Extract text content: { "type": "string" } - Extract structured data: { "type": "object", "properties": {...} } - Extract lists: { "type": "array", "items": {...} } - Extract with validation: Add constraints like "required", "enum", "pattern", etc.

## Response `200`

- ExtractActionResult — Result of extract action execution
  - `data` object, required — The extracted data structure that conforms to the provided JSON schema. The actual structure and content depend on the schema defined in the extract action request.
  - `screenshot` string, byte, required — Base64-encoded screenshot of the UI interface at the time of extraction

---

[API](https://skmtc.dev/babelcloud/apis/gbox-open-api.md) · [All operations](https://skmtc.dev/babelcloud/apis/gbox-open-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/babelcloud/gbox-open-api/revisions/d655577fa915/schema)
