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 Lua Package
This IP Geolocation package is the Lua programming language package 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 Lua programming language.
luarocks install ip2location
ip2location = require('ip2location')
local ip2loc = ip2location:new('IP-COUNTRY-REGION-CITY-LATITUDE-LONGITUDE-ZIPCODE-TIMEZONE-ISP-DOMAIN-NETSPEED-AREACODE-WEATHER-MOBILE-ELEVATION-USAGETYPE-ADDRESSTYPE-CATEGORY-DISTRICT-ASN.BIN')
local result = ip2loc:get_all('8.8.8.8')
print("country_short: " .. result.country_short)
print("country_long: " .. result.country_long)
print("region: " .. result.region)
print("city: " .. result.city)
print("isp: " .. result.isp)
print("latitude: " .. result.latitude)
print("longitude: " .. result.longitude)
print("domain: " .. result.domain)
print("zipcode: " .. result.zipcode)
print("timezone: " .. result.timezone)
print("netspeed: " .. result.netspeed)
print("iddcode: " .. result.iddcode)
print("areacode: " .. result.areacode)
print("weatherstationcode: " .. result.weatherstationcode)
print("weatherstationname: " .. result.weatherstationname)
print("mcc: " .. result.mcc)
print("mnc: " .. result.mnc)
print("mobilebrand: " .. result.mobilebrand)
print("elevation: " .. result.elevation)
print("usagetype: " .. result.usagetype)
print("addresstype: " .. result.addresstype)
print("category: " .. result.category)
print("district: " .. result.district)
print("asn: " .. result.asn)
print("as: " .. result.as)
ip2loc:close()
Discover Your User Locations
Retrieve geolocation data for FREE now!