Fetch API is used for networking. It fetches content from an arbitrary URL, by passing the required URL.
fetch('https://freegeoip.net/json/');