Fidro + Ruby Integration
Protect your Ruby application from fraud. Follow this guide to add email validation and IP intelligence in minutes.
Overview
To integrate Fidro with Ruby, use the HTTParty gem to send a POST request to the Fidro API with the user's email and IP address. Fidro returns email validation results, disposable email detection, IP geolocation, and a fraud risk score in a single JSON response. The integration is straightforward — HTTParty handles the HTTP request and JSON parsing with minimal code.
Fidro is a fraud detection API that combines email validation, IP intelligence, geolocation analysis, and Stripe chargeback prevention in a single API call. It returns a risk score with a clear recommendation — allow, review, or block — so you can stop fraud without building your own scoring logic.
1. Install Dependencies
gem install httparty
You will also need a Fidro API key. Sign up for free to get one.
2. Email Validation
Send a POST request to Fidro's /v1/validate endpoint with the user's email address and optional IP. Fidro validates the email, checks for disposable domains, analyzes the IP for VPN/proxy/Tor usage, and returns a risk score with a clear recommendation — allow, review, or block.
require "httparty"
FIDRO_API_KEY = ENV["FIDRO_API_KEY"]
def validate_email(email, ip)
response = HTTParty.post(
"https://api.fidro.io/v1/validate",
headers: {
"Authorization" => "Bearer #{FIDRO_API_KEY}",
"Content-Type" => "application/json",
},
body: { email: email, ip: ip }.to_json
)
unless response.success?
raise "Fidro API error: #{response.code} #{response.message}"
end
result = response.parsed_response
puts "Risk score: #{result['data']['risk_score']}"
puts "Recommendation: #{result['data']['recommendation']}"
result
end
# Usage
result = validate_email("test@example.com", "8.8.8.8")
puts result
3. IP Lookup
Send a POST request to Fidro's /v1/ip-lookup endpoint with an IP address. Fidro returns geolocation data (country, city, ISP), VPN and proxy detection, Tor exit node identification, and threat intelligence — all in a single API call.
require "httparty"
FIDRO_API_KEY = ENV["FIDRO_API_KEY"]
def lookup_ip(ip)
response = HTTParty.post(
"https://api.fidro.io/v1/ip-lookup",
headers: {
"Authorization" => "Bearer #{FIDRO_API_KEY}",
"Content-Type" => "application/json",
},
body: { ip: ip }.to_json
)
unless response.success?
raise "Fidro API error: #{response.code} #{response.message}"
end
result = response.parsed_response
puts "Country: #{result['data']['country']}"
puts "Is VPN: #{result['data']['is_vpn']}"
result
end
# Usage
result = lookup_ip("8.8.8.8")
puts result
Next steps
Explore the full API reference, try the free email checker, or see how Fidro compares to other solutions.
Frequently Asked Questions
How do I add fraud detection to Ruby?
Does Fidro have a Ruby SDK?
Is Fidro free to use with Ruby?
Start catching bad signups in the next 5 minutes
Create your account, grab your API key, and send your first request. Free plan with 200 validations/month. No credit card. Cancel anytime.
Get Started Free