How to take website screenshots in Ruby
Let's examine what Ruby proposes for us to render HTML or URL as a screenshot dynamically.
- Written by
- Dmytro Krasun
- Published on
- •
- 5 min read
Capture pixel-perfect website screenshots in Ruby with a simple API call. No browser management, no Selenium setup—just clean, reliable screenshots.
Looks great
Remove annoying banners easily. ScreenshotOne can block complex GDPR and cookie consent forms. Most cases are covered.
last 30 days
3.5M+
Screenshots rendered
Renders the growing screenshot number every day. The API is performant and proven to handle scale.
Customize everything
Our screenshot API supports a large variety of options for customizing website screenshot rendering. No need to write custom code and logic anymore.
Pixel-perfect quality
Your customers will be pleasantly surprised by the quality of screenshots.
Integrate today
Use our official Ruby SDK or send simple HTTP requests to capture screenshots.
# Add this gem to your Gemfile:# gem 'screenshotone'
# If you don't need to add a signatureclient = ScreenshotOne::Client.new('<access key>')
# Or ff you do need to add a signatureclient = ScreenshotOne::Client.new('<access key>', '<secret key>')
# You can set any available option, in a camel_case format, for example:options = ScreenshotOne::TakeOptions.new(url: 'https://example.com'). full_page(true). delay(2). geolocation_latitude(48.857648). geolocation_longitude(2.294677). geolocation_accuracy(50)
# Verify all the parameters are valid (we will validate the parameters that should be# numeric, booleans or that accept only certain values)options.valid?=> true
# To simply get the final url:client.generate_take_url(options)=> "https://api.screenshotone.com/take?url=https%3A%2F%2Fexample.com..."
# To actually get the image (the response body of a request to the previous url)client.take(options)=> "\xFF\xD8\xFF\xE0\x00\x10JFIF\x00\x01\x01\x00\x00\x01\x00\x01\x00\x00\xFF\..."
ScreenshotOne is the best product on the market - and that's before you take into account how responsive and easy Dmytro is to work with.
Any time we've found a rare edge case, it's been resolved in hours.
Great company, great founder - can't say enough!
Read
Practical guides and real updates based on our experience operating rendering infrastructure at production scale.
Let's examine what Ruby proposes for us to render HTML or URL as a screenshot dynamically.
How Kinsta uses ScreenshotOne to deliver reliable automatic updates.
Typeshare is a digital writing platform designed to enhance the writing experience by offering a suite of tools aimed at reducing common barriers writers face.
Exhaustive documentation, ready SDKs, no-code tools, and other automation to help you render website screenshots and outsource all the boring work related to that to us.