- Notifications
You must be signed in to change notification settings - Fork166
ip to location database by ASN, GeoFeed, Whois, iptoasn.com, db-ip lite, GeoLite2
sapics/ip-location-db
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
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.
ip_range_start, ip_range_end, country_code| Database | Type | License | Updated | IPv4 | IPv6 | IPv4+IPV6 | IPv4-num | IPv6-num |
|---|---|---|---|---|---|---|---|---|
| ASN | Country | CC0 | Daily | CSV MMDB | CSV MMDB | MMDB | CSV | CSV |
| GeoFeed + ASN | Country | CC0 | Daily | CSV MMDB | CSV MMDB | MMDB | CSV | CSV |
| GeoFeed + Whois + ASN | Country | CC0 | Daily | CSV MMDB | CSV MMDB | MMDB | CSV | CSV |
| IPtoASN | Country | PDDL byIPtoASN | Daily | CSV MMDB | CSV MMDB | — | CSV | CSV |
| IPLocate | Country | CC BY SA 4.0 byIPLocate | Daily | CSV MMDB | CSV MMDB | MMDB | CSV | CSV |
| DB-IP Lite | Country | CC BY 4.0 byDB-IP | Monthly | CSV MMDB | CSV MMDB | — | CSV | CSV |
| DB-IP Lite + GeoFeed + Whois + ASN | Country | CC BY 4.0 byDB-IP | Monthly | CSV MMDB | CSV MMDB | MMDB | CSV | CSV |
| GeoLite2 | Country | GeoLite2 License byMaxMind | Twice weekly | CSV MMDB | CSV MMDB | — | CSV | CSV |
| GeoLite2 + GeoFeed + Whois + ASN | Country | GeoLite2 License byMaxMind | Daily | CSV MMDB | CSV MMDB | MMDB | CSV | CSV |
ip_range_start, ip_range_end, country_code, state1, state2, city, postcode, latitude, longitude, timezone| Database | Type | License | Updated | IPv4 | IPv6 | IPv4+IPV6 | IPv4-num | IPv6-num |
|---|---|---|---|---|---|---|---|---|
| DB-IP Lite | City | CC BY 4.0 byDB-IP | Monthly | CSV.gz CSV.7z MMDB | CSV.gz CSV.7z MMDB | — | CSV.gz CSV.7z | CSV.gz CSV.7z |
| GeoLite2 | City | GeoLite2 License byMaxMind | Twice weekly | CSV.gz CSV.7z MMDB | CSV.gz CSV.7z MMDB | — | CSV.gz CSV.7z | CSV.gz CSV.7z |
ip_range_start, ip_range_end, autonomous_system_number, autonomous_system_organization| Database | Type | License | Updated | IPv4 | IPv6 | IPv4+IPV6 | IPv4-num | IPv6-num |
|---|---|---|---|---|---|---|---|---|
| RouteViews + ASN + DB-IP | ASN | CC BY 4.0 byRouteViews andDB-IP | Daily | CSV MMDB | CSV MMDB | MMDB | CSV | CSV |
| IPtoASN | ASN | PDDL byIPtoASN | Daily | CSV MMDB | CSV MMDB | — | CSV | CSV |
| IPLocate | ASN | CC BY SA 4.0 byIPLocate | Daily | CSV MMDB | CSV MMDB | MMDB | CSV | CSV |
| DB-IP Lite | ASN | CC BY 4.0 byDB-IP | Monthly | CSV MMDB | CSV MMDB | — | CSV | CSV |
| GeoLite2 | ASN | GeoLite2 License byMaxMind | Twice weekly | CSV MMDB | CSV MMDB | MMDB | CSV | CSV |
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.
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.
Created by merging 5 RIP (afrinic,apnic,arin,lacnic,ripe ncc) providedWHOIS database.
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.
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-countrywhich is equivalent togeolite2-countryforgeolite2-countrycovered IP range andgeo-whois-asn-countryfor the other IP range. (0.10% wider for IPv4 and 2.34% wider for IPv6 thangeolite2-countryat Aug. 2024) - If you need an ASN database:
asn
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.
| Database | Same | Diff | Empty | Extra |
|---|---|---|---|---|
| dbip-country | 96.15% | 3.85% | 0.00% | 0.42% |
| asn-country | 95.97% | 4.00% | 0.03% | 0.03% |
| geo-asn-country | 97.26% | 2.71% | 0.03% | 0.06% |
| geo-whois-asn-country | 96.98% | 2.99% | 0.03% | 0.12% |
| iptoasn-country | 76.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.
If you would like to integrate MMDB files into an existing project there are several libraries that can help.
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.
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.
| Library | Language | Description | Types | Auto Updates |
|---|---|---|---|---|
| ip-location-api | Node.js | Fast ip to country lookup by using in-memory database (7MB RAM) | countrycity | ✓ |
| country country-extra | Browser js | Ip to country lookup in browser | country | ✓ |
| geocode geocode-extra | Browser js | Ip to geocode lookup in browser | countrylatitudelongitude | ✓ |
| Application | Language | Description | Types | Auto Updates |
|---|---|---|---|---|
| ip_location_server | Java | An in-memory GRPC and HTTP server mapping IP addresses to locations(requires at least 1.5GB RAM) | countryasncity | ✓ |
| ip-location-api | Go | API server creating / supporting MMDB, PostgreSQL, MySQL / MariaDB and SQLite | countryasncity | ✓ |
| Ip-geo-API | Go | In-memory API server | country | ✘ |
| IPInfoOffline | Windows | Desktop tool showing information about IP addresses(local data) | countryasncity | ✘ |
| ip-location-rs | Rust | A RESTful in-memory network information lookup API server | countryasn | ✘ |
| Tool | Description |
|---|---|
| ip-location-to-mmdb | Basic conversion from CSV files from this database into MMDB files |
| mmdbmeld | Create and customise MMDB files from CSV files in this database |
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.
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
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors7
Uh oh!
There was an error while loading.Please reload this page.