Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

ip to location database by ASN, GeoFeed, Whois, iptoasn.com, db-ip lite, GeoLite2

NotificationsYou must be signed in to change notification settings

sapics/ip-location-db

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This project provides IP to location databases in CSV and MMDB formats.

There are 3 types of IP database in this repository:country,city andasn files. All have their own standard format.

Country

ip_range_start, ip_range_end, country_code
DatabaseTypeLicenseUpdatedIPv4IPv6IPv4+IPV6IPv4-numIPv6-num
ASN

npm version
npm version
CountryCC0DailyCSV
MMDB
CSV
MMDB
MMDBCSVCSV
GeoFeed + ASN

npm version
npm version
CountryCC0DailyCSV
MMDB
CSV
MMDB
MMDBCSVCSV
GeoFeed + Whois + ASN

npm version
npm version
CountryCC0DailyCSV
MMDB
CSV
MMDB
MMDBCSVCSV
IPtoASN

npm version
npm version
CountryPDDL byIPtoASNDailyCSV
MMDB
CSV
MMDB
CSVCSV
IPLocate

npm version
npm version
CountryCC BY SA 4.0 byIPLocateDailyCSV
MMDB
CSV
MMDB
MMDBCSVCSV
DB-IP Lite

npm version
CountryCC BY 4.0
byDB-IP
MonthlyCSV
MMDB
CSV
MMDB
CSVCSV
DB-IP Lite + GeoFeed + Whois + ASN

npm version
CountryCC BY 4.0
byDB-IP
MonthlyCSV
MMDB
CSV
MMDB
MMDBCSVCSV
GeoLite2

npm version
npm version
CountryGeoLite2 License byMaxMindTwice weeklyCSV
MMDB
CSV
MMDB
CSVCSV
GeoLite2 + GeoFeed + Whois + ASN

npm version
npm version
CountryGeoLite2 License byMaxMindDailyCSV
MMDB
CSV
MMDB
MMDBCSVCSV

City

ip_range_start, ip_range_end, country_code, state1, state2, city, postcode, latitude, longitude, timezone
DatabaseTypeLicenseUpdatedIPv4IPv6IPv4+IPV6IPv4-numIPv6-num
DB-IP Lite

npm version
npm version
npm version
CityCC BY 4.0
byDB-IP
MonthlyCSV.gz
CSV.7z
MMDB
CSV.gz
CSV.7z
MMDB
CSV.gz
CSV.7z
CSV.gz
CSV.7z
GeoLite2

npm version
npm version
npm version
CityGeoLite2 License byMaxMindTwice weeklyCSV.gz
CSV.7z
MMDB
CSV.gz
CSV.7z
MMDB
CSV.gz
CSV.7z
CSV.gz
CSV.7z

ASN

ip_range_start, ip_range_end, autonomous_system_number, autonomous_system_organization
DatabaseTypeLicenseUpdatedIPv4IPv6IPv4+IPV6IPv4-numIPv6-num
RouteViews + ASN + DB-IP

npm version
npm version
ASNCC BY 4.0 byRouteViews andDB-IPDailyCSV
MMDB
CSV
MMDB
MMDBCSVCSV
IPtoASN

npm version
npm version
ASNPDDL byIPtoASNDailyCSV
MMDB
CSV
MMDB
CSVCSV
IPLocate

npm version
npm version
ASNCC BY SA 4.0 byIPLocateDailyCSV
MMDB
CSV
MMDB
MMDBCSVCSV
DB-IP Lite

npm version
npm version
ASNCC BY 4.0
byDB-IP
MonthlyCSV
MMDB
CSV
MMDB
CSVCSV
GeoLite2

npm version
npm version
ASNGeoLite2 License byMaxMindTwice weeklyCSV
MMDB
CSV
MMDB
MMDBCSVCSV

File formats

An explanation of each file format is provided in its own directory.

All files of a given type share the same file format; for example, you could swap oneasn file for any otherasn file.

Databases referenced in this project

ASN database [Update: Daily]

Created by merging 5 RIP (afrinic,apnic,arin,lacnic,ripe ncc) IP-ASN-Country database.ASN (Autonomous System Number) is a unique number assigned to an Autonomous System (AS) by theIANA.

Whois dastabase [Update: Daily]

Created by merging 5 RIP (afrinic,apnic,arin,lacnic,ripe ncc) providedWHOIS database.

GeoFeed database [Update: Daily]

Created by merging GeoFeed database fromOpenGeoFeed andCollections of provider geofeed and so on.

RouteViews database [Update: every 2 hours]

We are using this database to get AS number from ipv4 address forasn.This is licensed under aCC BY 4.0, so,you must create attribution toRouteViews for using asn database.

IPtoASN database [Update: Hourly]

You can download hourly updated database in tsv format fromoriginal site.This is licensed under aPublic Domain Dedication and License v1.0.There are some differences from aboveASN database.

IPLocate database [Update: Daily]

You can download the original databases and read license from github repositoryiplocate/ip-address-databases.

These databases are licensed under aCC BY SA 4.0, soyou must give appropriate credit by providing a link toIPLocate.io on your application, product, or website where the data is used.

If you need more detailed information (ex. City Name/Latitude/Longitude/etc.), please use thepremium databases.

DB-IP database [Update: Monthly]

You could download and read the license fromip-to-asn-lite orip-to-country-lite orip-to-city-lite.Most of the AS Organization name used inasn usesip-to-asn-lite database.We also useip-to-asn-lite to get AS Number from ip address as a supplemental.

