• Your shopping cart is empty!

IP2Location Go Package

This package is the Go 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 Go programming language.

Installation
go get github.com/ip2location/ip2location-go
Sample Codes
package main

import (
	"fmt"
	"github.com/ip2location/ip2location-go"
)

func main() {
	ip2location.Open("./IPV6-COUNTRY-REGION-CITY-LATITUDE-LONGITUDE-ZIPCODE-TIMEZONE-ISP-DOMAIN-NETSPEED-AREACODE-WEATHER-MOBILE-ELEVATION-USAGETYPE.BIN")
	ip := "8.8.8.8"

	results := ip2location.Get_all(ip)

	fmt.Printf("country_short: %s\n", results.Country_short)
	fmt.Printf("country_long: %s\n", results.Country_long)
	fmt.Printf("region: %s\n", results.Region)
	fmt.Printf("city: %s\n", results.City)
	fmt.Printf("isp: %s\n", results.Isp)
	fmt.Printf("latitude: %f\n", results.Latitude)
	fmt.Printf("longitude: %f\n", results.Longitude)
	fmt.Printf("domain: %s\n", results.Domain)
	fmt.Printf("zipcode: %s\n", results.Zipcode)
	fmt.Printf("timezone: %s\n", results.Timezone)
	fmt.Printf("netspeed: %s\n", results.Netspeed)
	fmt.Printf("iddcode: %s\n", results.Iddcode)
	fmt.Printf("areacode: %s\n", results.Areacode)
	fmt.Printf("weatherstationcode: %s\n", results.Weatherstationcode)
	fmt.Printf("weatherstationname: %s\n", results.Weatherstationname)
	fmt.Printf("mcc: %s\n", results.Mcc)
	fmt.Printf("mnc: %s\n", results.Mnc)
	fmt.Printf("mobilebrand: %s\n", results.Mobilebrand)
	fmt.Printf("elevation: %f\n", results.Elevation)
	fmt.Printf("usagetype: %s\n", results.Usagetype)
	fmt.Printf("api version: %s\n", ip2location.Api_version())

	ip2location.Close()
}
Sample IP2Location Databases (BIN)
Sample Packages IPv4 IPV6
IP2Location DB1 Sample BIN File Download (735.91 kB) Download (345.80 kB)
IP2Location DB2 Sample BIN File Download (35.26 MB) Download (364.79 kB)
IP2Location DB3 Sample BIN File Download (19.67 MB) Download (359.00 kB)
IP2Location DB4 Sample BIN File Download (51.91 MB) Download (376.12 kB)
IP2Location DB5 Sample BIN File Download (30.05 MB) Download (365.57 kB)
IP2Location DB6 Sample BIN File Download (61.88 MB) Download (381.61 kB)
IP2Location DB7 Sample BIN File Download (57.75 MB) Download (386.03 kB)
IP2Location DB8 Sample BIN File Download (67.97 MB) Download (391.42 kB)
IP2Location DB9 Sample BIN File Download (34.68 MB) Download (369.72 kB)
IP2Location DB10 Sample BIN File Download (73.33 MB) Download (396.96 kB)
IP2Location DB11 Sample BIN File Download (35.35 MB) Download (370.65 kB)
IP2Location DB12 Sample BIN File Download (73.97 MB) Download (397.86 kB)
IP2Location DB13 Sample BIN File Download (33.75 MB) Download (366.98 kB)
IP2Location DB14 Sample BIN File Download (75.28 MB) Download (398.56 kB)
IP2Location DB15 Sample BIN File Download (38.34 MB) Download (375.29 kB)
IP2Location DB16 Sample BIN File Download (79.85 MB) Download (404.63 kB)
IP2Location DB17 Sample BIN File Download (40.70 MB) Download (376.96 kB)
IP2Location DB18 Sample BIN File Download (86.86 MB) Download (415.69 kB)
IP2Location DB19 Sample BIN File Download (70.67 MB) Download (392.43 kB)
IP2Location DB20 Sample BIN File Download (89.25 MB) Download (416.78 kB)
IP2Location DB21 Sample BIN File Download (41.75 MB) Download (378.10 kB)
IP2Location DB22 Sample BIN File Download (93.15 MB) Download (420.40 kB)
IP2Location DB23 Sample BIN File Download (71.02 MB) Download (393.46 kB)
IP2Location DB24 Sample BIN File Download (94.24 MB) Download (421.48 kB)