# FREE API for getting Client IP Address

**URL:** <https://onehack.st/t/free-api-for-getting-client-ip-address/170461>\
**Category:** Tools & Scripts\
**Tags:** programming, hacking, networking\
**Created:** [January 20, 2021, 4:59pm UTC](https://onehack.st/t/free-api-for-getting-client-ip-address/170461 "2021-01-20T16:59:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![prabha\_coder](https://onehack.st/user_avatar/onehack.st/prabha_coder/32/52939_2.png) [@prabha\_coder](https://onehack.st/u/prabha_coder)\
**Post date:** [January 20, 2021, 4:59pm UTC](https://onehack.st/t/free-api-for-getting-client-ip-address/170461/1 "2021-01-20T16:59:40Z")

</div>

# IPJSON

* * *

> **[GitHub - prabha-coder/ipjson: Get Client IP Address using JSON/Javascript](https://github.com/prabha-coder/ipjson)**
>
> Get Client IP Address using JSON/Javascript

`if you like it, give star 🌟`

**Get Client IP Address using JSON/Javascript**

## 👉 [https://ipjson.cf](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:_

```bash
https://ipjson.cf

```

_Response:_

```json
{
  "ip": "127.0.0.1"
}

```

## To Show IP address in HTML Content use this syntax

_Syntax:_

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

```

_HTML OUTPUT:_

```html
127.0.0.1

```

## To Assign an IP address to a Variable use this syntax

_Syntax:_

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

```

_HTML OUTPUT:_

```html
127.0.0.1

```

Warm Regards,

Prabha

---

<div class="post-metadata">

**Author:** ![heroku\_torrent](https://onehack.st/user_avatar/onehack.st/heroku_torrent/32/50754_2.png) [@heroku\_torrent](https://onehack.st/u/heroku_torrent)\
**Post date:** [January 21, 2021, 2:28pm UTC](https://onehack.st/t/free-api-for-getting-client-ip-address/170461/2 "2021-01-21T14:28:32Z")

</div>

Thanks for sharing. 👍

---

<div class="post-metadata">

**Author:** ![bella\_tor](https://onehack.st/user_avatar/onehack.st/bella_tor/32/79093_2.png) [@bella\_tor](https://onehack.st/u/bella_tor)\
**Post date:** [January 21, 2021, 2:31pm UTC](https://onehack.st/t/free-api-for-getting-client-ip-address/170461/3 "2021-01-21T14:31:33Z")

</div>

Nice share. 😍

---

<div class="post-metadata">

**Author:** ![paul\_aurand](https://onehack.st/user_avatar/onehack.st/paul_aurand/32/82299_2.png) [@paul\_aurand](https://onehack.st/u/paul_aurand)\
**Post date:** [January 21, 2021, 2:33pm UTC](https://onehack.st/t/free-api-for-getting-client-ip-address/170461/4 "2021-01-21T14:33:13Z")

</div>

Nice work. keep it up 👍
