curl api.ipify.org code example
Example 1: check ip json
$ curl 'https://api.ipify.org?format=json'
{"ip":"51.159.59.56"}
Example 2: apiipify
var http = require('http');
http.get({'host': 'api.ipify.org', 'port': 80, 'path': '/'}, function(resp) {
resp.on('data', function(ip) {
console.log("My public IP address is: " + ip);
});
});