Skip to main content

Python SDK for Hollow — serverless web perception for AI agents

Project description

hollow-sdk (Python)

Python SDK for Hollow — serverless web perception for AI agents.

Gives any Python application a browser that runs without a machine: no Chromium, no BaaS, no GPU.

Install

pip install hollow-sdk

Usage

Single page

from hollow import HollowClient

client = HollowClient()
page = client.perceive("https://news.ycombinator.com")

print(page.gdg_map)
# → [TEXT: news.ycombinator.com]
#   [Stories:]
#     [1] "Ask HN: Who is hiring? (March 2026)"  comments:834
#     ...

print(page.tier)        # 'text'
print(page.confidence)  # 0.95

Agent task

from hollow import HollowClient, run_agent

client = HollowClient()

result = run_agent(
    client,
    task="What are the top 3 stories on Hacker News right now?",
    on_step=lambda s: print(f"Step {s.step}: {s.tier} ({s.confidence:.2f})"),
)

print(result)

Requires ANTHROPIC_API_KEY in your environment.

Custom endpoint

client = HollowClient(endpoint="https://my-hollow-instance.vercel.app")
# or: export HOLLOW_ENDPOINT=https://my-hollow-instance.vercel.app

Context manager

with HollowClient() as client:
    page = client.perceive("https://example.com")
    print(page.gdg_map)
# httpx client is closed automatically

API

HollowClient(endpoint?)

Param Default
endpoint https://hollow-tan-omega.vercel.app

Also reads HOLLOW_ENDPOINT from the environment.

client.perceive(url, session_id?, state_id?) → PerceiveResult

Load a URL. Returns a PerceiveResult.

client.act(session_id, action, intervention?) → PerceiveResult

Interact with the current page.

from hollow.types import Action

client.act(page.session_id, Action(type="click", element_id=3))
client.act(page.session_id, Action(type="fill", element_id=4, value="query"))
client.act(page.session_id, Action(type="scroll", direction="down"))

client.get_session(session_id) → dict

Get current session state without acting.

client.close_session(session_id) → None

Free a session's Redis state. Idempotent.

run_agent(client, task, *, max_steps?, start_url?, model?, on_step?) → str

Param Default
max_steps 15
start_url https://www.startpage.com
model claude-sonnet-4-20250514
on_step None

Types

from hollow.types import Action, PerceiveResult, AgentStep

# PerceiveResult
page.session_id   # str
page.gdg_map      # str — the spatial map
page.confidence   # float 0.0–1.0
page.tier         # 'hollow'|'vdom'|'text'|'cache'|'mobile'|'partial'
page.js_errors    # list[str]

# AgentStep (from on_step callback)
step.step         # int
step.gdg_map      # str
step.action       # Action | None
step.confidence   # float
step.tier         # Tier

Deploy your own Hollow

This SDK points at the public demo by default (10 req/min rate limit per IP). For production use, deploy your own instance:

git clone https://github.com/Badgerion/hollow
cd hollow && npm install && vercel deploy

License

Apache 2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hollow_sdk-0.1.0.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hollow_sdk-0.1.0-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file hollow_sdk-0.1.0.tar.gz.

File metadata

  • Download URL: hollow_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for hollow_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 49445cfc6b6114675938524275e927a70a0731fbb9d5911b93bd1ba85f67ce80
MD5 d518e21ef187bf8f42b8d612ff434695
BLAKE2b-256 ab609401be273301a990fd3fb25195a9d781f6d0544b4ee3154b7bfdc496b8e5

See more details on using hashes here.

File details

Details for the file hollow_sdk-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: hollow_sdk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for hollow_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 06c2f7c75ff38ef53feb643d7654df643a9c123056943b7b711ba1bd8a3e396f
MD5 f69fc0be2179579721e68a68b6ffd1a9
BLAKE2b-256 ba1b9eee08e56bf03cbb98cae9a272823557c9e2a16c4ca4ab671e1d0682361b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page