Ruby SDK
- Source: lavrox/SDK-IPWho-IP-Geolocation-Ruby
- RubyGems:
ipwho1.0.0 - API key: ipwho.org/free-plan
Installation
Section titled “Installation”gem install ipwhogem "ipwho"Ruby >= 2.5, Faraday. Client: IpwhoApi::Client.
Quick start
Section titled “Quick start”require "ipwho"
client = IpwhoApi::Client.new(ENV.fetch("IPWHO_API_KEY"))
res = client.lookup("8.8.8.8") # GET /ip/{ip}me = client.me # GET /mebulk = client.bulk(["8.8.8.8", "1.1.1.1"]) # GET /bulk/{a,b,c}
puts res.data.geoLocation.country # United States