V
VeriShield EDGE
Get API Key →
Verified by VeriShield SecOps • Updated 2026-11-13

Ruby on Rails Validator Email Verification Guide

Add real-time email verification and disposable-email blocking to Ruby on Rails Validator with the VeriShield Edge API. The snippet below gates a signup and returns the canonical email identity.

Language
Ruby 3.3
Ecosystem
Rails / ActiveModel
Latency
< 85ms

Install

Shell
gem install httparty

Verification code

Ruby 3.3
class VerishieldEmailValidator < ActiveModel::EachValidator
  def validate_each(record, attribute, value)
    resp = HTTParty.post('https://verishield-edge-api.p.rapidapi.com/v1/verify',
      headers: { 'X-RapidAPI-Key' => ENV['RAPIDAPI_KEY'] },
      body: { email: value }.to_json,
      timeout: 3)
    if resp.parsed_response['fraud_risk']['recommendation'] == 'BLOCK'
      record.errors.add(attribute, 'is a disposable or high-risk address')
    end
  end
end

What this protects against

Disposable and temporary inboxes, Gmail dot-trick and plus-alias multi-accounting, high-entropy bot usernames, and freshly registered fraud domains. The API returns a 0-100 fraud score with an ALLOW, CHALLENGE_2FA or BLOCK recommendation.

Related Domain Reports