C Library
PHP Module
Perl Module
Ruby Library
Python Library
Apache Module
Nginx Module
Node.js Module
Cocoa / Objective C Library
Pascal Library
D Library
Go Package
Erlang Module
Haskell Package
Debian Package
Lua Package
Kotlin Module
Scala Library
OpenResty Package
Splunk Add-on
Apache Kafka Transform
OCaml Module
Deno Module
R Package
.NET Component
Java Component
HTTP Module
ActiveX / COM DLL
IP2Location IP Geolocation D Library
This IP Geolocation library is the D programming language library to support all IP2Location™ database products. It has been optimized for speed and memory utilization. Developers can use the module to query all IP2Location™ binary databases for applications written using the D programming language and get IP geolocation information from IP addresses.
"dependencies": {
"ip2location-d": "~master"
}
import std.stdio;
import ip2location : ip2location;
int main() {
string db = "./IPV6-COUNTRY-REGION-CITY-LATITUDE-LONGITUDE-ZIPCODE-TIMEZONE-ISP-DOMAIN-NETSPEED-AREACODE-WEATHER-MOBILE-ELEVATION-USAGETYPE-ADDRESSTYPE-CATEGORY-DISTRICT-ASN.BIN";
ip2location ip2loc = new ip2location(db);
auto results = ip2loc.get_all("8.8.8.8");
writeln("country_short: ", results.country_short);
writeln("country_long: ", results.country_long);
writeln("region: ", results.region);
writeln("city: ", results.city);
writeln("isp: ", results.isp);
writefln("latitude: %f", results.latitude);
writefln("longitude: %f", results.longitude);
writeln("domain: ", results.domain);
writeln("zipcode: ", results.zipcode);
writeln("timezone: ", results.timezone);
writeln("netspeed: ", results.netspeed);
writeln("iddcode: ", results.iddcode);
writeln("areacode: ", results.areacode);
writeln("weatherstationcode: ", results.weatherstationcode);
writeln("weatherstationname: ", results.weatherstationname);
writeln("mcc: ", results.mcc);
writeln("mnc: ", results.mnc);
writeln("mobilebrand: ", results.mobilebrand);
writefln("elevation: %f", results.elevation);
writeln("usagetype: ", results.usagetype);
writeln("addresstype: ", results.addresstype);
writeln("category: ", results.category);
writeln("district: ", results.district);
writeln("asn: ", results.asn);
writeln("as: ", results.as);
writeln("API Version: ", ip2loc.api_version());
ip2loc.close();
return 0;
}
Discover Your User Locations
Retrieve geolocation data for FREE now!