Get your public IP address
JavaScript
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.

readme.md

ipify Build Status

Get your public IP address

Using the ipify API or a custom ipify instance.

Install

$ npm install --save ipify

Usage

const ipify = require('ipify');

ipify().then(ip => {
	console.log(ip);
	//=> '82.142.31.236'
});

API

ipify([endpoint])

Returns a Promise for the IP address.

endpoint

Type: string
Default: https://api.ipify.org

Custom API endpoint.

Related

License

MIT © Sindre Sorhus