Package Exports
- @smartip/js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@smartip/js) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
SmartIP.io Official Javascript library
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/jsYarn
$ yarn add @smartip/jsUsage 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);