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.
- Host: GitHub
- URL: https://github.com/nasa8x/ip-to-location
- Owner: nasa8x
- License: mit
- Created: 2017-04-10T23:42:57.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-04-10T23:44:11.000Z (about 8 years ago)
- Last Synced: 2025-02-05T02:52:48.595Z (3 months ago)
- Topics: geo, geoip, geoip-location, geojson, geolocation, ip, ip-geolocation, ip-location, ip2location
- Language: JavaScript
- Size: 1.95 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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);
});
```