Skip to main content

Python SDK for the Webskillet runs API

Project description

webskillet

The official Python SDK for the Webskillet API. Run web tasks programmatically, poll for results, and manage skillets and auth sessions — with full type hints and Pydantic models throughout.

Installation

pip install webskillet

Requires Python 3.10+.

Quickstart

from webskillet_client import WebskilletClient

with WebskilletClient(api_key="your-webskillet-api-key") as client:
    result = client.runs.run(
        body={
            "task": "Extract the title of example.com",
            "startUrl": "https://example.com",
            "skilletId": "example-title",
        },
        timeout_seconds=600,
    )
    print(result.status, getattr(result, "result", None))

runs.run() starts a run and polls every five seconds until it is completed or canceled. It waits indefinitely by default; pass timeout_seconds to stop waiting after a fixed duration (raises TimeoutError). A run that completes with outcome="failed" raises RunFailedError.

Async usage

AsyncWebskilletClient exposes the same services with the same signatures:

from webskillet_client import AsyncWebskilletClient

async with AsyncWebskilletClient(api_key="your-webskillet-api-key") as client:
    result = await client.runs.run(body={"task": "Extract the page title"})

Managing runs manually

Skip runs.run() when you need custom polling or fire-and-forget behavior:

started = client.runs.start(body={"task": "Extract the page title"})
current = client.runs.get(run_id=started.id)
updated = client.runs.update(
    run_id=started.id,
    body={"title": "Example page title"},
)
recent = client.runs.list(limit=20)

Skillets and auth sessions

skillets = client.skillets.list()

sessions = client.auth_sessions.list()
session = client.auth_sessions.get(auth_session_id=sessions[0].id)
recording = client.auth_sessions.record(
    body={"name": "GitHub", "startUrl": "https://github.com/login"}
)

Error handling

All errors inherit from WebskilletError, so one except clause covers everything. Catch more specific types when you need to branch:

from webskillet_client import (
    AuthenticationError,  # 401/403 — missing or invalid API key
    NotFoundError,        # 404
    ValidationError,      # other 4xx
    ServerError,          # 5xx
    NetworkError,         # connection, DNS, TLS, or timeout failures
    RunFailedError,       # run completed with outcome="failed"
)

try:
    result = client.runs.run(body={"task": "Extract the page title"})
except RunFailedError as e:
    print(f"Run {e.run_id} failed: {e.error}")
except AuthenticationError:
    print("Check your API key")

API errors carry status_code and the response body; RunFailedError carries run_id and the run's error payload.

Configuration

client = WebskilletClient(
    api_key="your-webskillet-api-key",
    base_url="https://webskillet.ai",  # default
    timeout=30.0,                       # per-request timeout in seconds
)

Requests authenticate with the x-api-key header. You can also pass a preconfigured httpx.Client (or httpx.AsyncClient) via the client parameter for custom proxies, retries, or transports.

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

webskillet-0.1.1.tar.gz (11.9 kB view details)

Uploaded Source

Built Distribution

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

webskillet-0.1.1-py3-none-any.whl (12.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for webskillet-0.1.1.tar.gz
Algorithm Hash digest
SHA256 726d0a695d40e3bc8647b1c855c4437e1d094b9719a4a0d1cc55b138898811aa
MD5 8873c9e0640058abe9cbf36e68f6d31f
BLAKE2b-256 ba7e08c6156c3c2c6adac914dc0d957b69619d8d30db03e6dcb86fa1f9bb4082

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for webskillet-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 66a2d904fcfaf9ac79dbf4d19655268aaef01c5e659d96794d666bd9a6612d82
MD5 7506562cffd030d0d599f54c4be238e4
BLAKE2b-256 63567d34eb04a74ba1f1d5111550c4d9010f7b4689db8dac871dd3bd4adce147

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