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 | Nil = nil) : String #

Retrive autonomous system number of a specific IP address. If ip_address is nil, use the client's IP.


[View source]
def city(ip_address : String | Nil = nil) : String #

Retrive city name of a specific IP address. If ip_address is nil, use the client's IP.


[View source]
def continent_code(ip_address : String | Nil = nil) : String #

Retrive country code (2 letter, ISO 3166-1 alpha-2) of a specific IP address. If ip_address is nil, use the client's IP.


[View source]
def country(ip_address : String | Nil = nil) : String #

Retrive country code (2 letter, ISO 3166-1 alpha-2) of a specific IP address. If ip_address is nil, use the client's IP.


[View source]
def country_calling_code(ip_address : String | Nil = nil) : String #

Retrive country calling code (dial in code, comma separated) of a specific IP address. If ip_address is nil, use the client's IP.


[View source]
def country_name(ip_address : String | Nil = nil) : String #

Retrive short country name of a specific IP address. If ip_address is nil, use the client's IP.


[View source]
def currency(ip_address : String | Nil = nil) : String #

Retrive currency code (ISO 4217) of a specific IP address. If ip_address is nil, use the client's IP.


[View source]
def in_eu(ip_address : String | Nil = nil) : String #

Retrive whether IP address belongs to a country that is a member of the European Union (EU) of a specific IP address. If ip_address is nil, use the client's IP.


[View source]
def ip(ip_address : String | Nil = nil) : String #

Retrive public (external) IP address (same as URL #ip) of a specific IP address. If ip_address is nil, use the client's IP.


[View source]
def languages(ip_address : String | Nil = nil) : String #

Retrive languages spoken (comma separated 2 or 3 letter ISO 639 code with optional hyphen separated country suffix) of a specific IP address. If ip_address is nil, use the client's IP.


[View source]
def latitude(ip_address : String | Nil = nil) : String #

Retrive latitude of a specific IP address. If ip_address is nil, use the client's IP.


[View source]
def latlong(ip_address : String | Nil = nil) : String #

Retrive comma separated latitude and longitude of a specific IP address. If ip_address is nil, use the client's IP.


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

Retrive the location of a specific IP address. If ip_address is nil, use the client's IP.


[View source]
def longitude(ip_address : String | Nil = nil) : String #

Retrive longitude of a specific IP address. If ip_address is nil, use the client's IP.


[View source]
def org(ip_address : String | Nil = nil) : String #

Retrive organization name of a specific IP address. If ip_address is nil, use the client's IP.


[View source]
def postal(ip_address : String | Nil = nil) : String #

Retrive postal code / zip code of a specific IP address. If ip_address is nil, use the client's IP.


[View source]
def region(ip_address : String | Nil = nil) : String #

Retrive region name (administrative division) of a specific IP address. If ip_address is nil, use the client's IP.


[View source]
def region_code(ip_address : String | Nil = nil) : String #

Retrive region code of a specific IP address. If ip_address is nil, use the client's IP.


[View source]
def timezone(ip_address : String | Nil = nil) : String #

Retrive timezone (IANA format i.e. “Area/Location”) of a specific IP address. If ip_address is nil, use the client's IP.


[View source]
def utc_offset(ip_address : String | Nil = nil) : String #

Retrive UTC offset (with daylight saving time) as +HHMM or -HHMM (HH is hours, MM is minutes) of a specific IP address. If ip_address is nil, use the client's IP.


[View source]