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

IP2LocationWebService

Description

This Haskell package allows users to query an IP address to get geolocation info.

IP2Location Web Service API subscription at https://www.ip2location.com/web-service/ip2location

Synopsis

Documentation

data WSResult Source #

Contains the web service results.

Constructors

WSResult 

Fields

Instances

Instances details
Eq WSResult Source # 
Instance details

Defined in IP2LocationWebService

Show WSResult Source # 
Instance details

Defined in IP2LocationWebService

ToJSON WSResult Source # 
Instance details

Defined in IP2LocationWebService

FromJSON WSResult Source # 
Instance details

Defined in IP2LocationWebService

data WSConfig Source #

Contains the web service configuration.

Instances

Instances details
Show WSConfig Source # 
Instance details

Defined in IP2LocationWebService

openWS :: String -> String -> Bool -> IO WSConfig Source #

The openWS function initializes the web service configuration. It takes 3 arguments; the web service API key, the API package to call & whether to use SSL.

lookUp :: WSConfig -> String -> IO WSResult Source #

The lookUp function returns an WSResult containing geolocation data for an IP address It takes 2 arguments; the web service configuration from openWS function (WSConfig record), either IPv4 or IPv6 address (String)

getCredit :: WSConfig -> IO String Source #

The getCredit function returns an IO String containing web service credit balance for the API key. It takes 1 argument; the web service configuration from openWS function (WSConfig record).