Forked from business24ai/get_ip_address_geo_location.js
Created
November 6, 2023 06:39
-
-
Save bilalnawaz072/f10ecf3cf508238a6ff088370ba6fbe6 to your computer and use it in GitHub Desktop.
Flowise get_ip_address_geo_location
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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