class Ipapi::Client

Defined in:

ipapi.cr

Constructors

Instance Method Summary

Constructor Detail

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

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.


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.


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.


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.


def country_area(ip_address : String | Nil = nil) : String #

Retrive area of the country (in sq km) of a specific IP address. If ip_address is nil, use the client's IP.


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.


def country_capital(ip_address : String | Nil = nil) : String #

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


def country_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.


def country_code_iso3(ip_address : String | Nil = nil) : String #

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


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.


def country_population(ip_address : String | Nil = nil) : String #

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


def country_tld(ip_address : String | Nil = nil) : String #

Retrive country specific TLD (top-level domain) of a specific IP address. If ip_address is nil, use the client's IP.


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.


def currency_name(ip_address : String | Nil = nil) : String #

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


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.


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.


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.


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.


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.


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.


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.


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.


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.


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.


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.


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.


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.