Node flow to convert ip to coordinates?

You could install a suitable NPM module, such as https://www.npmjs.com/package/geoip-lite to your Node-RED home directory (assuming Linux host):

cd .node-red
npm install geoip-lite

Then require it inside your settings.js and then use it in a function node (more info: https://nodered.org/docs/user-guide/writing-functions#loading-additional-modules) :

const geoip = global.get('geoip-lite');
 
let ip = "207.97.227.239"; // read this from a msg property sent with msg
msg.payload = geoip.lookup(ip);
 
return msg;

Note: I didn't test this, just did a quick web search and modified the code example from NPM.

1 Like