> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.scrapybara.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.scrapybara.com/_mcp/server.

# Windows

Windows instances are in early access. Join our <a href="https://discord.gg/s4bPUVFXqA" target="_blank">Discord</a> to get started.

## WindowsInstance

The `WindowsInstance` is a full-fledged Windows 11 desktop that supports interactive streaming and computer actions. We recommend using this instance type if you need to interact with Windows-only applications.

* Slow start up time
* 2x compute cost

## Start a Windows instance

#### Python

```python
instance = client.start_windows()
```

#### TypeScript

```typescript
const instance = await client.startWindows();
```

## Available actions

### screenshot

Take a base64 encoded image of the current desktop

#### Python

```python
base_64_image = instance.screenshot().base_64_image
```

#### TypeScript

```typescript
const base64Image = await instance.screenshot();
```

### get\_stream\_url

Get the interactive stream URL

#### Python

```python
stream_url = instance.get_stream_url().stream_url
```

#### TypeScript

```typescript
const streamUrl = await instance.getStreamUrl();
```

### computer

Perform computer actions with the mouse and keyboard

#### `move_mouse`

Move mouse cursor to specific coordinates

**`coordinates`** `array` — required

\[x, y] coordinates to move to

---

**`hold_keys`** `array`

List of modifier keys to hold during the action

---

#### Python

```python Move mouse
instance.computer(action="move_mouse", coordinates=[100, 200])
```

```python Move mouse while holding shift
instance.computer(action="move_mouse", coordinates=[100, 200], hold_keys=["shift"])
```

#### TypeScript

```typescript Move mouse
await instance.computer({action: "move_mouse", coordinates: [100, 200]});
```

```typescript Move mouse while holding shift
await instance.computer({action: "move_mouse", coordinates: [100, 200], holdKeys: ["shift"]});
```

#### `click_mouse`

Perform a mouse click at current position or specified coordinates

**`button`** `string` — required

Mouse button to click ("left", "right", "middle", "back", "forward")

---

**`click_type`** `string` — default: click

Type of click action ("down", "up", "click")

---

**`coordinates`** `array`

\[x, y] coordinates to click at

---

**`num_clicks`** `number` — default: 1

Number of clicks

---

**`hold_keys`** `array`

List of modifier keys to hold during the action

---

#### Python

```python Left click at current position
instance.computer(action="click_mouse", button="left")
```

```python Right click at coordinates
instance.computer(action="click_mouse", button="right", coordinates=[300, 400])
```

```python Mouse down
instance.computer(action="click_mouse", button="left", click_type="down")
```

```python Double click at coordinates
instance.computer(action="click_mouse", button="left", num_clicks=2, coordinates=[500, 300])
```

#### TypeScript

```typescript Left click at current position
await instance.computer({action: "click_mouse", button: "left"});
```

```typescript Right click at coordinates
await instance.computer({action: "click_mouse", button: "right", coordinates: [300, 400]});
```

```typescript Mouse down
await instance.computer({action: "click_mouse", button: "left", clickType: "down"});
```

```typescript Double click at coordinates
await instance.computer({action: "click_mouse", button: "left", numClicks: 2, coordinates: [500, 300]});
```

#### `drag_mouse`

Click and drag from current position to specified coordinates

**`path`** `array` — required

List of \[x, y] coordinate pairs defining the drag path

---

**`hold_keys`** `array`

List of modifier keys to hold during the action

---

#### Python

```python Drag to coordinates
instance.computer(action="drag_mouse", path=[[100, 200], [300, 400]])
```

#### TypeScript

```typescript Drag to coordinates
await instance.computer({action: "drag_mouse", path: [[100, 200], [300, 400]]});
```

#### `scroll`

Scroll horizontally and/or vertically

**`coordinates`** `array`

\[x, y] coordinates to scroll at

---

**`delta_x`** `number` — default: 0

Horizontal scroll amount

---

**`delta_y`** `number` — default: 0

Vertical scroll amount

---

**`hold_keys`** `array`

List of modifier keys to hold during the action

---

#### Python

```python Scroll down
instance.computer(action="scroll", coordinates=[100, 100], delta_x=0, delta_y=200)
```

```python Scroll right
instance.computer(action="scroll", coordinates=[100, 100], delta_x=200, delta_y=0)
```

#### TypeScript

```typescript Scroll down
await instance.computer({action: "scroll", coordinates: [100, 100], deltaX: 0, deltaY: 200});
```

```typescript Scroll right
await instance.computer({action: "scroll", coordinates: [100, 100], deltaX: 100, deltaY: 0});
```

#### `press_key`

Press a key or combination of keys. Scrapybara supports keys defined by [X keysyms](https://github.com/D-Programming-Deimos/libX11/blob/master/c/X11/keysymdef.h). Common aliases are also supported:

* `alt` → `Alt_L`
* `ctrl`, `control` → `Control_L`
* `meta` → `Meta_L`
* `super` → `Super_L`
* `shift` → `Shift_L`
* `enter`, `return` → `Return`

**`keys`** `array` — required

List of keys to press

---

**`duration`** `number`

Time to hold keys in seconds

---

#### Python

```python Press ctrl+c
instance.computer(action="press_key", keys=["ctrl", "c"])
```

```python Hold shift for 2 seconds
instance.computer(action="press_key", keys=["shift"], duration=2)
```

```python Press enter/return
instance.computer(action="press_key", keys=["Return"])
```

#### TypeScript

```typescript Press ctrl+c
await instance.computer({action: "press_key", keys: ["ctrl", "c"]});
```

```typescript Hold shift for 2 seconds
await instance.computer({action: "press_key", keys: ["shift"], duration: 2});
```

```typescript Press enter/return
await instance.computer({action: "press_key", keys: ["Return"]});
```

#### `type_text`

Type text into the active window

**`text`** `string` — required

Text to type

---

**`hold_keys`** `array`

List of modifier keys to hold while typing

---

#### Python

```python Type text
instance.computer(action="type_text", text="Hello world")
```

#### TypeScript

```typescript Type text
await instance.computer({action: "type_text", text: "Hello world"});
```

#### `wait`

Wait for a specified duration

**`duration`** `number` — required

Time to wait in seconds

---

#### Python

```python Wait for 3 seconds
instance.computer(action="wait", duration=3)
```

#### TypeScript

```typescript Wait for 3 seconds
await instance.computer({action: "wait", duration: 3});
```

#### `take_screenshot`

Take a screenshot of the desktop

#### Python

```python
screenshot = instance.computer(action="take_screenshot").base64_image
```

#### TypeScript

```typescript
const screenshot = await instance.computer({action: "take_screenshot"}).base64Image;
```

#### `get_cursor_position`

Get current mouse cursor coordinates

#### Python

```python
cursor_position = instance.computer(action="get_cursor_position").output
```

#### TypeScript

```typescript
const cursorPosition = await instance.computer({action: "get_cursor_position"}).output;
```

### `stop`

Stop the instance

#### Python

```python
instance.stop()
```

#### TypeScript

```typescript
await instance.stop();
```

### `pause`

Pause the instance

#### Python

```python
instance.pause()
```

#### TypeScript

```typescript
await instance.pause();
```

### `resume`

Resume the instance

#### Python

```python Resume with default timeout
instance.resume()
```

```python Resume with custom timeout
instance.resume(timeout_hours=2.5)
```

#### TypeScript

```typescript Resume with default timeout
await instance.resume();
```

```typescript Resume with custom timeout
await instance.resume({timeoutHours: 2.5});
```

## Compatible tools

* `ComputerTool`

## Screen resolution

By default, the Windows instance runs at 1024x768 resolution.