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")
Google Local (Maps)
# Local business listings for a search and market
local = su.google_local("coffee shops in chicago", proxy_country="US", gl="us")
for biz in local["results"]:
print(biz["name"], biz["rating"], biz["reviews"], biz["address"])
Oopbuy product search
# Search Oopbuy sourcing channels (1688, Taobao, official)
goods = su.oopbuy_search("wireless earbuds", channel="1688", sort="best_selling")
for item in goods["results"]:
print(item["title"], item["price"], item["monthSold"], item["url"])
eBay search
# Listings from any regional eBay marketplace
items = su.ebay_search("iphone 13", marketplace="ebay.com", condition="used")
if items["exactMatches"]:
for item in items["results"]:
print(item["title"], item["price"], item["currency"], item["condition"])
print(" seller:", item["seller"]["username"], item["seller"]["feedbackPercent"])
exactMatches is False when eBay found nothing for the keyword and returned
its own loosely-related suggestions instead, so check it before using the
listings.
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,
PaymentRequiredError,
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 PaymentRequiredError:
... # 402: quota, credit limit, or a failed payment - fix billing
except RateLimitError:
... # 429: slow down
except UpstreamOutageError:
... # 503: the target site itself is down - retry later
| Exception | Status | Meaning |
|---|---|---|
InvalidRequestError |
400 | Bad URL, unsupported scheme, or the API key header was not sent |
AuthenticationError |
401 | Key not recognised - typo, stray whitespace, or a rotated key |
NoSubscriptionError |
401 | Key is fine, but the account has no active plan |
PaymentRequiredError |
402 | Billing block - base class for the three below |
QuotaExceededError |
402 | The plan's requests for this period are used up |
CreditLimitExceededError |
402 | Unpaid balance is past the account's credit limit |
PaymentFailedError |
402 | A card payment was declined three times |
BlockedError |
403 | Blocked by bot protection on every path |
NotFoundError |
404 | Page loaded but held no image (get_image only) |
BrowserTimeoutError |
408 | Our browser run timed out before the page was ready |
UnsupportedContentError |
415 | The URL serves something other than HTML |
ValidationError |
422 | Missing or wrong-typed parameter; body holds the detail array |
RateLimitError |
429 | Too many requests |
UpstreamOutageError |
503 | The target origin is down |
ServerError |
5xx | Unexpected server error, including a 504 upstream timeout |
ScrapeTimeoutError |
- | This client gave up locally before the API answered |
ConnectionError |
- | Could not reach the API |
Every one of these subclasses ScrapeUnblockerError, so a single except ScrapeUnblockerError still catches everything, and the 402 and 401 subclasses can be caught by their base class when you do not need to tell them apart.
Transient failures (429, 502, 503, 504 and network errors) are retried automatically with exponential backoff; tune with Client(max_retries=...). A 401 or 402 is never retried - it clears when the key or the billing state changes, not on another attempt. Neither is billed or counted against your quota, because the request is refused before anything is scraped.
Billing errors (402)
The three billing blocks share a status code and differ only in their message, so the client raises a dedicated exception for each:
from scrapeunblocker import (
Client,
CreditLimitExceededError,
PaymentFailedError,
QuotaExceededError,
)
su = Client()
try:
html = su.get_page_source("https://example.com")
except QuotaExceededError:
... # plan quota (plus any overage allowance) is used up for this period
except CreditLimitExceededError:
... # unpaid balance passed the account credit limit
except PaymentFailedError:
... # card declined three times - update the payment method
When more than one applies, the most serious wins: failed payment outranks credit limit, which outranks quota. All three lift by themselves once the billing state changes - access returns within about a minute, and the API key stays the same. One catch worth knowing: subscribing to a new plan does not clear PaymentFailedError, because the old unpaid invoice stays open until it is paid.
Full details for every status code: developers.scrapeunblocker.com/errors.
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
- Documentation: developers.scrapeunblocker.com
- Website: scrapeunblocker.com
- Dashboard: app.scrapeunblocker.com
License
MIT
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 scrapeunblocker-0.1.8.tar.gz.
File metadata
- Download URL: scrapeunblocker-0.1.8.tar.gz
- Upload date:
- Size: 18.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c789a64d708ded3f11f57d5c401afcb3bc76a7b2e1ec3a07cd5ad8f9e34af152
|
|
| MD5 |
239e28040f84b10791b55250d6d71756
|
|
| BLAKE2b-256 |
4ccb67f45b539328c072603766c2cbbff3a350f896d608fce19654357d3d1437
|
Provenance
The following attestation bundles were made for scrapeunblocker-0.1.8.tar.gz:
Publisher:
publish.yml on ScrapeUnblocker/scrapeunblocker-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
scrapeunblocker-0.1.8.tar.gz -
Subject digest:
c789a64d708ded3f11f57d5c401afcb3bc76a7b2e1ec3a07cd5ad8f9e34af152 - Sigstore transparency entry: 2300676297
- Sigstore integration time:
-
Permalink:
ScrapeUnblocker/scrapeunblocker-python@79e61cd10bf0b74fa26da30d11d0dc35399acd0b -
Branch / Tag:
refs/tags/v0.1.8 - Owner: https://github.com/ScrapeUnblocker
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@79e61cd10bf0b74fa26da30d11d0dc35399acd0b -
Trigger Event:
release
-
Statement type:
File details
Details for the file scrapeunblocker-0.1.8-py3-none-any.whl.
File metadata
- Download URL: scrapeunblocker-0.1.8-py3-none-any.whl
- Upload date:
- Size: 19.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2ea016195ab04e0493b66bcbe662d28e1fc858fcf23a6c3170c34bf48656770f
|
|
| MD5 |
2a7d16869ad9faa59da358a5e73306ed
|
|
| BLAKE2b-256 |
d9c37ae4f2577bc7d59c4959b192111778d5631f90b8ac18020699f7613a11b9
|
Provenance
The following attestation bundles were made for scrapeunblocker-0.1.8-py3-none-any.whl:
Publisher:
publish.yml on ScrapeUnblocker/scrapeunblocker-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
scrapeunblocker-0.1.8-py3-none-any.whl -
Subject digest:
2ea016195ab04e0493b66bcbe662d28e1fc858fcf23a6c3170c34bf48656770f - Sigstore transparency entry: 2300676358
- Sigstore integration time:
-
Permalink:
ScrapeUnblocker/scrapeunblocker-python@79e61cd10bf0b74fa26da30d11d0dc35399acd0b -
Branch / Tag:
refs/tags/v0.1.8 - Owner: https://github.com/ScrapeUnblocker
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@79e61cd10bf0b74fa26da30d11d0dc35399acd0b -
Trigger Event:
release
-
Statement type: