Skip to content

Fetch the geo location of an IP address, IP6 and host name.

License

Notifications You must be signed in to change notification settings

nasa8x/ip-to-location

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fetch the geo location of an IP address, IP6 and host name.

npm install ip-to-location --save
var ip2location = require('ip-to-location');

ip2location.fetch('209.58.139.51', function(err, res){
    console.log(res);
    //  { 
    //     ip: '209.58.139.51',
    //     country_code: 'US',
    //     country_name: 'United States',
    //     region_code: 'CA',
    //     region_name: 'California',
    //     city: 'San Jose',
    //     zip_code: '95131',
    //     time_zone: 'America/Los_Angeles',
    //     latitude: 37.3874,
    //     longitude: -121.9024,
    //     metro_code: 807 
    // }
})
ip2location.fetch('209.58.139.51').then(res => {
    console.log(res);
});

Releases

No releases published

Packages

No packages published