IP Blacklist Lookup API - Ruby Gem

IP Blacklist Lookup checks whether a given IP address appears on known malicious IP blocklists. Identifies both inbound threats (attackers, spammers) and outbound threats (C2 servers, malware hosts).

Installation

Add this line to your application's Gemfile:

gem 'apiverve_ipblacklistlookup'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install apiverve_ipblacklistlookup

Getting Started

Get your API key at APIVerve

Basic Usage

require 'apiverve_ipblacklistlookup'

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

# Make a request
response = client.execute({ ip: "185.220.101.1" })

# Print the response
puts response

Error Handling

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

Debug Mode

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

Example Response

{
  "status": "ok",
  "error": null,
  "data": {
    "ipAddress": "185.220.101.1",
    "isIPBlacklisted": true,
    "inbound": {
      "found": true,
      "description": "IP is known for malicious inbound activity (spam, scanning, brute-force attacks)"
    },
    "outbound": null,
    "threatLevel": "high",
    "ipDetails": {
      "ip": "185.220.101.1",
      "country": "DE",
      "region": "BY",
      "timezone": "Europe/Berlin",
      "city": "Nuremberg",
      "coordinates": [
        49.4478,
        11.0683
      ],
      "countryName": "Germany",
      "regionName": "Bavaria",
      "postalCode": "90403",
      "continent": "EU",
      "continentName": "Europe",
      "accuracyRadius": 20
    }
  }
}

Documentation

For more information, visit the API Documentation.

Support

License

This gem is available under the MIT License.