Back to Blog
Ip2location free database6/11/2023 ![]() 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. Print_r( IP2LocationLaravel:: expandIpv6( '2002::1234:FFFF:FFFF:FFFF:FFFF')) echo '' 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. Print_r( IP2LocationLaravel:: decimalToIpv4( 134744072)) echo '' Print_r( IP2LocationLaravel:: ipv4ToDecimal( '8.8.8.8')) echo '' Add the following line into the routes/web.php file.Create a TestController in Laravel using the below command lineĮcho 'IP Version : '.Rename the BIN file to IP2LOCATION.BIN.Unzip and copy the BIN file into database/ip2location/ folder.To use IP2Location databases, create a folder named as ip2location in the database directory.This section will explain how to use this extension to query from BIN database and web service. IP2Location Laravel extension is able to query the IP address information from either BIN database or web service. Run the command: composer require ip2location/ip2location-laravel to download the package into the Laravel platform. Note: This extension works in Laravel 6, Laravel 7, Laravel 8 and Laravel 9. It has been optimized for speed and memory utilization. IP2Location Laravel extension enables the user to find the country, region, city, coordinates, zip code, time zone, ISP, domain name, connection type, area code, weather, MCC, MNC, mobile brand name, elevation, usage type, IP address type and IAB advertising category from IP address using IP2Location database.
0 Comments
Read More
Leave a Reply. |