Skip to content

prabha-coder/ipjson

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

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

About

Get Client IP Address using JSON/Javascript

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published