IP2Location R API

IP2Location Class

get_all(ip_address)

Retrieve geolocation information for an IP address.

Parameters:

ip_address (str) – (Required) The IP address (IPv4 or IPv6).

Returns:

Returns the geolocation information. Refer below table for the fields avaliable.

RETURN FIELDS

Field Name

Description

country_short

Two-character country code based on ISO 3166.

country_long

Country name based on ISO 3166.

region

Region or state name.

city

City name.

isp

Internet Service Provider or company’s name.

latitude

City latitude. Defaults to capital city latitude if city is unknown.

longitude

City longitude. Defaults to capital city longitude if city is unknown.

domain

Internet domain name associated with IP address range.

zipcode

ZIP code or Postal code. 172 countries supported.

timezone

UTC time zone (with DST supported).

netspeed

Internet connection type.

idd_code

The IDD prefix to call the city from another country.

area_code

A varying length number assigned to geographic areas for calls between cities. 223 countries supported.

weather_code

The special code to identify the nearest weather observation station.

weather_name

The name of the nearest weather observation station.

mcc

Mobile Country Codes (MCC) as defined in ITU E.212 for use in identifying mobile stations in wireless telephone networks, particularly GSM and UMTS networks.

mnc

Mobile Network Code (MNC) is used in combination with a Mobile Country Code(MCC) to uniquely identify a mobile phone operator or carrier.

mobile_brand

Commercial brand associated with the mobile carrier. You may click mobile carrier coverage to view the coverage report.

elevation

Average height of city above sea level in meters (m).

usage_type

Usage type classification of ISP or company.

address_type

IP address types as defined in Internet Protocol version 4 (IPv4) and Internet Protocol version 6 (IPv6).

category

The domain category based on IAB Tech Lab Content Taxonomy.

district

District or county name.

asn

Autonomous system number (ASN). BIN databases.

as_name

Autonomous system (AS) name.

plot_map(ipaddresses_vector)

Plot the country on the map based on IP addresses and its IP2Location country data.

Parameters:

ipaddresses_vector (vector) – (Required) A vector of IP addresses to be plot on.

Returns:

Returns the map image with the IP addresses plotted.