Get Client IP Address using JSON/Javascript
This API helps you to get the public IP address of the system making the call. The function returns a JSON with the IP address of the caller in either IPv4 or IPv6 format, depending on the requester's protocol.
Request:
https://ipjson.cf
Response:
{
"ip": "127.0.0.1"
}
Syntax:
<script type="text/javascript" src="https://ipjson.cf/ip"></script>
HTML OUTPUT:
127.0.0.1
Syntax:
<script type="text/javascript" src="https://ipjson.cf/?var=myip"></script>
<script type="text/javascript">document.write(myip);</script>
HTML OUTPUT:
127.0.0.1