pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://www.ip2location.com/documentation/ip2location-libraries/erlang/get-started

on" sizes="180x180" href="https://cdn.ip2location.com/assets/img/apple-touch-icon.png">

Get Started With IP2Location Erlang Module

Dependencies

This library requires IP2Location BIN database to function. You may download the BIN database at


Compilation

erlc ip2location.erl
erlc test.erl

Sample Codes

Query geolocation information from BIN database

You can query the geolocation information from the IP2Location BIN database as below:

-module(test).
-export([testme/0]).

printme(V) ->
 case V of
 {} ->
 io:format("No results.~n", []);
 {ip2locationrecord, Country_short, Country_long, Region, City, Isp, Latitude, Longitude, Domain, Zipcode, Timezone, Netspeed, Iddcode, Areacode, Weatherstationcode, Weatherstationname, Mcc, Mnc, Mobilebrand, Elevation, Usagetype, Addresstype, Category, District, Asn, As} ->
 io:format("Country_short: ~p~n", [Country_short]),
 io:format("Country_long: ~p~n", [Country_long]),
 io:format("Region: ~p~n", [Region]),
 io:format("City: ~p~n", [City]),
 io:format("Isp: ~p~n", [Isp]),
 io:format("Latitude: ~p~n", [Latitude]),
 io:format("Longitude: ~p~n", [Longitude]),
 io:format("Domain: ~p~n", [Domain]),
 io:format("Zipcode: ~p~n", [Zipcode]),
 io:format("Timezone: ~p~n", [Timezone]),
 io:format("Netspeed: ~p~n", [Netspeed]),
 io:format("Iddcode: ~p~n", [Iddcode]),
 io:format("Areacode: ~p~n", [Areacode]),
 io:format("Weatherstationcode: ~p~n", [Weatherstationcode]),
 io:format("Weatherstationname: ~p~n", [Weatherstationname]),
 io:format("Mcc: ~p~n", [Mcc]),
 io:format("Mnc: ~p~n", [Mnc]),
 io:format("Mobilebrand: ~p~n", [Mobilebrand]),
 io:format("Elevation: ~p~n", [Elevation]),
 io:format("Usagetype: ~p~n", [Usagetype]),
 io:format("Addresstype: ~p~n", [Addresstype]),
 io:format("Category: ~p~n", [Category]),
 io:format("District: ~p~n", [District]),
 io:format("Asn: ~p~n", [Asn]),
 io:format("As: ~p~n", [As])
 end,
 io:format("===================================================================~n", []).

testme() ->
 ip2location:new("IPV6-COUNTRY-REGION-CITY-LATITUDE-LONGITUDE-ZIPCODE-TIMEZONE-ISP-DOMAIN-NETSPEED-AREACODE-WEATHER-MOBILE-ELEVATION-USAGETYPE-ADDRESSTYPE-CATEGORY-DISTRICT-ASN.BIN"),
 ip2location:getapiversion(),
 V1 = ip2location:query("8.8.8.8"),
 printme(V1),
 ip2location:close().

IP2Location Sample Database (BIN)

The sample BIN files have a limited scope and are only valid for the following IP ranges:

  1. IPv4 : 0.0.0.0 - 7.255.255.255
  2. IPv6 : 2a04:0000:0000:0000:0000:0000:0000:0000 - 2a04:ffff:ffff:ffff:ffff:ffff:ffff:fff
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy