Disposable Phone Number Checker API - Ruby Gem

Disposable Phone Number Checker is an API that checks whether a given phone number is a known disposable or temporary number. Useful for fraud prevention, user verification, and security.

Installation

Add this line to your application's Gemfile:

gem 'apiverve_disposablephone'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install apiverve_disposablephone

Getting Started

Get your API key at APIVerve

Basic Usage

require 'apiverve_disposablephone'

# Initialize the client
client = APIVerve::Disposablephone::Client.new(api_key: "YOUR_API_KEY")

# Make a request
response = client.execute({ phone: "+12085813945" })

# Print the response
puts response

Error Handling

begin
  response = client.execute({ phone: "+12085813945" })
  puts response["data"]
rescue APIVerve::Disposablephone::ValidationError => e
  puts "Validation error: #{e.errors.join(', ')}"
rescue APIVerve::Disposablephone::APIError => e
  puts "API error: #{e.message}"
  puts "Status code: #{e.status_code}"
end

Debug Mode

# Enable debug logging
client = APIVerve::Disposablephone::Client.new(
  api_key: "YOUR_API_KEY",
  debug: true
)

Example Response

{
  "status": "ok",
  "error": null,
  "data": {
    "phone": "+12085813945",
    "isDisposable": true,
    "firstSeen": "2024-01-30"
  }
}

Documentation

For more information, visit the API Documentation.

Support

License

This gem is available under the MIT License.