Skip to main content

Typed Python SDK for Supacrawler API (scrape, jobs, screenshots, watch)

Project description

supacrawler-py

Typed Python SDK for Supacrawler API.

Install

  • From PyPI (when published):
pip install supacrawler-py
  • With uv (PEP 621 aware):
uv add supacrawler-py
# or for local dev
uv pip install -e .
  • From local path (development):
pip install -e .
  • From GitHub (direct):
pip install git+https://github.com/Supacrawler/supacrawler-py.git#subdirectory=sdk/supacrawler-py

Usage

from supacrawler import SupacrawlerClient, ScrapeParams, JobCreateRequest, ScreenshotRequest, WatchCreateRequest

client = SupacrawlerClient(api_key="YOUR_API_KEY")

# Scrape
scrape = client.scrape(ScrapeParams(url="https://example.com", format="markdown"))
print(scrape)

# Create crawl job
job = client.create_job(JobCreateRequest(url="https://supabase.com/docs", type="crawl", depth=2, link_limit=10, format="markdown"))
status = client.wait_for_job(job.job_id)
print(status.status)

# Screenshot job
sjob = client.create_screenshot_job(ScreenshotRequest(url="https://example.com", device="desktop", full_page=True))
print("job:", sjob.job_id)

# Wait and fetch a fresh signed URL (recommended)
signed = client.wait_for_screenshot(sjob.job_id)
print("screenshot:", signed.screenshot)

# Watch
watch = client.watch_create(WatchCreateRequest(url="https://example.com/pricing", frequency="daily", notify_email="me@example.com"))
print(watch.watch_id)

Advanced

  • See examples/*.ipynb for full parameter coverage:
    • Scrape: format, render_js, wait, device, depth, max_links, fresh
    • Jobs: format, link_limit, depth, include_subdomains, render_js, patterns
    • Screenshots: device/full_page/format/quality/viewport/device_scale, waits, selectors, blocking, modes
    • Watch: frequency, selector, include_html/image, full_page, quality, pause/resume/check/delete

API coverage

  • GET /v1/scrape (all params)
  • POST /v1/jobs, GET /v1/jobs/{id}
  • POST /v1/screenshots
  • POST /v1/watch, GET /v1/watch, GET /v1/watch/{id}, DELETE /v1/watch/{id}, PATCH /v1/watch/{id}/pause, PATCH /v1/watch/{id}/resume, POST /v1/watch/{id}/check

Development

  • Env var: SUPACRAWLER_API_KEY for examples.
  • Not needed: requirements.txt for end-users (deps declared in pyproject.toml). Optional requirements-dev.txt if you add tests or notebooks tooling.

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

supacrawler_py-0.1.2.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

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

supacrawler_py-0.1.2-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file supacrawler_py-0.1.2.tar.gz.

File metadata

  • Download URL: supacrawler_py-0.1.2.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.13

File hashes

Hashes for supacrawler_py-0.1.2.tar.gz
Algorithm Hash digest
SHA256 1ea289b35856586c50430c250ae9ff7cbd22013d5f04c68560eb1cc3a6c97290
MD5 4081ddf1362a3e2ca8c7d7c55618ea9f
BLAKE2b-256 21b3c92db988c80b9a3a6ad1dbbf557e7572bb6353d6a3b98e8b4310ffda9d58

See more details on using hashes here.

File details

Details for the file supacrawler_py-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: supacrawler_py-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.13

File hashes

Hashes for supacrawler_py-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ad6eaf3150390656b411f1b5b89027d93cc33b81f4fd830ea901b6b17d7f8d97
MD5 605c1d25f339c597229d41a3f5783db0
BLAKE2b-256 d650f1c26c49a6480cd2cc9acea162032f6963783fa4d9b9e3556a63121555d9

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