Skip to main content

Installation

Install the SDK using pip:

Quick Start

API Reference

Grasp(**options)

Initializes the Grasp client.
dict

grasp.create(**options)

Create a new container.
dict
Returns: GraspContainer Example:

grasp.connect(container_id)

Connect to an existing container. This will wake up the container if it’s sleeping.
str
required
The ID of the container to connect to.
Returns: GraspContainer Example:

GraspContainer

The container object returned by grasp.create() and grasp.connect(). Properties:
str
Unique container identifier.
str
Container status.
str
ISO timestamp of creation.
BrowserSession
Browser session details.
Methods:

container.shutdown()

Stop and clean up the container. Returns: None Example:

BrowserSession

Browser session details associated with a container. Properties:
str
Chrome DevTools Protocol WebSocket endpoint.
str
URL to view the live browser session.
Example:

Environment Variables

  • GRASP_API_KEY - Default API key (recommended).

Error Handling

Type Hints

The SDK includes full type hints for better IDE support.

Using with Playwright

Async Support