Skip to main content
The AdsCrawl Python SDK works with Python 3.9 and later. It provides both synchronous and asynchronous clients, uses only the Python standard library for HTTP, and has zero runtime dependencies.
Keep your API key in server-side code. Never expose it in client-side applications.

Install

When you need to connect a remote browser with Playwright, install the extra:

adscrawl-python on GitHub

View source, runnable examples, and releases.

Authenticate and make your first request

Create an API key in the dashboard and set ADSCRAWL_API_KEY in your server environment. You can also pass the key explicitly to AdsCrawl(api_key="...").

Rendered content and screenshots

html() returns HTML by default. markdown() returns Markdown, article() returns a dictionary, and screenshot() returns PNG bytes. Use a custom proxy or managed countryCode; they cannot be combined.

Proxy and fingerprint

AdsCrawl uses real browsers with configurable routing and browser fingerprints. Randomized settings are generated as a coherent profile across the operating system, GPU, hardware, fonts, and related signals. This browser workflow has been verified to access and render BrowserScan, Pixelscan, and IPhey and return screenshots.

Structured extraction

A generic type argument describes the expected output but does not validate your custom data at runtime. Always check missingFields.

Remote CDP browsers

cdp.list() returns {"ok": True, "data": [...]}. cdp.get_version(session) discovers the WebSocket endpoint without forwarding the API key. Connection URLs contain secrets and should not be logged.

Persistent cloud browsers

API-key starts and launches require a top-level custom proxy every time. A stopping response does not confirm shutdown; poll get() until stopped. Failed launches can expose a cleanup id as AdsCrawlAPIError.id.

Async client

The async facade runs the dependency-free standard-library HTTP transport in worker threads. Cancelling a coroutine or reaching a timeout does not prove remote browser work stopped.

Configuration and errors

The API key defaults to ADSCRAWL_API_KEY. The base URL defaults to ADSCRAWL_BASE_URL, then ADSCRAWL_API_URL, then https://api.adscrawl.net. Errors include AdsCrawlAPIError, AdsCrawlTimeoutError, AdsCrawlConnectionError, and AdsCrawlResponseError. API response bodies are credential-redacted. The HTTP deadline includes response body reading. Requests are not automatically retried.