webpipe-sdk (Python)
Official Python SDK for WebPipe.ai — turn any webpage into clean, structured data.
Install
pip install webpipe-sdk
Requires Python ≥ 3.9. Depends only on httpx + pydantic.
Quick Start
from webpipe import WebpipeClient
client = WebpipeClient() # reads WEBPIPE_API_KEY env var, or pass api_key="wc-..."
Scrape a page
doc = client.scrape("https://example.com", formats=["markdown", "links", "metadata"])
print(doc.markdown)
print(doc.metadata.title)
Structured JSON extraction with a schema:
doc = client.scrape(
"https://go.dev/doc/effective_go",
formats=["json"],
json_schema={
"type": "object",
"properties": {
"title": {"type": "string"},
"sections": {"type": "array", "x-source": "headings"},
},
},
)
print(doc.json)
Crawl a whole site (polls automatically)
job = client.crawl(
"https://docs.example.com",
limit=50,
scrape_options={"formats": ["markdown"]},
)
for page in job.data:
print(page.metadata.source_url, page.metadata.title)
Need control? job = client.start_crawl(url) returns immediately; poll with client.get_crawl_status(job.id).
Browser session (JS-rendered / logged-in pages)
with client.browser.create(url="https://example.com/login") as session:
session.wait_until_running()
session.fill("input[name=email]", "you@example.com")
session.fill("input[name=password]", "secret")
session.press("Enter", wait_after=3000)
doc = session.navigate("https://example.com/dashboard", formats=["markdown"])
print(doc.markdown)
session.save_session() # reuse login state next time via session_name
# session.close() is called automatically on exit
Map (discover all URLs)
for link in client.map("https://example.com", limit=100, search="blog"):
print(link.url, link.title)
Async
import asyncio
from webpipe import AsyncWebpipeClient
async def main():
async with AsyncWebpipeClient() as client:
doc = await client.scrape("https://example.com", formats=["markdown"])
print(doc.markdown)
asyncio.run(main())
Errors
from webpipe import AuthenticationError, RateLimitError, NotFoundError, WebpipeError
try:
client.scrape("https://example.com")
except AuthenticationError:
... # bad API key
except RateLimitError as e:
... # e.status_code == 429, e.message keeps the server's error text
except WebpipeError:
... # anything else
429 and 5xx responses are retried automatically with exponential backoff (max_retries=2 by default).
Configuration
| Param | Env var | Default |
|---|---|---|
api_key |
WEBPIPE_API_KEY |
— (required) |
base_url |
WEBPIPE_API_URL |
https://api.web2json.ai |
timeout |
— | 60s |
max_retries |
— | 2 |
Development
python3 -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
pytest
Release files for webpipe-sdk 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| webpipe_sdk-0.1.0.tar.gz | 12.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| webpipe_sdk-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 25.9 kB
Release files / webpipe_sdk-0.1.0.tar.gz
| Download URL | webpipe_sdk-0.1.0.tar.gz |
|---|---|
| Size | 12.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ece4decfb49dfa0861e5f027ba1989c2b10b1e3a7d88b690e044cb3086b8e596
|
|
BLAKE2b-256 checksum How to use checksums |
e4492e4ba8a00aeefdd582bd12ca588a03d7b0d0133e27e617b8fc026ec8b030
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.25
|
Release files / webpipe_sdk-0.1.0-py3-none-any.whl
| Download URL | webpipe_sdk-0.1.0-py3-none-any.whl |
|---|---|
| Size | 13.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2514c02368ee16787a5d98bdd78593865628cea0db78d34cb04ff3c5c7131eac
|
|
BLAKE2b-256 checksum How to use checksums |
abe1544c6cf86747d77b326413bf4d4965a46f800a4ff79979eae320fcae0e32
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.25
|