Get unlimited public & private packages + package-based permissions with npm Pro.Get started »

@smartip/js

1.0.13 • Public • Published

SmartIP SmartIP.io Official Javascript library

license npm type definitions npm version

This is the official Javascript Library for SmartIP.io, which allows a fast lookup of any IP address or ASN. Our main features are:

  • IP Geolocation data (country, city, postal codes, latitude, longitude)
  • Timezone data
  • Currency data
  • Security data (TOR insights, Crawler insights, Proxy insigths)
  • Crypto data (Bitcoin nodes)
  • ASN data (number of IPs managed by an ASN, the organization name, the list of IP blocks managed by a given ASN)
  • User Agent detection

Getting started

In order to use SmartIP.io API, you will need to register a free account at https://smartip.io and get an API KEY. All data fields are always enabled regardless of the subscription tier.

  • The Free tier will allow up to 125,000 requests a month.
  • The PRO tier will allow for an unlimited number of requests a month.

More pricing info are available at: https://smartip.io/#pricing-section

Installation

Npm

$ npm install @smartip/js

Yarn

$ yarn add @smartip/js

Usage example

IP Lookup:

  const {SmartIP} = require("@smartip/js")
 
  let testApiKey = '249C35CF-81E7-4B49-8F9F-ACA72C9F5CD7';
  const client = new SmartIP(testApiKey);
  let hostname = true;
  let userAgent = true;
  let ipInfo = await client.requestIPData('8.8.8.8', hostname, userAgent);
  console.log(ipInfo);

ASN Lookup:

  const {SmartIP} = require("@smartip/js")
  
  let testApiKey = '249C35CF-81E7-4B49-8F9F-ACA72C9F5CD7';
  const client = new SmartIP(testApiKey);
  let asnInfo = await client.requestAsnData("AS15169");
  console.log(asnInfo);

Install

npm i @smartip/js

DownloadsWeekly Downloads

0

Version

1.0.13

License

Apache-2.0

Unpacked Size

46.2 kB

Total Files

32

Homepage

smartip.io/

Last publish

Collaborators

  • avatar