Keep your API key in server-side code. Never expose it in client-side applications.
Install
adscrawl-php on GitHub
View source, runnable examples, and releases.
Authenticate and make your first request
Create an API key in the dashboard and setADSCRAWL_API_KEY in your server environment. You can also pass the key to new Client(apiKey: '...').
Rendered content and screenshots
html() returns HTML, markdown() returns Markdown, article() returns an associative array, and screenshot() returns PNG bytes. Page options include viewport, locale, cookies, custom proxy, managed countryCode, fingerprint, server-side timeoutMs, and navigation waitUntil. A custom proxy and managed country cannot be combined.
Proxy and fingerprint
Structured extraction
Remote CDP browsers
$client->cdp->list() returns active sessions. getVersion() validates the session token URL and deliberately omits the API key. CDP connection URLs contain secrets; do not log them.
Persistent cloud browsers
stopping response means shutdown is pending; poll get() until stopped. A failed launch may expose a cleanup profile ID as ApiException::$resourceId.
Configuration and errors
ADSCRAWL_API_KEY. The base URL defaults to ADSCRAWL_BASE_URL, then ADSCRAWL_API_URL, then https://api.adscrawl.net. Errors include ApiException, TimeoutException, ConnectionException, and ResponseException. API response bodies are credential-redacted. The HTTP deadline includes response body reading. Requests are not automatically retried.