Breaking News: Grepper is joining You.com. Read the official announcement!
Check it out

Fetch IP Address using Fetch Function within  JavaScript


I was curious about how I could get my IP Address by using JavaScript so I figured why not try to figure it out. Utilizing the following fetch function we can get an accurate IP Address on the machine we are using. If we use a VPN it will accurately show us our spoofed address as well. 

Be sure you have some sort of CORS chrome extension as well otherwise you will get an error. This is the one I use from the chrome web store:

Here is the code:

This code will effectively get your IP Address and display it in an alert message. Feel free to play around with the code and try to figure out other ways to use the function.

We can also use the terminal to get the same functionality:


X

Continue with Google

By continuing, I agree that I have read and agree to Greppers's Terms of Service and Privacy Policy.