BabelWrap Python SDK
The official Python client for the BabelWrap API — the web, as an API, for your agents.
BabelWrap lets AI agents interact with any website through a simple API. This SDK provides sync and async Python clients.
Installation
pip install babelwrap
Quick Start
from babelwrap import BabelWrap
with BabelWrap(api_key="bw_...") as bw:
with bw.create_session() as session:
snap = session.navigate("https://example.com")
print(snap.title)
# Interact with the page
session.click("the Login button")
session.fill("Email address field", "user@example.com")
session.submit()
# Extract structured data
data = session.extract("all product names and prices")
print(data)
Async Usage
from babelwrap import AsyncBabelWrap
async with AsyncBabelWrap(api_key="bw_...") as bw:
async with await bw.create_session() as session:
snap = await session.navigate("https://example.com")
print(snap.title)
data = await session.extract("all links on the page")
Features
- Sync and async clients
- Automatic retries with exponential backoff on transient errors
- Context managers for automatic session cleanup
- Typed snapshots with attribute access (
snap.title,snap.inputs,snap.actions) - Site mapping — discover and generate tools for any website
API Reference
BabelWrap / AsyncBabelWrap
| Method | Description |
|---|---|
create_session() |
Create a new browser session |
usage() |
Get current usage statistics |
health() |
Check API health |
map_site(url) |
Map a website and generate tools |
list_sites() |
List all mapped sites |
site_tools(site_id) |
List tools for a mapped site |
execute_tool(site_id, tool, params) |
Execute a generated site tool |
Session / AsyncSession
| Method | Description |
|---|---|
navigate(url) |
Navigate to a URL |
click(target) |
Click an element |
fill(target, value) |
Fill a form field |
submit(target?) |
Submit a form |
extract(query) |
Extract structured data |
press(key) |
Press a keyboard key |
scroll(direction, amount) |
Scroll the page |
hover(target) |
Hover over an element |
screenshot() |
Take a screenshot (base64 PNG) |
upload(target, file_path) |
Upload a file |
back() / forward() |
Browser history navigation |
snapshot() |
Get current page state |
wait_for(text?, selector?, url_contains?) |
Wait for a condition |
Documentation
Full documentation at babelwrap.com/docs
License
MIT
Metadata
Release files for babelwrap 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| babelwrap-0.1.1.tar.gz | 7.5 kB | With provenance | Details for babelwrap-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| babelwrap-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for babelwrap-0.1.1-py3-none-any.whl |
Total release size: 14.6 kB
Release files / babelwrap-0.1.1.tar.gz
| Download URL | babelwrap-0.1.1.tar.gz |
|---|---|
| Size | 7.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b3d0743c7df5cd09287082442ee62077346134d40272d5f97419c84d0e7bb163
|
|
BLAKE2b-256 checksum How to use checksums |
82deb0a8c9a11828cb171da7d68c8ca453cf02dcabf25a222667000184cdb6ee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 6, 2026.
Transparency logRelease files / babelwrap-0.1.1-py3-none-any.whl
| Download URL | babelwrap-0.1.1-py3-none-any.whl |
|---|---|
| Size | 7.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b8ed8ed8cbf896f814c8617d763f9571643a9406c96e5c3f69bd4a1984f30c3d
|
|
BLAKE2b-256 checksum How to use checksums |
a1273179e5130e1a468d252cb7f1f341cdf7c451e9c619d8bdbdac0653f6d026
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 6, 2026.
Transparency logSecurity for babelwrap 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for babelwrap-0.1.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 6, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.