No browser runtime to maintain
Keep Rails applications and background jobs free of separate browser processes and browser-specific deployment dependencies.
URL to WebP with Ruby
No browser management required
Capture public webpages from Ruby without installing Chrome, running Ferrum or Selenium, or maintaining screenshot storage and delivery.
Ruby workflow
Choose the URL and browser state here, then use the Ruby example below instead of rebuilding the screenshot workflow locally.
Managed screenshots
Keep the application code focused on the request and response while HCTI manages Chromium, page loading, render isolation, retries, and hosted output.
Keep Rails applications and background jobs free of separate browser processes and browser-specific deployment dependencies.
Set the viewport, full-page mode, selector, timing, color scheme, and browser state as request parameters instead of browser scripts.
Receive the hosted .webp result without building a separate pipeline for temporary files, uploads, storage, and delivery.
URL screenshot API
POST the webpage URL, capture settings, and format from Ruby. HCTI handles the browser lifecycle and returns the generated .webp URL.
Send the URL to load, including webpages whose final state depends on browser-rendered JavaScript.
Set format to webp and use the hosted .webp URL returned by the API.
Set viewport dimensions, capture the full page, or crop the result to a CSS selector.
Choose color scheme, timezone, mobile behavior, timing, and other page-loading controls.
How it works
Submit a public URL with format set to webp and any viewport, selector, or browser settings.
The API runs the webpage, styles, fonts, images, and JavaScript in a managed browser environment.
Embed the hosted result, download the file, or save it in your own storage and application records.
Output formats
Keep the same URL and capture settings. Choose lossless detail, compact compatibility, modern web delivery, or a paginated document.
Looking to convert HTML & CSS to WebP? Explore HTML to WebP in RubyCrisp text, sharp interface details, and transparent page backgrounds.
Explore PNGSmaller files and broad compatibility for photographic and content-heavy webpages.
Explore JPEGPaginated webpage captures with page sizing, margins, backgrounds, and print styles.
Explore PDFExample code
Copy a complete Ruby request. Authentication, the webpage URL, viewport settings, output format, and response handling are shown together.
require "json"
require "net/http"
require "uri"
request = {
url: "https://example.com",
format: "webp",
viewport_height: 630,
viewport_width: 1200,
}
uri = URI("https://hcti.io/v1/image")
http_request = Net::HTTP::Post.new(uri)
http_request.basic_auth(ENV.fetch("HCTI_API_ID"), ENV.fetch("HCTI_API_KEY"))
http_request["Content-Type"] = "application/json"
http_request.body = JSON.generate(request)
response = Net::HTTP.start(
uri.hostname,
uri.port,
use_ssl: true,
open_timeout: 10,
read_timeout: 30
) { |http| http.request(http_request) }
unless response.is_a?(Net::HTTPSuccess)
raise format("HCTI request failed (%s): %s", response.code, response.body)
end
result = JSON.parse(response.body)
puts result.fetch("url")
Ready to capture?
Send a public URL to the API and receive a hosted .webp image without running browser infrastructure.