These database are licensed under aCC BY 4.0, so,you must create attribution toDB-IP.com for using DB-IP database.
In the case of a web application, you must include a link back to DB-IP.com on pages that display or use results from the database. You may do it by pasting the HTML code snippet into your code:<a href='https://db-ip.com/'>IP Geolocation by DB-IP</a>.
If you need better accuracy or no attribution or daily updates, please use theCommercial Version of db-ip.

GeoLite2 database [Update: Twice weekly]

GeoLite2 is created byMaxMind.The license of GeoLite2 is written in GEOLITE2_LICENSE and End User License Agreement (EULA) is written in GEOLITE2_EULA.Please carefully read the GEOLITE2_LICENSE and GEOLITE2_EULA files, if you use these database.This package comes with certain restrictions and obligations, most notably:

  • You cannot prevent the library from updating the databases.
  • You cannot use the GeoLite2 data:
    • for FCRA purposes,
    • to identify specific households or individuals.

You can readthe latest version of GeoLite2 EULA.GeoLite2 databse is provided underCC BY-SA 4.0 byMaxMind, so,you must create attribution toMaxMind for using GeoLite2 database.If you need better accuracy, please use the commercial versionGeoIp2.

Which database should I use?

It depends upon your use-case! We do have some simple recommendations though:

  • If you need postcodes or timezones:geolite2-city
  • If you need city data with a CC-BY Licence:dbip-city
  • If you need a country database with a Public Domain Licence:geo-whois-asn-country
  • If you need a high accuracy and wide IP range country database:geolite2-geo-whois-asn-country which is equivalent togeolite2-country forgeolite2-country covered IP range andgeo-whois-asn-country for the other IP range. (0.10% wider for IPv4 and 2.34% wider for IPv6 thangeolite2-country at Aug. 2024)
  • If you need an ASN database:asn

Accuracy of database

Since there is no definitive information on IP addresses and country_code, it is difficult to discuss the accuracy of Public Domain data qualitatively, but it is possible to estimate the approximate accuracy by comparing it with the country information in GeoLite2 and DbIp Lite.By comparing the database in GeoLite2, which is well known for its high accuracy, with the differences in other databases, we can see that Public Domain accuracy.

DatabaseSameDiffEmptyExtra
dbip-country96.15%3.85%0.00%0.42%
asn-country95.97%4.00%0.03%0.03%
geo-asn-country97.26%2.71%0.03%0.06%
geo-whois-asn-country96.98%2.99%0.03%0.12%
iptoasn-country76.80%4.99%18.21%1.26%

Measurements were taken in 9 Oct. 2024.Because the ipv6 range is too wide, the measurements here are limited to ipv4 results."Same" + "Diff" + "Empty" shows the GeoLite2 IP-range, and the GeoLite2 IP-range size is listed as 100%.

  • "Same" indicates the percentage of country_codes in Database that are the same as the country_code in GeoLite2.
  • "Diff" indicates the percentage of country_codes in Database that are different from GeoLite2 country_code.
  • "Empty" shows the percentage of IPs with GeoLite2 country_code but no corresponding country_code in Database.
  • "Extra" indicates the percentage of IPs with no GeoLite2 country_code listed that had a country_code listed in the Database.

We can see that for all data except iptoasn-country, the country_code matches the GeoLite2 results in more than 96% of cases.Although there is some variation in the results due to differences in update timing and the priority of the information, we believe that the Public Domain data shows a certain level of accuracy.

MMDB Libraries

If you would like to integrate MMDB files into an existing project there are several libraries that can help.

Read MMDB files

Libraries exist in many languages when using the MMDB files. There are official,Maxmind developed libraries for many popular languages:.NET,C,Node.js,Perl,PHP,Python andRuby, and third-party readers for others:Erlang,Go,Rust.

Write MMDB files

If you wish to create your own MMDB files from the CSV files(to customise their format) there are a couple of official libraries:Go andPerl(now archived). There are also some third-party options:Python andRust.

Useful Libraries

LibraryLanguageDescriptionTypesAuto
Updates
ip-location-apiNode.jsFast ip to country lookup by using in-memory database (7MB RAM)country
city
country
country-extra
Browser jsIp to country lookup in browsercountry
geocode
geocode-extra
Browser jsIp to geocode lookup in browsercountry
latitude
longitude

Useful applications

ApplicationLanguageDescriptionTypesAuto
Updates
ip_location_serverJavaAn in-memory GRPC and HTTP server mapping IP addresses to locations(requires at least 1.5GB RAM)country
asn
city
ip-location-apiGoAPI server creating / supporting MMDB, PostgreSQL, MySQL / MariaDB and SQLitecountry
asn
city
Ip-geo-APIGoIn-memory API servercountry
IPInfoOfflineWindowsDesktop tool showing information about IP addresses(local data)country
asn
city
ip-location-rsRustA RESTful in-memory network information lookup API servercountry
asn

Useful tools

ToolDescription
ip-location-to-mmdbBasic conversion from CSV files from this database into MMDB files
mmdbmeldCreate and customise MMDB files from CSV files in this database

Licences

The required licence depends upon the database which you use.Please carefully read each database licence before use.

You can usePDDL (ODC Public Domain Dedication and Licence) orCC0 (Creative Commons Zero) licensed databases without attribution for any purpose.

Support

We'd be grateful if you could link back tosapics/ip-location-db, and star this project to help others find it.

About

ip to location database by ASN, GeoFeed, Whois, iptoasn.com, db-ip lite, GeoLite2

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors7


[8]ページ先頭

©2009-2025 Movatter.jp