A Python SDK for the Scrape.do API
Project description
scrape-do-python
A Python SDK for the Scrape.do web-scraping proxy API.
Built on httpx and pydantic v2, with strict request validation, automatic retries on gateway errors, sticky-session validation, and SDK-native lifecycle hooks.
Status
v0.1.0→ Early but functional
Synchronous client is shipped
Async and Proxy-Mode clients are on the
Roadmap
Breaking changes are possible between
0.xminor versions.
Installation
pip install scrape-do-python
Quickstart
from scrape_do.client import ScrapeDoClient
# API Token pulled from SCRAPE_DO_API_KEY env variable
# Can also be provided via 'api_token' argument
with ScrapeDoClient() as client:
response = client.get(
"https://example.com",
super=True,
render=True,
return_json=True,
show_frames=True,
)
print(response.is_proxy_error)
print(response.frames[0].url)
print(response.remaining_credits)
Features
Type-Checked Request Parameters
Request parameters are fully type-checked and automatically validated via the RequestParameters pydantic model
Smart Routing
ScrapeDoClient.request() accepts either **api_kwargs, a pre-built RequestParameters, or a raw api.scrape.do URL for request parameters
Automatic Retries
ScrapeDoClient can automatically retry requests on Scrape.do gateway errors (429 / 502 / 510) with customizable backoff (static or callable)
Sticky-Session Validation
Supply a session_validator callback to detect proxy node rotations and raise RotatedSessionError
SDK-Native Event Hooks
request / response / retry lifecycle hooks, distinct from httpx's transport-level hooks.
Strongly-Typed Responses
ScrapeDoResponse exposes the parsed JSON envelope, browser action results, screenshots, and network/websocket logs.
Browser Automation
Pydantic models for Browser Actions providing validation and type-hinting for the playWithBrowser API parameter
Documentation
Roadmap
See ROADMAP for the upcoming Async Client, Proxy-Mode Clients, Async-API Support, and Plugin Support
Contributing
Pull Requests, Bug Reports, and Feature Requests are all welcome.
See CONTRIBUTING for local setup, test commands, and PR conventions
Community
Participation is governed by our Code of Conduct. To privately report a security issue, see the Security Policy.
License
scrape-do-python is released under the MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file scrape_do_python-0.1.0.tar.gz.
File metadata
- Download URL: scrape_do_python-0.1.0.tar.gz
- Upload date:
- Size: 33.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f17d44a3c681e86f4d346d0d06a4e42ae923c7b0c74ec5ee16ebda925548c5c9
|
|
| MD5 |
bc3637bbfcd088a186d67ab9822f658b
|
|
| BLAKE2b-256 |
cf5ad16ee6d820fa675623f28a4c2c7d8374bf0667905256bae23820ee5e75cd
|
Provenance
The following attestation bundles were made for scrape_do_python-0.1.0.tar.gz:
Publisher:
ci.yml on svdC1/scrape-do-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
scrape_do_python-0.1.0.tar.gz -
Subject digest:
f17d44a3c681e86f4d346d0d06a4e42ae923c7b0c74ec5ee16ebda925548c5c9 - Sigstore transparency entry: 1487107185
- Sigstore integration time:
-
Permalink:
svdC1/scrape-do-python@5d331350bde47de0e84fd108e87a84750ca03c40 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/svdC1
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@5d331350bde47de0e84fd108e87a84750ca03c40 -
Trigger Event:
release
-
Statement type:
File details
Details for the file scrape_do_python-0.1.0-py3-none-any.whl.
File metadata
- Download URL: scrape_do_python-0.1.0-py3-none-any.whl
- Upload date:
- Size: 36.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c0d83b025364a438c1fb3fe8f07fe2acd39e63578b713958adeff4377c691c2e
|
|
| MD5 |
eed44028762c0f73eff5fd81a8516bff
|
|
| BLAKE2b-256 |
f6a15d1541320c6d0f27f9309497c01cfbe64bb7b1d50eafa775fda2f92957f8
|
Provenance
The following attestation bundles were made for scrape_do_python-0.1.0-py3-none-any.whl:
Publisher:
ci.yml on svdC1/scrape-do-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
scrape_do_python-0.1.0-py3-none-any.whl -
Subject digest:
c0d83b025364a438c1fb3fe8f07fe2acd39e63578b713958adeff4377c691c2e - Sigstore transparency entry: 1487107191
- Sigstore integration time:
-
Permalink:
svdC1/scrape-do-python@5d331350bde47de0e84fd108e87a84750ca03c40 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/svdC1
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@5d331350bde47de0e84fd108e87a84750ca03c40 -
Trigger Event:
release
-
Statement type: