Use geoip database and API for geographic location query

Source: Internet
Author: User
Tags geoip geoip database maxmind

There are many databases for geographic location query, most of which are available in free versions. There are pure databases in China, but they only provide the geographical location information of text and do not provide latitude and longitude data. Foreign geoip databases include maxmind and ip2location databases which provide latitude and longitude data. This article briefly introduces the geoip of maxmind, which is used for national queries.

First, download the required resources from the maxmind official website.

Geoip Database: http://geolite.maxmind.com/download/geoip/database/geolitecountry/geoip.dat.gz. After the download, decompress it to drive D. For more information about the installation documentation, see geoip city database installation instructions.

Maxmind provides a variety of API interfaces, such as Perl, Java, Python, C, PHP, C #, etc. Here we use C # (https://github.com/maxmind/geoip-api-csharp2), this library is written using mono, download the package to Visual Studio.

Related Materials

AWStats display country-region plug-in geoip Installation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.