What is my IP address?

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

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

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

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

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

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

Country lookup

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

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

City lookup

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

ASN lookup

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

JSON output

$ curl https://ip.0xcb.dev/json
  "ip": "",
  "ip_decimal": 65852532,
  "country": "United States",
  "country_iso": "US",
  "country_eu": false,
  "region_name": "Virginia",
  "region_code": "VA",
  "metro_code": 511,
  "zip_code": "20149",
  "city": "Ashburn",
  "latitude": 39.0481,
  "longitude": -77.4728,
  "time_zone": "America/New_York",
  "asn": "AS14618",
  "asn_org": "AMAZON-AES",
  "hostname": "ec2-3-236-212-116.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

Port testing

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