Skip to content
Ruby

Ruby Screenshot API for Web Capture and Automation

Add web capture to any Ruby application — Rails, Sinatra, Sidekiq jobs, or standalone scripts. Capture screenshots, generate PDFs, record videos, and extract HTML. No Grover, no wkhtmltopdf.

What you can build

Rails apps

Generate screenshots and PDFs from controllers, background jobs, or rake tasks with a clean Ruby API.

Invoice & report PDFs

Convert styled HTML invoices to pixel-perfect PDFs — better rendering than wkhtmltopdf or Grover.

Authenticated captures

Use automation steps to log in and capture client dashboards, admin panels, and gated SaaS pages.

Sidekiq background jobs

Queue capture requests in Sidekiq for parallel processing with built-in retries.

What the API handles for you

Every output format

PNG, JPEG, WebP, full-page PDF, raw HTML, and video screencasts from one endpoint.

Automation steps

Click, type, scroll, navigate, and wait before capture — handle logins, cookie banners, and dynamic content.

80+ country routing

Render geo-gated pages from real browsers in any target country.

14+ app integrations

Deliver results to S3, Google Drive, Dropbox, Slack, and more — no upload code needed.

Batch & crawl

Capture entire sitemaps or crawl domains with built-in retries and progress tracking.

On-premise browsers

Run browser clients inside your network for compliance or latency requirements.

Installation

terminal
gem install screenshotcenter
Available on RubyGemsrubygems.org/gems/screenshotcenter

Quick start

main.rb
require "screenshotcenter"

client = ScreenshotCenter::Client.new(ENV["SCREENSHOTCENTER_API_KEY"])

shot   = client.screenshot.create("https://example.com")
result = client.wait_for(shot["id"])
puts result["url"]     # final URL
puts result["status"]  # "finished"

More examples

Ciblage géographique
shot = client.screenshot.create("https://example.com",
  country: "fr", lang: "fr-FR", tz: "Europe/Paris")
done = client.wait_for(shot["id"])
client.screenshot.save_image(done["id"], "/tmp/fr.png")
Génération de PDF
shot = client.screenshot.create("https://example.com", pdf: true)
done = client.wait_for(shot["id"])
client.screenshot.save_pdf(done["id"], "/tmp/page.pdf")
Gestion des erreurs
begin
  result = client.wait_for(shot["id"], interval: 2, timeout: 60)
rescue ScreenshotCenter::ScreenshotFailedError => e
  puts "Failed: #{e.reason}"
rescue ScreenshotCenter::TimeoutError => e
  puts "Timed out after #{e.timeout_ms}ms"
rescue ScreenshotCenter::ApiError => e
  puts "API error #{e.status}: #{e.message}"
end
Crawl de site web
crawl = client.crawl.create("https://example.com", "example.com", 100)
result = client.crawl.wait_for(crawl["id"])
puts result["total_discovered"]  # pages found

Resources

Frequently asked questions

Do I need Grover or wkhtmltopdf?

No. ScreenshotCenter renders in real browsers with full CSS, JavaScript, and web font support. No system-level tools to install.

Does it work with Rails?

Yes. Install via Bundler and use the SDK in any Rails controller, job, or rake task.

Can I capture pages behind a login?

Yes. Define automation steps to type credentials, click buttons, and navigate before the capture.

What Ruby version is required?

The SDK supports Ruby 3.0+ and works with all major Ruby web frameworks.

Related

Start capturing with Ruby today

Get 500 captures on the free trial — no credit card required. Install the SDK and take your first screenshot in minutes.