An open API service indexing awesome lists of open source software.

https://github.com/nasa8x/ip-to-location

Fetch the geo location of an IP address, IP6 and host name.
https://github.com/nasa8x/ip-to-location

geo geoip geoip-location geojson geolocation ip ip-geolocation ip-location ip2location

Last synced: about 1 month ago
JSON representation

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

Awesome Lists containing this project

README

        

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

```js
npm install ip-to-location --save
```

```js
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
// }
})

```

```js
ip2location.fetch('209.58.139.51').then(res => {
console.log(res);
});
```