gem "scrapeunblocker". Requires Ruby 2.7+.
Store your API key in an environment variable so the client picks it up automatically:
Quickstart
Get Markdown for LLMs
get_markdown (0.13.0+) returns the page as clean Markdown for LLMs, agents and RAG pipelines: headings, lists, tables, absolute links and images with alt text, without scripts, styles, navigation or footer. By default you get the main content only. It takes the same options as get_page_source except list_elements, and is billed the same.
Get parsed JSON instead of HTML
get_parsed does not raise: it returns a result with page type unknown and empty data, together with the rendered HTML (the API’s data_extracted: false and html fields). The call is billed like a page-source call. See when nothing can be extracted.
See the parsed data guide for response shapes.
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.list_elements: true, which makes
get_page_source return the page’s interactive elements as a parsed Hash
instead of HTML:
selector drops straight into a steps action. Full action
reference in the browser steps guide.
Amazon
Product and search data as JSON, priced in the marketplace’s own currency:proxy_country defaults to the marketplace’s home country (amazon.com -> US, amazon.de -> DE), so Amazon prices come back in the right currency. 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
Every other plugin
The gem has a method for every plugin (0.10.0 and later) - the plugin’s main input goes in positionally, everything else as keyword options, and options you leave out are not sent, so the API’s defaults apply. Each plugin page shows its method next to cURL. Methods for newer plugins come with newer releases: the Google Hotels, Google News, Google Ads Transparency, Shopee, Taobao, Upwork, Smyths Toys and Wish methods need 0.14.0 or later.Error handling
Non-2xx responses raise typed errors, all subclasses ofScrapeUnblocker::Error. 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 errors were added in 0.1.6; before that they arrived as a bare APIError. Nothing was removed, so rescue ScrapeUnblocker::APIError written against earlier versions keeps working. See all status codes in Errors.Raw HTTP (without the gem)
The API is plain HTTP, so Ruby’s standard library is enough - no gem required.getPageSource, serpApi, and getImage; every parameter shown above maps to a query parameter of the same name.
