Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save bilalnawaz072/f10ecf3cf508238a6ff088370ba6fbe6 to your computer and use it in GitHub Desktop.
Save bilalnawaz072/f10ecf3cf508238a6ff088370ba6fbe6 to your computer and use it in GitHub Desktop.
Flowise get_ip_address_geo_location
const fetch = require('node-fetch');
const url = 'https://free-geo-ip.p.rapidapi.com/json/' + $ip;
const options = {
method: 'GET',
headers: {
'X-RapidAPI-Key': 'YOUR_RAPIDAPI_KEY',
'X-RapidAPI-Host': 'free-geo-ip.p.rapidapi.com'
}
};
try {
const response = await fetch(url, options);
const result = await response.text();
console.log('---< IP function >---');
console.log(result);
return(result);
} catch (error) {
console.error(error);
return '';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment