IP2NearestAirport Node.js Module
This Node.js module (ip2nearestairport) provides a fast lookup of country, region, city, latitude, longitude, ZIP code, time zone, ISP, domain name and usage type from IP address including nearest airport details with distance from the city center. This module uses ipinfo.io and travel payout API.
This module can be used in many types of projects such as:
- travel projects
- flight search websites
- map based portable apps for showing cities and nearest airports with distance.
- travel route guide
- travel guides
- tourism websites
- select the geographically closest mirror
- analyze your web server logs to determine the countries of your visitors
- credit card fraud detection
- software export controls
- display native language and currency
- prevent password sharing and abuse of service
- geotargeting in advertisement
Installation
To install this module type the following:
npm install ip2nearestairport
Uses
var test = require("ip2nearestairport"); test.ip2nearestairport('13.73.31.65', function(data) { var DT=JSON.parse(data); console.log(DT.nearestairport); });
Output
{ ip: '13.73.31.65', city: 'Tokyo', region: 'Tokyo', country: 'JP', citycenter: '35.6427,139.7677', latitude: '35.6427', longitude: '139.7677', org: 'AS8075 Microsoft Corporation', host: '', phone: '', postal: '100-0001', nearestairport: 'TYO', airportcity: 'Tokyo', countryname: 'Japan', airportcoordinate: '35.6895,139.692', airportlatitude: '35.6895', airportlongitude: '139.692', distancefromcitycenter: '8.59', distanceunit: 'Km' }
Copyright
Copyright (C) 2017 Dhiraj Das, dhirajdas.author@gmail.com