Skip to content

Instantly share code, notes, and snippets.

@ihorduchenko
Last active March 22, 2022 21:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ihorduchenko/bd723c72d182a26779759284d349cc25 to your computer and use it in GitHub Desktop.
Save ihorduchenko/bd723c72d182a26779759284d349cc25 to your computer and use it in GitHub Desktop.
Geolocation detection endpoint
// 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