Skip to main content
The official PHP client wraps the ScrapeUnblocker API in a small, dependency-free package (built-in cURL) with typed exceptions and automatic retries.
Requires PHP 8.1+ with the curl and json extensions. Store your API key in an environment variable so the client picks it up automatically:

Quickstart

Get parsed JSON instead of HTML

See the parsed data guide for response shapes.

Scrape a Google SERP

Force a country

Capture cookies and the proxy used

Fetch an image

Skyscanner plugins

Error handling

Non-2xx responses throw typed exceptions, all subclasses of ScrapeUnblockerException. Transient failures (429, 502, 503, 504 and network errors) are retried automatically; a 401 or 402 is never retried, because it clears when the key or the billing state changes.
The 402 and 404-422 exceptions were added in 0.1.6; before that they arrived as a bare ApiException. Nothing was removed, so catch (ApiException) written against earlier versions keeps working. See all status codes in Errors.
Tune the retry count and timeout on the client:

Raw HTTP (without the package)

The API is plain HTTP, so you can call it with cURL directly - no package required.
The endpoints are getPageSource, serpApi, and getImage; every parameter shown above maps to a query parameter of the same name.