class Ipapi::Client

Defined in:

ipapi.cr

Constant Summary

API_URL = "https://ipapi.co/"

Constructors

Instance Method Summary

Constructor Detail

def self.new(api_key : String | Nil = nil) #

[View source]

Instance Method Detail

def asn(ip_address : String) : String #

Retrive autonomous system number for an IP address


[View source]
def asn : String #

Retrive autonomous system number


[View source]
def city(ip_address : String) : String #

Retrive city name for an IP address


[View source]
def city : String #

Retrive city name


[View source]
def continent_code(ip_address : String) : String #

Retrive country code (2 letter, ISO 3166-1 alpha-2) for an IP address


[View source]
def continent_code : String #

Retrive country code (2 letter, ISO 3166-1 alpha-2)


[View source]
def country(ip_address : String) : String #

Retrive country code (2 letter, ISO 3166-1 alpha-2) for an IP address


[View source]
def country : String #

Retrive country code (2 letter, ISO 3166-1 alpha-2)


[View source]
def country_calling_code(ip_address : String) : String #

Retrive country calling code (dial in code, comma separated) for an IP address


[View source]
def country_calling_code : String #

Retrive country calling code (dial in code, comma separated)


[View source]
def country_name(ip_address : String) : String #

Retrive short country name for an IP address


[View source]
def country_name : String #

Retrive short country name


[View source]
def currency(ip_address : String) : String #

Retrive currency code (ISO 4217) for an IP address


[View source]
def currency : String #

Retrive currency code (ISO 4217)


[View source]
def in_eu(ip_address : String) : String #

Retrive whether IP address belongs to a country that is a member of the European Union (EU) for an IP address


[View source]
def in_eu : String #

Retrive whether IP address belongs to a country that is a member of the European Union (EU)


[View source]
def ip(ip_address : String) : String #

Retrive public (external) IP address (same as URL #ip) for an IP address


[View source]
def ip : String #

Retrive public (external) IP address (same as URL #ip)


[View source]
def languages(ip_address : String) : String #

Retrive languages spoken (comma separated 2 or 3 letter ISO 639 code with optional hyphen separated country suffix) for an IP address


[View source]
def languages : String #

Retrive languages spoken (comma separated 2 or 3 letter ISO 639 code with optional hyphen separated country suffix)


[View source]
def latitude(ip_address : String) : String #

Retrive latitude for an IP address


[View source]
def latitude : String #

Retrive latitude


[View source]
def latlong(ip_address : String) : String #

Retrive comma separated latitude and longitude for an IP address


[View source]
def latlong : String #

Retrive comma separated latitude and longitude


[View source]
def locate(ip_address : String) : Location | Nil #

Location of a specific IP


[View source]
def locate : Location | Nil #

Location of client’s IP


[View source]
def longitude(ip_address : String) : String #

Retrive longitude for an IP address


[View source]
def longitude : String #

Retrive longitude


[View source]
def org(ip_address : String) : String #

Retrive organization name for an IP address


[View source]
def org : String #

Retrive organization name


[View source]
def postal(ip_address : String) : String #

Retrive postal code / zip code for an IP address


[View source]
def postal : String #

Retrive postal code / zip code


[View source]
def region(ip_address : String) : String #

Retrive region name (administrative division) for an IP address


[View source]
def region : String #

Retrive region name (administrative division)


[View source]
def region_code(ip_address : String) : String #

Retrive region code for an IP address


[View source]
def region_code : String #

Retrive region code


[View source]
def timezone(ip_address : String) : String #

Retrive timezone (IANA format i.e. “Area/Location”) for an IP address


[View source]
def timezone : String #

Retrive timezone (IANA format i.e. “Area/Location”)


[View source]
def utc_offset(ip_address : String) : String #

Retrive UTC offset (with daylight saving time) as +HHMM or -HHMM (HH is hours, MM is minutes) for an IP address


[View source]
def utc_offset : String #

Retrive UTC offset (with daylight saving time) as +HHMM or -HHMM (HH is hours, MM is minutes)


[View source]