Web Scraping API for Ruby
Integrate AlterLab's web scraping API into Ruby applications using Net::HTTP or the popular Faraday/Typhoeus HTTP clients. Works seamlessly in Rails apps, Rake tasks, and Sidekiq background jobs.
Quick Start
require "net/http"
require "json"
require "uri"
uri = URI("https://alterlab.io/api/v1/scrape")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri.path)
request["X-API-Key"] = "YOUR_API_KEY"
request["Content-Type"] = "application/json"
request.body = { url: "https://example.com" }.to_json
response = http.request(request)
result = JSON.parse(response.body)
puts result["content"]Need an API key? Sign up free — no credit card required.
How It Works
Send a URL
POST any public URL to the AlterLab API with your API key. The API handles JavaScript rendering and access automatically.
Receive structured data
The API returns clean JSON with page content, metadata, and any structured fields you requested via an extraction schema.
Use in your project
Integrate the response into your Ruby application, database, or workflow. No scraper maintenance required.
Common Use Cases
Frequently Asked Questions
Explore All Integrations
View all SDK and tool integrations on the Integrations overview.
Responsible Use
AlterLab is designed for extracting publicly available data. Always review the terms of service for any website you access, respect robots.txt directives, and ensure your use case complies with applicable laws in your jurisdiction.
Your first scrape.
Sixty seconds.
$1 free balance. No credit card. No SDK.
Just a POST request.
No credit card required · Up to 5,000 free scrapes · Balance never expire