Last active
March 22, 2022 21:02
-
-
Save ihorduchenko/bd723c72d182a26779759284d349cc25 to your computer and use it in GitHub Desktop.
Geolocation detection endpoint
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
// https://get.geojs.io/v1/ip/geo.json | |
// https://ipapi.co/country | |
// http://ip-api.com/json | |
// https://ipinfo.io/json | |
// https://extreme-ip-lookup.com/json/?key=E4sAnOeXGIkbh5BLZOCg | |
// https://geolocation-db.com/json/0f761a30-fe14-11e9-b59f-e53803842572 | |
// ABOVE LOOKS LIKE WASTED | |
// BELOW ARE FINE | |
// + https://ipgeolocation.abstractapi.com/v1/?api_key=b3d18485c87a42d1a7a82c0568732f19 | |
fetch('https://get.geojs.io/v1/ip/geo.json') | |
.then(response => response.text()) | |
.then(data => { | |
let resp = JSON.parse(data); | |
console.log(resp) | |
}) | |
.catch(error => { | |
console.log(error) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment