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
Scrape a Google SERP
Force a country
Capture cookies and the proxy used
Fetch an image
Drive the browser with steps
Pass a native array of actions to run in a real browser after the page loads. You get back the HTML of the resulting state.listElements(), which returns the page’s
interactive elements as an array:
selector drops straight into a steps action. Full action
reference in the browser steps guide.
Amazon
Product and search data as an array, priced in the marketplace’s own currency:proxy_country defaults to the marketplace’s home country (amazon.com -> US, amazon.de -> DE), so prices come back in the right currency with no configuration. Full field list on the Amazon plugin page.
eBay search
Listings from any of the 19 regional eBay marketplaces as JSON:exactMatches is false when eBay found nothing for the keyword and answered with its own loosely-related suggestions instead. Full field list on the eBay Search plugin page.
Skyscanner plugins
Error handling
Non-2xx responses throw typed exceptions, all subclasses ofScrapeUnblockerException. 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.Raw HTTP (without the package)
The API is plain HTTP, so you can call it with cURL directly - no package required.getPageSource, serpApi, and getImage; every parameter shown above maps to a query parameter of the same name.
