Skip to main content

Scrapely Python SDK

Build Python Actors for the Scrapely platform with lifecycle helpers, Crawlee-compatible storage, platform events, remote browser CDP, run control, webhooks, and pay-per-event accounting.

Install

Scrapely requires Python 3.11 or newer.

python -m pip install scrapely-python

Install the appropriate Crawlee/Playwright browser dependencies separately when your Actor uses a browser.

Quick start

import asyncio

from scrapely import Actor


async def main() -> None:
    actor_input = await Actor.get_input_or_throw()
    await Actor.push_data({
        "url": actor_input["url"],
        "status": "processed",
    })


if __name__ == "__main__":
    asyncio.run(Actor.main(main))

Actor.main() initializes the Actor, awaits your callback, closes events and storage, and exits the process. For embedded applications and tests, use async with Actor: instead.

HTTP client

from scrapely import Actor
from scrapely.http import AsyncClient

async with Actor:
    proxy = await Actor.create_proxy_configuration(groups=["RESIDENTIAL"], country_code="DE")
    async with AsyncClient(proxy_configuration=proxy) as http:
        r = await http.get("https://www.example.com/")
        data = (await http.get("https://www.example.com/api/items", kind="json")).json()

Every request uses a current browser profile: TLS, HTTP/2, User-Agent, client hints and header order all come from it. Each request runs on an identity, which is a profile, a proxy session and a cookie jar. When a site blocks an identity (429, block page, captcha), the client retires it and retries the request at once on a fresh one, with a new IP, a new profile and an empty jar. It doesn't wait; polite=True turns on Retry-After and backoff. Moving from curl_cffi takes one line: from scrapely.http import AsyncSession.

Highlights

  • Local file-system storage and Scrapely API-backed datasets, key-value stores, and request queues
  • Crawlee request loaders and storage objects
  • Platform event WebSocket integration and state persistence
  • Automatic remote Chromium CDP wiring through CDP_URL
  • Actor start, call, abort, reboot, and metamorph operations
  • Ad-hoc webhooks, proxy configuration, and charging/pricing types
  • scrapely.http: an HTTP client with current browser fingerprints (TLS, HTTP/2, headers), identity rotation, block detection and retries; drop-in AsyncSession / Session for curl_cffi code
  • Scrapy integration in scrapely.scrapy (run_scrapy_actor, a request-queue scheduler, a dataset pipeline); install Scrapy separately
  • Legacy environment variable aliases and asynchronous client access

See the complete Python SDK guide for lifecycle details, option objects, storage selection, events, CDP behavior, run control, environment variables, errors, and the full public export list.

License

MIT (see LICENSE), except for three files that stay under the Apache License 2.0 (see LICENSE-APACHE and NOTICE).

Metadata

Release files for scrapely-python 0.1.38

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for scrapely-python 0.1.38
File Size Uploaded Provenance Actions
scrapely_python-0.1.38.tar.gz 244.9 kB Without provenance Details for scrapely_python-0.1.38.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for scrapely-python 0.1.38
File Interpreter ABI Platform Actions
scrapely_python-0.1.38-py3-none-any.whl Python 3 none any Details for scrapely_python-0.1.38-py3-none-any.whl

Total release size: 517.4 kB

Release files / scrapely_python-0.1.38.tar.gz

Download URL scrapely_python-0.1.38.tar.gz
Size 244.9 kB
Tags Source
SHA-256 checksum
How to use checksums
31e906212d1d18786c6034f10028849f4afa6e4e824fa3afe610d67bc063f5f9
BLAKE2b-256 checksum
How to use checksums
d86569e63d2651738fca7c9b33089ac6f9e9da63da891eb04112a4a384eadc06
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / scrapely_python-0.1.38-py3-none-any.whl

Download URL scrapely_python-0.1.38-py3-none-any.whl
Size 272.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
334482430d7b99887f080d0dc62e9d88ee26cd7f3169397098aca1a8f6a87b24
BLAKE2b-256 checksum
How to use checksums
a7c92ccf945ed73542b8a17c8c144a4e224b0717597ef2e1d3d82163e633cb61
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for scrapely-python 0.1.38

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.38 This release

2 release files No provenance

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