![]() To install this module type the following (for PyPI): pip install IP2Location ![]() The library reads the geo location information from IP2Location BIN data file. If (("response" in result) & (result.This is a IP2Location Python library that enables the user to find the country, region or state, city, latitude and longitude, ZIP code, time zone, Internet Service Provider (ISP) or company name, domain name, net speed, area code, weather station code, weather station name, mobile country code (MCC), mobile network code (MNC) and carrier brand, elevation, usage type, address type and IAB category by IP address or hostname originates from. addon and lang to get more data and translation (leave both blank if you don't need them)Īuto addon = "continent,country,region,city,geotargeting,country_groupings,time_zone_info" Īuto result = ws.lookup(ip, addon, lang) Import ip2locationwebservice : ip2locationwebservice This method returns the web service credit balance in an object. countrygroupingstime zoneinfoolsoncurrent time.numericcodedemonymflagcapitaltotal area.addresstypecategorycontinentnamecodehemispheretranslationscountrynamealpha3 code.This method returns an object containing the geolocation info. QUERY USING THE IP2LOCATION WEB SERVICE Methodsģ input parameters:IP2Location API Key.Package (WS1 - WS25)Use HTTPS or HTTP Writeln("API Version: ", ip2loc.api_version()) Writeln("addresstype: ", results.addresstype) Writefln("elevation: %f", results.elevation) Writeln("mobilebrand: ", results.mobilebrand) Writeln("weatherstationname: ", results.weatherstationname) Writeln("weatherstationcode: ", results.weatherstationcode) Writefln("longitude: %f", results.longitude) Writefln("latitude: %f", results.latitude) Ip2location ip2loc = new ip2location(db) Īuto results = ip2loc.get_all("8.8.8.8") String db = "./IPV6-COUNTRY-REGION-CITY-LATITUDE-LONGITUDE-ZIPCODE-TIMEZONE-ISP-DOMAIN-NETSPEED-AREACODE-WEATHER-MOBILE-ELEVATION-USAGETYPE-ADDRESSTYPE-CATEGORY-DISTRICT-ASN.BIN" Returns the geolocation information in an object. Use the IPv6 BIN file if you need to query BOTH IPv4 and IPv6 addresses.īelow are the methods supported in this library. Use the IPv4 BIN file if you just need to query IPv4 addresses. IP2Location Commercial BIN Data (Comprehensive):.This library requires IP2Location BIN data file to function. If you don't have an existing API key, you can subscribe for one at the below: ![]() The paid databases are available at under Premium subscription package.Īs an alternative, this library can also call the IP2Location Web Service. Free LITE databases are available at upon registration. The database will be updated on a monthly basis for greater accuracy. prevent password sharing and abuse of service.analyze your web server logs to determine the countries of your visitors.select the geographically closest mirror.This library can be used in many types of projects such as: It supports both IP address in IPv4 and IPv6. 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, station name, mcc, mnc, mobile brand, elevation, usage type, address type, IAB category, district, autonomous system number (ASN) and autonomous system (AS) as values. This library uses a file based database available at. This D library 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, station name, mcc, mnc, mobile brand, elevation, usage type, address type and IAB category from IP address by using IP2Location database. ![]()
0 Comments
Leave a Reply. |