sapics/ip-location-db

AS Number and AS Organization

dbx0 opened this issue · 6 comments

dbx0 commented

Is it possible to add these information in one of the daily feeds?

I just checked and I believe it is possible to obtain AS Number. However, I could not find any information on the mapping between AS Number and AS Organization for free licenses.

dbx0 commented

IP2ASN has a hourly updated(at least it claims to be) .tsv database that contains AS number and a AS description that I believe can be trusted as organization name.
Couldn't this be used?

Thank you for your advice! It looks good!
First of all, I would create three database which copy from IP2ASN and DB-IP Lite and GeoLite2, for AS Number and AS Organization.
Next, I would create own database!
When I create them, I would inform here.

I have created four database for asn type.
Three of them are just copy of IP2ASN and DB-IP Lite and GeoLite2 as written in above.
Last one is created by merging routeviews.org and rip database and DB-IP Lite.
I need to use two CC BY 4.0 licensed databases to create last one, and, I believe we have created a highly accurate and daily updated database.

dbx0 commented

Amazing!

I compared the new ASN database with the ASN Country that I was using, and the results were execelent. It covers everything.

Comparing code for reference:

asn_org_database_url = 'https://raw.githubusercontent.com/sapics/ip-location-db/master/asn/asn-ipv4.csv'
asn_loc_database_url = 'https://raw.githubusercontent.com/sapics/ip-location-db/master/asn-country/asn-country-ipv4.csv'
asn_loc_db = pd.read_csv(asn_loc_database_url, names=['ip_range_start', 'ip_range_end', 'country_code'])
asn_org_db = pd.read_csv(asn_org_database_url, names=['ip_range_start', 'ip_range_end', 'as_number', 'as_organization'])
asn_db = asn_loc_db.merge(asn_org_db, how = 'inner', on = ['ip_range_start', 'ip_range_end'])
asn_db.isna().sum()

Results:

Field:              Empty values:
ip_range_start      0
ip_range_end        0
country_code       27
as_number           0
as_organization     1

Thank you for effort. It turned out very good!

Thanks for the confirmation! Glad to hear it turned out good!