justin-leibach / JSON-Log-Country

Built for use with Dshield generated logs to combine web log files, and give statistics on country of origin for source ip.
0 stars 0 forks source link

Feature request: Using IPinfo IP to Country ASN database #1

Open abdullahdevrel opened 3 months ago

abdullahdevrel commented 3 months ago

I am requesting to add support for IPinfo's IP to Country database to the project. The database has the following features:

Database schema

Field Name Example Data Type Description
start_ip 1.0.16.0 TEXT Starting IP address of an IP address range
end_ip 1.0.31.255 TEXT Ending IP address of an IP address range
country JP TEXT ISO 3166 country code of the location
country_name Japan TEXT Name of the country
continent AS TEXT Continent code of the country
continent_name Asia TEXT Name of the continent
asn AS2519 TEXT Autonomous System Number
as_name ARTERIA Networks Corporation TEXT Name of the AS (Autonomous System) organization
as_domain arteria-net.com TEXT Official domain or website of the AS organization

Documentation: https://ipinfo.io/developers/ip-to-country-asn-database

Samples are available here: https://github.com/ipinfo/sample-database/tree/main/IP%20to%20Country%20ASN

The database can be downloaded simply by accessing the storage URI with an access token.

curl -L https://ipinfo.io/data/free/country_asn.mmdb?token=<YOUR_TOKEN> -o country_asn.mmdb

If you do not need the ASN field, you can use the free IP to Country Database as well.

Let me know what you think. Thanks!

justin-leibach commented 3 months ago

I actually looked at your site when I was considering using an API service or not. There is good data to be pulled with your API, and integration could be very beneficial.

Are you able/willing to add support without removing features (like using a locally available maxmind database w/o limitations on query count?)

My biggest concerns with a feature add:

abdullahdevrel commented 3 months ago

Thank you for checking us out.

Are you able/willing to add support without removing features (like using a locally available maxmind database w/o limitations on query count?)

If you want to use an existing database with our database, that is fine as well. Using a database (which is inherently offline) will give you essentially unlimited queries against it.

In terms of our API access, we have a limit of 50,000 requests per month for free.