ip2location-8.4.0: IP2Location Haskell package for IP geolocation.
Copyright(c) IP2Location 2021
LicenseMIT
Maintainersales@ip2location.com
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

IP2Location

Description

This Haskell package provides a fast lookup of country, region, city, latitude, longitude, ZIP code, time zone, ISP, domain name, connection type, IDD code, area code, weather station code, weather station name, mcc, mnc, mobile brand, elevation, usage type, address type and IAB category from IP address by using IP2Location database. This package uses a file based database available at IP2Location.com. This database simply contains IP blocks as keys, and other information such as country, region, city, latitude, longitude, ZIP code, time zone, ISP, domain name, connection type, IDD code, area code, weather station code, weather station name, mcc, mnc, mobile brand, elevation, usage type, address type and IAB category as values. It supports both IP addresses in IPv4 and IPv6.

IP2Location LITE BIN databases are available for free at http://lite.ip2location.com/

Synopsis

Documentation

data Meta Source #

Contains the BIN database file metadata.

Instances

Instances details
Show Meta Source # 
Instance details

Defined in IP2Location

Methods

showsPrec :: Int -> Meta -> ShowS #

show :: Meta -> String #

showList :: [Meta] -> ShowS #

data IP2LocationRecord Source #

Contains geolocation results.

Constructors

IP2LocationRecord 

Fields

Instances

Instances details
Show IP2LocationRecord Source # 
Instance details

Defined in IP2Location

getAPIVersion :: String Source #

The getAPIVersion function returns a string containing the API version.

doInit :: String -> IO Meta Source #

The doInit function returns the Meta record containing metadata from the BIN database file. It takes one argument, of type String, which is the path to the BIN database file.

doQuery :: String -> Meta -> String -> IO IP2LocationRecord Source #

The doQuery function returns an IP2LocationRecord containing geolocation data for an IP address. It takes 3 arguments; the BIN database file path (String), the metadata from doInit function (Meta record) & either IPv4 or IPv6 address (String).