Skip to main content

Official Python client for the ScrapeUnblocker web scraping API - JavaScript-rendered pages that bypass Cloudflare, DataDome, PerimeterX, Akamai and more.

Project description

ScrapeUnblocker Python client

Official Python client for the ScrapeUnblocker web scraping API.

Every request is fully JavaScript-rendered in a real browser and routed through premium proxies, so it bypasses Cloudflare, DataDome, PerimeterX, Akamai, Kasada and similar anti-bot systems - from one simple call. You are only billed for successful requests.

  • Highest success rate on the market (95%+ on live production traffic)
  • Rendered HTML or parsed JSON - no per-site parsers to maintain
  • Sync and async clients, fully type-hinted

Install

pip install scrapeunblocker

Requires Python 3.8+.

Quickstart

from scrapeunblocker import Client

su = Client(api_key="YOUR_API_KEY")   # or set the SCRAPEUNBLOCKER_KEY env var

# Rendered HTML for any URL
html = su.get_page_source("https://example.com")

# Structured JSON instead of HTML (products, listings, search results, ...)
product = su.get_parsed("https://www.amazon.com/dp/B08N5WRWNW")
print(product.page_type)   # "product"
print(product.data)        # {...}

Get your API key at app.scrapeunblocker.com. The free trial does not require a credit card.

Authentication

Pass the key directly, or set an environment variable and omit it:

export SCRAPEUNBLOCKER_KEY="YOUR_API_KEY"
from scrapeunblocker import Client
su = Client()   # reads SCRAPEUNBLOCKER_KEY

Fetch rendered HTML

html = su.get_page_source(
    "https://www.nordstrom.com/browse/women/clothing/dresses",
    proxy_country="US",     # route through a specific country
    time_sleep=3,           # wait extra seconds after load
)

Get parsed JSON

Pass a URL and get back structured data extracted via Schema.org, __NEXT_DATA__ or AI-generated rules:

result = su.get_parsed("https://www.walmart.com/ip/12345")
print(result.page_type)    # e.g. "product"
print(result.source)       # how it was extracted
print(result.data)         # the fields

# If a parse ever comes back wrong, force a fresh set of rules:
result = su.get_parsed(url, refresh_rules=True, rules_hint="price is missing")

Google search (SERP)

serp = su.serp("web scraping api", pages_to_check=2, proxy_country="US")

Cookies and the serving proxy

page = su.get_page_with_cookies("https://example.com")
print(page.html, page.cookies, page.proxy)

Images

data = su.get_image("https://example.com/photo.jpg")
open("photo.jpg", "wb").write(data)

Skyscanner plugins

# Resolve a place name to entity IDs, then search
locs = su.skyscanner.flight_locations("London")
flights = su.skyscanner.flights(
    origin="London", dest="New York",
    depart_date="2026-09-01", adults=1, currency="USD",
)

hotels = su.skyscanner.hotels(destination="Madrid", checkin="2026-09-01", checkout="2026-09-03")
cars = su.skyscanner.carhire(pickup="Madrid", pickup_datetime="2026-09-01T10:00", dropoff_datetime="2026-09-03T10:00")

Async

Every method has an async twin on AsyncClient:

import asyncio
from scrapeunblocker import AsyncClient

async def main():
    async with AsyncClient(api_key="YOUR_API_KEY") as su:
        html = await su.get_page_source("https://example.com")

asyncio.run(main())

Error handling

Non-2xx responses raise typed exceptions, all subclasses of ScrapeUnblockerError:

from scrapeunblocker import Client, BlockedError, RateLimitError, UpstreamOutageError

su = Client()
try:
    html = su.get_page_source("https://example.com")
except BlockedError:
    ...   # 403: the target blocked every bypass path (not billed)
except RateLimitError:
    ...   # 429: slow down
except UpstreamOutageError:
    ...   # 503: the target site itself is down - retry later
Exception Status Meaning
InvalidRequestError 400 Bad URL or unsupported scheme
AuthenticationError 401 Missing or invalid API key
BlockedError 403 Blocked by bot protection on every path
RateLimitError 429 Too many requests
UpstreamOutageError 503 The target origin is down
ServerError 5xx Unexpected server error
ScrapeTimeoutError - Request exceeded the timeout
ConnectionError - Could not reach the API

Transient failures (429, 502, 503, 504 and network errors) are retried automatically with exponential backoff; tune with Client(max_retries=...).

Configuration

Client(
    api_key=None,          # or SCRAPEUNBLOCKER_KEY env var
    base_url="https://api.scrapeunblocker.com",
    timeout=180.0,         # seconds; protected pages can be slow
    max_retries=2,
)

Links

License

MIT

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

scrapeunblocker-0.1.1.tar.gz (11.0 kB view details)

Uploaded Source

Built Distribution

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

scrapeunblocker-0.1.1-py3-none-any.whl (13.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: scrapeunblocker-0.1.1.tar.gz
  • Upload date:
  • Size: 11.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for scrapeunblocker-0.1.1.tar.gz
Algorithm Hash digest
SHA256 348aaaae14fa037dd56032e05ef7e7580dd706687067b8f7b4a2e122263f8228
MD5 b68c0cac485fb100a305a28abeb20ff5
BLAKE2b-256 70a032d7bb78d432a99c1c8899dca00ee0ad2b264368e04ab7b93b25b22ce4a4

See more details on using hashes here.

Provenance

The following attestation bundles were made for scrapeunblocker-0.1.1.tar.gz:

Publisher: publish.yml on ScrapeUnblocker/scrapeunblocker-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: scrapeunblocker-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 13.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for scrapeunblocker-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 53905bb17bddd1c43eac10b4d27b33b39ebe3a56dff31de0cbbde303764df45e
MD5 b7ace76f26ca782c617facd89b5ea900
BLAKE2b-256 b89d81f8c76b51b14de0257fd6390fc917e20c8756e4ed71c0df92bcde965d75

See more details on using hashes here.

Provenance

The following attestation bundles were made for scrapeunblocker-0.1.1-py3-none-any.whl:

Publisher: publish.yml on ScrapeUnblocker/scrapeunblocker-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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