项目作者: prabha-coder

项目描述 :
Get Client IP Address using JSON/Javascript
高级语言: JavaScript
项目地址: git://github.com/prabha-coder/ipjson.git
创建时间: 2021-01-19T11:10:50Z
项目社区:https://github.com/prabha-coder/ipjson

开源协议:

下载


ipjson

Get Client IP Address using JSON/Javascript

👉 https://ipjson.cf 👈

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:

  1. https://ipjson.cf

Response:

  1. {
  2. "ip": "127.0.0.1"
  3. }

To Show IP address in HTML Content use this syntax

Syntax:

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

HTML OUTPUT:

  1. 127.0.0.1

To Assign IP address to a Variable use this syntax

Syntax:

  1. <script type="text/javascript" src="https://ipjson.cf/?var=myip"></script>
  2. <script type="text/javascript">document.write(myip);</script>

HTML OUTPUT:

  1. 127.0.0.1