All Projects → ip2location → Ip2location Go

ip2location / Ip2location Go

Licence: mit
Use IP2Location geolocation database to lookup the geolocation information with IP2Location Go Package. It can be used to determine country, region, city, coordinates, zip code, time zone, ISP, domain name, connection type, area code, weather, MCC, MNC, mobile brand name, elevation and usage type that any IP address or hostname originates from.

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Ip2location Go

ipapi-python
Python bindings for https://ipapi.co (IP Address Location) - Use with python / django / flask for IP address location lookup
Stars: ✭ 42 (-70.42%)
Mutual labels:  geolocation, ip-address
ip2location-nginx
Nginx module that allows user to lookup for geolocation information using IP2Location database.
Stars: ✭ 33 (-76.76%)
Mutual labels:  geolocation, ip-address
Maxminddb Golang
MaxMind DB Reader for Go
Stars: ✭ 319 (+124.65%)
Mutual labels:  geolocation, ip-address
IP2Location-C-Library
IP2Location C library enables the user to find the country, region, city, coordinates, zip code, time zone, ISP, domain name, connection type, area code, weather station code, weather station name, mobile, usage types, etc that any IP address or hostname originates from.
Stars: ✭ 37 (-73.94%)
Mutual labels:  geolocation, ip-address
IP2Location-PHP-Module
This module is a PHP module that enables the user to find the country, region, city, coordinates, zip code, ISP, domain name, timezone, connection speed, IDD code, area code, weather station code, weather station name, mobile, usage types, address type, IAB category, etc that any IP address or host name originates from.
Stars: ✭ 154 (+8.45%)
Mutual labels:  geolocation, ip-address
Geolocate-IP-Browser-Extension
A browser extension, which shows you the origin of your IP address.
Stars: ✭ 21 (-85.21%)
Mutual labels:  geolocation, ip-address
Iplocation
Get ip location information.
Stars: ✭ 70 (-50.7%)
Mutual labels:  geolocation, ip-address
Indoor Navigation Algorithms
This is a public repository of a Navigine company that develops different kinds of indoor positioning algorithms with the main focus on indoor navigation. Here we will step by step publish the source code of our algorithm starting with trilateration.
Stars: ✭ 108 (-23.94%)
Mutual labels:  geolocation
Jpx
JPX - Java GPX library
Stars: ✭ 125 (-11.97%)
Mutual labels:  geolocation
React Native Radar
React Native module for Radar, the leading geofencing and location tracking platform
Stars: ✭ 104 (-26.76%)
Mutual labels:  geolocation
Country Ip Blocks
CIDR country-level IP data, straight from the Regional Internet Registries, updated hourly.
Stars: ✭ 100 (-29.58%)
Mutual labels:  geolocation
Spyme
Rails plugin that stores the browser geolocation
Stars: ✭ 108 (-23.94%)
Mutual labels:  geolocation
Ml Projects
ML based projects such as Spam Classification, Time Series Analysis, Text Classification using Random Forest, Deep Learning, Bayesian, Xgboost in Python
Stars: ✭ 127 (-10.56%)
Mutual labels:  geolocation
Phpipam
phpipam development repository
Stars: ✭ 1,578 (+1011.27%)
Mutual labels:  ip-address
Coregpx
A library for parsing and creation of GPX location files. Purely Swift.
Stars: ✭ 132 (-7.04%)
Mutual labels:  geolocation
Geo ip
Retreive the geolocation of an IP address based on the ipinfodb.com webservice
Stars: ✭ 103 (-27.46%)
Mutual labels:  geolocation
Whereami
📍 Get your geolocation information using freegeoip.app
Stars: ✭ 137 (-3.52%)
Mutual labels:  geolocation
Tzupdate
Set the system timezone based on IP geolocation
Stars: ✭ 130 (-8.45%)
Mutual labels:  geolocation
Gdeltpyr
Python based framework to retreive Global Database of Events, Language, and Tone (GDELT) version 1.0 and version 2.0 data.
Stars: ✭ 124 (-12.68%)
Mutual labels:  geolocation
Fcipaddressgeocoder
iOS Geocoder for geocode device IP Address location using GeoIP service(s) and a block-based syntax. 💻🌍
Stars: ✭ 114 (-19.72%)
Mutual labels:  ip-address

Go Report Card

IP2Location Go Package

This Go package 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, and usage type from IP address by using IP2Location database. This package uses a file based database available at IP2Location.com. 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, and usage type as values. It supports both IP address in IPv4 and IPv6.

This package can be used in many types of projects such as:

  • select the geographically closest mirror
  • analyze your web server logs to determine the countries of your visitors
  • credit card fraud detection
  • software export controls
  • display native language and currency
  • prevent password sharing and abuse of service
  • geotargeting in advertisement

The database will be updated in monthly basis for the greater accuracy. Free LITE databases are available at https://lite.ip2location.com/ upon registration.

The paid databases are available at https://www.ip2location.com under Premium subscription package.

Installation

go get github.com/ip2location/ip2location-go

Example

package main

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

func main() {
	db, err := ip2location.OpenDB("./IP-COUNTRY-REGION-CITY-LATITUDE-LONGITUDE-ZIPCODE-TIMEZONE-ISP-DOMAIN-NETSPEED-AREACODE-WEATHER-MOBILE-ELEVATION-USAGETYPE.BIN")
	
	if err != nil {
		return
	}
	ip := "8.8.8.8"
	results, err := db.Get_all(ip)
	
	if err != nil {
		fmt.Print(err)
		return
	}
	
	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())
	
	db.Close()
}

Dependencies

The complete database is available at https://www.ip2location.com under subscription package.

IPv4 BIN vs IPv6 BIN

Use the IPv4 BIN file if you just need to query IPv4 addresses. Use the IPv6 BIN file if you need to query BOTH IPv4 and IPv6 addresses.

Copyright

Copyright (C) 2020 by IP2Location.com, [email protected]

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].