Skip to main content

AgentWeb Python client

A small, dependency-free Python client for the AgentWeb API. Stdlib only (urllib, hmac) — nothing to install transitively. Use it on your backend; the API key is a server secret and must never reach a browser.

pip install agentweb-client   # or: uv add agentweb-client

Use it

from agentweb_sdk import AgentWeb

aw = AgentWeb(api_key="sk_live_...")  # or base_url=... for a private deployment

# Render only integrations that work in this customer surface.
integrations = aw.integrations.list(host_context="web")

# 1. Mint a single-use sign-in link and send it to your user.
link = aw.connections.create(
    end_user_id="user_42",                     # your own id for the person
    integration_id="amazon",
    return_url="https://app.example.com/connected",
)
print(link["connect_url"])

# 2. After the connection.created webhook fires, act as that user.
result = aw.execute(
    end_user_id="user_42",
    integration_id="amazon",
    operation="orders.list",
    arguments={"limit": 5},
    idempotency_key="orders-list-user42-0001",  # reuse on retry for writes
)
print(result["data"])

# List / revoke
aw.connections.list("user_42")
aw.connections.revoke("user_42", "amazon")

Calendar, Contacts, Messages, Notes, and Reminders are returned as device capabilities. They do not have hosted connect URLs. Callers should check compatible_with_host and connect_url_supported before rendering a connect control.

Every method returns the wire payload verbatim (snake_case, exactly what curl shows). Failures raise AgentWebError carrying the service's own code and kind — match on code, never on the message:

from agentweb_sdk import AgentWebError

try:
    aw.execute(end_user_id="user_42", integration_id="amazon",
               operation="orders.list", arguments={})
except AgentWebError as err:
    if err.code == "connection_needs_reauth":
        ...  # send the user a fresh connect link
    print(err.code, err.kind, err.status, err.retryable)

Verify webhooks

Pass the raw request body bytes (the signature is over the exact bytes sent), the X-AgentWeb-Signature header, and your webhook secret. Constant-time.

from agentweb_sdk import verify_webhook

# FastAPI
@app.post("/webhooks/agentweb")
async def hook(request: Request):
    raw = await request.body()
    sig = request.headers.get("X-AgentWeb-Signature", "")
    if not verify_webhook(raw, sig, WEBHOOK_SECRET):
        raise HTTPException(401)
    event = json.loads(raw)          # {"type": "connection.created", ...}

A fully generated client

This SDK is a hand-written, ergonomic surface over the common calls. If you want a client covering every endpoint, generate one from the live OpenAPI spec:

python sdk/python/scripts/dump_openapi.py > openapi.json
openapi-python-client generate --path openapi.json

Metadata

Release files for agentweb-client 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for agentweb-client 0.2.0
File Size Uploaded Provenance
agentweb_client-0.2.0.tar.gz 6.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for agentweb-client 0.2.0
File Interpreter ABI Platform
agentweb_client-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 12.5 kB

Release files / agentweb_client-0.2.0.tar.gz

Download URL agentweb_client-0.2.0.tar.gz
Size 6.8 kB
Tags Source
SHA-256 checksum
How to use checksums
8d63aa7422712e09eb2b17b141b06ccf50794d135631068b5ee11ee89cb2ad7e
BLAKE2b-256 checksum
How to use checksums
0fa05c60a9bff1fb9537b013d49ec38b8cfae9409ef39e61dbc8571afc9d8cac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.7

Release files / agentweb_client-0.2.0-py3-none-any.whl

Download URL agentweb_client-0.2.0-py3-none-any.whl
Size 5.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
292991c5cd63861002d560f37acbef7bc90906cd5c1ae7d0e42ac0533cf34667
BLAKE2b-256 checksum
How to use checksums
646b5f86e595aff8797830ad4082bd0dbc8b518eb5b005473cb98867d0edd156
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.7

Security for agentweb-client 0.2.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A 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.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page