What is my IP address?

18.234.255.5

Multiple command line HTTP clients are supported, including curl, httpie, httpie-go, GNU Wget, fetch, and bat.

All endpoints, with the exception of /port, can return information about a custom IP address specified via ?ip= query parameter.

CLI examples

$ curl https://ip.0xcb.dev
18.234.255.5

$ http -b https://ip.0xcb.dev
18.234.255.5

$ ht -b https://ip.0xcb.dev
18.234.255.5

$ wget -qO- https://ip.0xcb.dev
18.234.255.5

$ fetch -qo- https://ip.0xcb.dev
18.234.255.5

$ bat -print=b https://ip.0xcb.dev/ip
18.234.255.5

Country lookup

$ curl https://ip.0xcb.dev/country
United States

$ curl https://ip.0xcb.dev/country-iso
US

ASN lookup

$ curl https://ip.0xcb.dev/asn
AS14618

JSON output

$ curl https://ip.0xcb.dev/json
{
  "ip": "18.234.255.5",
  "ip_decimal": 317390597,
  "country": "United States",
  "country_iso": "US",
  "country_eu": false,
  "latitude": 37.751,
  "longitude": -97.822,
  "time_zone": "America/Chicago",
  "asn": "AS14618",
  "asn_org": "AMAZON-AES",
  "hostname": "ec2-18-234-255-5.compute-1.amazonaws.com",
  "user_agent": {
    "product": "CCBot",
    "version": "2.0",
    "comment": "(https://commoncrawl.org/faq/)",
    "raw_value": "CCBot/2.0 (https://commoncrawl.org/faq/)"
  }
}

Setting the Accept: application/json header also works as expected.

Plain output

Always returns the IP address including a trailing newline, regardless of user agent.

$ curl https://ip.0xcb.dev/ip
18.234.255.5

Port testing

$ curl https://ip.0xcb.dev/port/8080
{
  "ip": "18.234.255.5",
  "port": 8080,
  "reachable": false
}