geoIP: ipListLookup

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/geoIP.R

Description

Implements a lookup using the InfoDB API to determine point coordinates for a given ip address. There is a package dependency here for rjson and you must have this. Also, you should get your own API code and supplement it for the one used here. See Details Section.

Usage

1
geoIP(x)

Arguments

x

x is the ip address in ipV4 format

Details

The lookup here is performed by using the InfoDB ip lookup page at http://ipinfodb.com/ via API call to http which is structured as follows:
PATTERN: http://api.ipinfodb.com/v3/ip-city/?key=YOUR_API_KEY&ip=XXX.XXX.XXX.XXX&format=json
You can get your own API key, (yes, it's free), and supplement it into the code for the geoIP function at http://ipinfodb.com/ip_location_api.php. The data will be returned in a JSON document on a page which is ingested.

Value

A list is returned containing the following elements:

ipaddress

Input ip address.

statusCode

Returned status code from lookup.

latitude

Point coordinate - latitude.

longitude

Point coordinate - longitude.

statusMessage

Returned status message from lookup.

countryCode

Country code from ip lookup.

countryName

Country name from ip lookup.

regionName

State/region/province from ip lookup.

cityName

City from ip lookup.

zipCode

Postal code from ip lookup.

timeZone

Timezone from ip lookup.

Author(s)

Randall Shane, PhD
rshane@basexvi.com

References

http://ipinfodb.com/ip_location_api.php

See Also

ipListLookup, geoPlot

Examples

1
2
x <- "38.122.8.198"
geoIP(x)

RandallShanePhD/geoPlot documentation built on May 18, 2019, 1:34 p.m.