Giter VIP home page Giter VIP logo

node-iplocate's Introduction

IPLocate for Node.js

Find geolocation data from IP addresses (e.g. city, country, timezone) using the IPLocate.io API.

IPLocate.io provides 1,000 free requests per day. For higher plans, check out the website

NPM Package Version NPM Package License NPM Package Downloads devDependencies Status

Node Version Travis CI Build Status Code Climate Status Coverage Status

NPM Package Statistics

Installation

npm install node-iplocate

Usage Example

const iplocate = require("node-iplocate");

iplocate("8.8.8.8").then(function(results) {
  console.log("IP Address: " + results.ip);
  console.log("Country: " + results.country + " (" + results.country_code + ")");
  console.log("Continent: " + results.continent);
  console.log("Organisation: " + results.org + " (" + results.asn + ")");

  console.log(JSON.stringify(results, null, 2));
});

// Or with callbacks
iplocate("8.8.8.8", null, function(err, results) {
  // ...
  console.log(JSON.stringify(results, null, 2));
});

// Provide an API key from IPLocate.io
iplocate("8.8.8.8", { api_key: "abcdef" }).then(function(results) {
  // ...
});

IP Address: 8.8.8.8
Country: United States (US)
Continent: North America
Organisation: Google LLC (AS15169)

{
  "ip": "8.8.8.8",
  "country": "United States",
  "country_code": "US",
  "city": null,
  "continent": "North America",
  "latitude": 37.751,
  "longitude": -97.822,
  "time_zone": null,
  "postal_code": null,
  "org": "Google LLC",
  "asn": "AS15169"
}

Tests

To run the test suite, first install the dependencies, then run npm test:

$ npm install
$ npm test

License

Distributed under the MIT License.

node-iplocate's People

Contributors

dependabot[bot] avatar samirl avatar tallytarik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

samirl

node-iplocate's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.