Developer guides
Use the official RubyGems beta gem from Rails apps, scripts, and background jobs. Typed, batteries-included grouped helpers and dynamic operation calls.
Verified HTTP pattern
GET /bing/search
Request
GET https://api.crawlora.net/api/v1/bing/search?q=best+CRM+software&country=us&count=10
x-api-key: $CRAWLORA_API_KEYBase URL
https://api.crawlora.net/api/v1
Auth header
x-api-key
Example endpoint
GET /bing/search
The Ruby SDK is published to RubyGems as the crawlora gem and developed at https://github.com/Crawlora-org/crawlora-ruby-sdk. The current promoted beta is a prerelease (1.5.0.pre.sdk.3); install it with the --pre flag or pin it in your Gemfile. Requires Ruby 3.0+.
Developer workflow
RubyGems treats the -sdk. segment as a prerelease, so install with the --pre flag or pin the prerelease version in your Gemfile.
# Gemfile gem "crawlora", "1.5.0.pre.sdk.3" # or install directly (prerelease) gem install crawlora --pre
Developer workflow
export CRAWLORA_API_KEY="your_api_key_here"
Developer workflow
Create a client, then call grouped endpoint helpers or the dynamic operation interface.
require "crawlora"
# Reads CRAWLORA_API_KEY from the environment if api_key: is omitted.
client = Crawlora.client(api_key: ENV["CRAWLORA_API_KEY"])
result = client.bing.search(q: "coffee shops")
result["data"].each { |item| puts item["title"] }
client.close # release pooled keep-alive connectionsDeveloper workflow
Use Net::HTTP directly for a zero-dependency path, or to compare behavior with endpoint docs before adding the gem.
require "net/http"
require "json"
require "uri"
API_KEY = ENV.fetch("CRAWLORA_API_KEY")
BASE_URL = "https://api.crawlora.net/api/v1"
def crawlora_request(path, params)
uri = URI("#{BASE_URL}#{path}")
uri.query = URI.encode_www_form(params)
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
http.read_timeout = 60
request = Net::HTTP::Get.new(uri)
request["x-api-key"] = API_KEY
response = http.request(request)
raise "Crawlora request failed: #{response.code} #{response.body}" unless response.is_a?(Net::HTTPSuccess)
JSON.parse(response.body)
end
data = crawlora_request("/bing/search", {
q: "best CRM software",
country: "us",
})
puts dataDeveloper workflow
Proxy browser requests through a server-side controller so the API key never reaches client-side code.
# app/controllers/search_controller.rb
class SearchController < ApplicationController
def create
keyword = params[:keyword].to_s.strip
return render json: { error: "keyword is required" }, status: :bad_request if keyword.empty?
# Reads CRAWLORA_API_KEY from the environment if api_key: is omitted.
client = Crawlora.client
result = client.bing.search(q: keyword)
render json: result
end
endDeveloper workflow
Run a search on a queue instead of the request thread, appending each result or error as a JSON line.
# app/jobs/search_job.rb
class SearchJob
include Sidekiq::Job
def perform(keyword)
client = Crawlora.client
result = client.bing.search(q: keyword)
File.open("crawlora-search-results.jsonl", "a") do |file|
file.puts({ keyword: keyword, response: result }.to_json)
end
rescue => exc
File.open("crawlora-search-results.jsonl", "a") do |file|
file.puts({ keyword: keyword, error: exc.message }.to_json)
end
end
endDeveloper workflow
Rescue from the gem's request errors and inspect the status codes below — these are common integration patterns for the Ruby client. Endpoint detail pages list documented failure responses where available.
| Status / code | Meaning | How to handle |
|---|---|---|
| 400 | Invalid request or missing required input. | Validate request bodies before calling Crawlora and surface useful messages to users. |
| 401 | Missing or invalid API key. | Check the `x-api-key` header and rotate the key from the console if needed. |
| 402/403 | Plan, permission, or billing issue where applicable. | Check plan access, credit state, and endpoint availability. |
| 429 | Rate limit exceeded. | Back off with jitter and reduce concurrency. |
| 5xx | Temporary execution or upstream failure. | Retry safe jobs with exponential backoff and keep the failure visible. |
Developer workflow
Use Crawlora for structured public web data workflows. Customers are responsible for compliance with applicable laws, third-party rights, platform rules, and Crawlora terms. Keep API keys server-side, validate inputs, and avoid collecting or storing unnecessary sensitive data.
Read Crawlora termsDeveloper workflow
Use these pages to move between endpoint discovery, examples, pricing, and responsible-use guidance.
Developer workflow
Common questions for this Crawlora developer integration path.
Yes. The official Ruby beta gem is published to RubyGems as crawlora and developed at https://github.com/Crawlora-org/crawlora-ruby-sdk. Install it with gem install crawlora --pre.
Ruby 3.0 or newer.
RubyGems treats the -sdk. segment as a prerelease, so the current beta resolves as a .pre.sdk version. Use the --pre flag or pin the prerelease string in your Gemfile.
Pass api_key: to Crawlora.client, or omit it to read CRAWLORA_API_KEY from the environment. JWT authorization is also supported.
Yes. Use it in controllers, services, or workers — see the Rails controller and Sidekiq job examples above; the client supports a block form that auto-closes pooled connections.
Build the client inside the job's perform method (Crawlora.client reads CRAWLORA_API_KEY from the environment) and call it like any other Ruby object — see the Sidekiq job example above for a pattern that logs successes and failures to the same file.
Open the endpoint detail page from the docs catalog to inspect request parameters, examples, and schema references.
Install the crawlora gem with --pre, set CRAWLORA_API_KEY, then inspect endpoint docs for platform-specific schemas.