Project

ip-api-io

0.0
The project is in a healthy, maintained state
Ruby client for the ip-api.io IP intelligence platform: IP geolocation, email validation (syntax, MX, SMTP deliverability), fraud detection and risk scoring, VPN/proxy/Tor detection, ASN lookup, WHOIS, reverse/forward DNS and domain age. Zero runtime dependencies.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 5.25
~> 13.0
~> 3.24
 Project Readme

ip-api-io — Official Ruby client for ip-api.io

Gem Version test License: MIT

The official Ruby client for the ip-api.io IP intelligence platform. One client covers IP geolocation, email validation and verification (syntax, MX, SMTP deliverability), fraud detection and risk scoring, VPN/proxy/Tor detection, disposable email detection, ASN lookup, WHOIS, reverse DNS, MX records and domain age.

Zero runtime dependencies — pure standard library.

Install

gem install ip-api-io

or in your Gemfile:

gem "ip-api-io"

Quickstart

require "ip-api-io"

client = IpApiIo::Client.new(api_key: "YOUR_API_KEY") # free key at https://ip-api.io

# Where is this IP, and is it risky?
info = client.lookup("8.8.8.8")
puts info["location"]["country"]            # "United States"
puts info["suspicious_factors"]["is_vpn"]   # false

risk = client.risk_score("8.8.8.8")
puts "#{risk['score']} #{risk['risk_level']}" # 0 low

email = client.validate_email("user@example.com")
puts "#{email['reachable']} #{email['disposable']}" # yes false

An API key is required — the API rejects keyless requests with 401. Sign up at ip-api.io for a free key.

Documentation

Each guide documents the methods for one capability, with runnable examples and a link to the matching ip-api.io product page:

Methods

Every method maps to one ip-api.io endpoint and its product page:

Method Endpoint Product page
lookup(ip = nil) GET /api/v1/ip[/{ip}] IP geolocation
lookup_batch(ips) POST /api/v1/ip/batch (≤100 IPs) Bulk IP lookup
email_info(email) GET /api/v1/email/{email} Email validation
validate_email(email) GET /api/v1/email/advanced/{email} Advanced email validation
validate_email_batch(emails) POST /api/v1/email/advanced/batch (≤100) Email list cleaning
risk_score(ip = nil) GET /api/v1/risk-score[/{ip}] Risk score
email_risk_score(email) GET /api/v1/risk-score/email/{email} Fraud detection
ip_reputation(ip) GET /api/v1/ip-reputation/{ip} IP reputation
tor_check(ip) GET /api/v1/tor/{ip} Tor detection
asn(ip) GET /api/v1/asn/{ip} ASN lookup
whois(domain) GET /api/v1/dns/whois/{domain} WHOIS lookup
reverse_dns(ip) GET /api/v1/dns/reverse/{ip} Reverse DNS
forward_dns(hostname) GET /api/v1/dns/forward/{hostname}
mx_records(domain) GET /api/v1/dns/mx/{domain} MX record lookup
domain_age(domain) GET /api/v1/domain/age/{domain} Domain age checker
domain_age_batch(domains) POST /api/v1/domain/age/batch Domain age checker
rate_limit GET /api/v1/ratelimit
usage_summary GET /api/v1/usage/summary

All methods return parsed JSON as plain Hashes.

Error handling

The client raises typed errors and never retries — on 429, RateLimitError#reset tells you when your quota renews:

begin
  client.lookup("8.8.8.8")
rescue IpApiIo::RateLimitError => e
  puts "limit=#{e.limit} remaining=#{e.remaining} resets_at=#{e.reset}"
rescue IpApiIo::AuthenticationError
  puts "invalid API key"
end

See docs/error-handling.md for the full error taxonomy.

Links


ip-api-io is the official client for ip-api.io. It is not affiliated with ip-api.com or ipapi.com.