AZcaptcha for Ruby

Idiomatic Ruby gem with typed exceptions, Ruby 2.6+.

gem install azcaptcha

Quickstart

Ruby
require "azcaptcha"

client = Azcaptcha::Client.new("YOUR_API_KEY")
token = client.solve_recaptcha_v2(
  "6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-",
  "https://example.com/login"
)
puts token
At a glance
Package
azcaptcha
Version
1.0.0
Contract
spec-v1.0.0
License
MIT
  • Ruby 2.6+
  • Typed exceptions
  • No runtime dependencies

Three captcha types, three snippets

Ruby
token = client.solve_recaptcha_v2(sitekey, pageurl)
# invisible / enterprise
token = client.solve_recaptcha_v2(sitekey, pageurl, invisible: true)
Ruby
token = client.solve_turnstile("0x4AAAAAAA...", "https://example.com/")
token = client.solve_hcaptcha("SITEKEY", "https://example.com/")
Ruby
# bytes, base64, data: URI or file path
answer = client.solve_image("captcha.png")

All snippets assume YOUR_API_KEY is set and a client named client exists. Polling timeouts and retry behaviour are handled by the SDK.