Skip to main content

webglean

Official Python client for the WebGlean API.

pip install webglean
from webglean import WebGlean

client = WebGlean(api_key="wg_your_key")  # or set WEBGLEAN_API_KEY

result = client.scrape("https://example.com")
print(result["markdown"])

WebGlean also works as a context manager (with WebGlean(...) as client:), which closes the underlying HTTP connection pool on exit.

Methods

Method Endpoint
scrape(url, ...) POST /v1/scrape
crawl(url, ...) / get_crawl(id) / crawl_and_wait(id, ...) POST /v1/crawl, GET /v1/crawl/:id
extract(url, schema=, prompt=) POST /v1/extract
map(url, ...) POST /v1/map
search(query, ...) POST /v1/search
create_monitor(url, ...) / list_monitors() / get_monitor(id) / delete_monitor(id) POST/GET/DELETE /v1/monitor
batch_scrape(urls=, items=, ...) / get_batch(id) / batch_scrape_and_wait(id, ...) POST /v1/batch/scrape, GET /v1/batch/scrape/:id

crawl_and_wait and batch_scrape_and_wait poll every 2s by default (poll_interval, timeout in seconds) until the job finishes, raising WebGleanError (status 0) on timeout.

Errors

Any non-2xx response raises WebGleanError, with .status and the message set from the API's error body.

Development

python3 -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
pytest

Download files

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

Source Distribution

webglean-0.1.1.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

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

webglean-0.1.1-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file webglean-0.1.1.tar.gz.

File metadata

  • Download URL: webglean-0.1.1.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for webglean-0.1.1.tar.gz
Algorithm Hash digest
SHA256 9f8e98c9179a7591da1cc87bba8dbdd396fb7efe346f8b6ffda444a368f5718d
MD5 337b59210771dffcc76bb5db53d5cc15
BLAKE2b-256 22019b5c828054f54c6e1e8b9e90cf6441b64201200bf785631d8cd803840e7a

See more details on using hashes here.

File details

Details for the file webglean-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: webglean-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for webglean-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 78109e0f2a7d910b580ec912243f9cbc360127ac089b5d38eece7d19fe770619
MD5 cc5fe7ea86d82566cf73084bbd8fd1c2
BLAKE2b-256 d3bb8a29bf20e54fca5781535ef37b7f768b56ff32007b1eef1bf65f2b1440b9

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 files

0.1.0

2 files

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