Press "Enter" to skip to content

Get IP address

Pedro Adelino 0

How to get the Public IP address in JavaScript :

<script type=”application/javascript”> function getIP(json) { document.write(“My public IP address is: “, json.ip);}</script>

<script type=”application/javascript” src=”https://api.ipify.org?format=jsonp&callback=getIP”></script> 

Click here to test the API.

Leave a Reply