Metadata-Version: 2.4
Name: roveapi
Version: 1.1.0
Summary: Browser automation SDK for AI agents — Playwright-as-a-Service with accessibility trees
Project-URL: Homepage, https://roveapi.com
Project-URL: Documentation, https://roveapi.com/docs
Project-URL: Repository, https://github.com/roveapi/roveapi-python
License-Expression: MIT
Keywords: a11y,accessibility,ai-agent,automation,browser,mcp,playwright
Requires-Python: >=3.9
Requires-Dist: httpx>=0.27
Description-Content-Type: text/markdown

# roveapi

Python SDK for the [Rove](https://roveapi.com) browser automation API — Playwright-as-a-Service with accessibility trees for 77% fewer tokens.

## Install

```bash
pip install roveapi
```

## Quickstart

```python
from roveapi import BrowserClient

client = BrowserClient(api_key="rvp_live_...")

# One-shot screenshot
screenshot = client.screenshot(url="https://example.com")
print(screenshot["url"])  # signed S3 URL

# Session with context manager (auto-close)
with client.session() as session:
    session.navigate("https://example.com")
    tree = session.get_a11y_tree()
    print(tree["result"]["tree"])  # ~26K tokens vs ~114K for screenshot

    session.click(label="Get Started")
    session.fill(selector="#email", value="user@example.com")
```

## Error Handling

```python
from roveapi import BrowserClient, InsufficientCreditsError, RateLimitError

try:
    with client.session() as session:
        session.navigate("https://example.com")
except InsufficientCreditsError:
    print("Top up credits at roveapi.com")
except RateLimitError as e:
    print(f"Retry after {e.retry_after} seconds")
```

## API

### `BrowserClient(api_key, base_url?, retries?, retry_delay?)`

- `client.session(**options)` → `Session` (context manager)
- `client.screenshot(url, **options)` → dict
- `client.extract(url, schema, **options)` → dict
- `client.usage()` → dict

### `Session`

All 12 browser actions: `navigate()`, `get_a11y_tree()`, `click()`, `fill()`, `select()`, `scroll()`, `wait_for()`, `screenshot()`, `get_text()`, `get_attribute()`, `evaluate()`, `close()`.

Auto-retry on 503 with exponential backoff. No retry on 402 or 410.
