FREE API for getting Client IP Address

IPJSON


if you like it, give star :star2:

Get Client IP Address using JSON/Javascript

:point_right: https://ipjson.cf :point_left:

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"
}

To Show IP address in HTML Content use this syntax

Syntax:

<script type="text/javascript" src="https://ipjson.cf/ip"></script>

HTML OUTPUT:

127.0.0.1

To Assign an IP address to a Variable use this syntax

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

Warm Regards,

Prabha

7 Likes

Thanks for sharing. :+1:

Nice share. :heart_eyes:

Nice work. keep it up :+1: