1.0.0 • Published 5 years ago

ip2geolocation v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

IP 2 Geo Location

Install

$ npm install ip2geolocation

Usage Example

import { ipApi } from 'ip2geolocation';

fetch(ipApi.getUrl())
  .then(res => res.json())
  .then(data => console.log(ipApi.parseData(data)));

Data Providers

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.