Skip to content

Latest commit

 

History

History
49 lines (33 loc) · 853 Bytes

README.md

File metadata and controls

49 lines (33 loc) · 853 Bytes

ipjson

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

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