I'm trying to find the location of an IP address. The IP address will be sent to the API through a front end android/iOS application(I'm currently using a static IP address of my computer). I want to use the client IP address to then determine their, likely, physical location and send the location to MongoDB to be stored. Any help regarding this will be appreciated. Thanks in advance.
You can utilize GeoIP-lite to get the geodata from the ip address.
var geoip = require('geoip-lite');
var ip = "207.97.227.239";
var geo = geoip.lookup(ip);
console.log(geo);
/*{ range: [ 3479297920, 3479301339 ],
country: 'US',
region: 'TX',
city: 'San Antonio',
ll: [ 29.4889, -98.3987 ],
metro: 641,
zip: 78218 }*/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With