1.0.0 • Published 6 years ago
ip2geolocation v1.0.0
IP 2 Geo Location
Install
$ npm install ip2geolocationUsage Example
import { ipApi } from 'ip2geolocation';
fetch(ipApi.getUrl())
.then(res => res.json())
.then(data => console.log(ipApi.parseData(data)));Data Providers
extremeIpLookUp(see http://extreme-ip-lookup.com)freeGeoIp(see https://freegeoip.app)ipApi(see http://ip-api.com)ipApiCo(see https://ipapi.co)ipInfo(see https://ipinfo.io)
Every data provider uses its own data format. To use an unified data format (see a sample below)
{
"city" : "Mountain View",
"countryCode" : "US",
"lat" : 38.00881,
"lon" : -122.11746,
"ip" : "8.8.8.8"
}use the parseData method.
1.0.0
6 years ago