IP Locator Library banner

IP Locator Library

4 devlogs
2h 42m 42s

An IP geolocation library for JavaScript which gets data straight from the official registries without requiring any third party APIs or API keys.

Sam V

I switched my code from making HTTP requests to the APNIC website for WHOIS queries to using the whoiser library, as it seems like this will work better for queries to ARIN IPs.

Attachment
0
Sam V

Now the location gets formatted nicely instead of just showing country and region codes! I think this is the final data format I will use so I am going to try and move on to supporting registries other than APNIC. I want to support ARIN next but it seems like it may be tricky.

Attachment
0
Sam V

I added the functionality to download the CSV file and filter through the rows to find the one which contains the location data for the provided IP address. Currently, the code only provides the exact data from the CSV file, which contains the ISO 3166 codes for the country and region as well as the name of the city.

Attachment
0
Sam V

I started working on fetching location data from IP addresses in the APNIC (Asia Pacific) registry. Currently you can look an IP up and it will find the internet provider, as well as providing the URL for the geofeed.csv file which contains the locations for all IP ranges from that provider.

(Don’t worry the IP i’m using in the screenshot is from a VPN)

Attachment
0