Home / Tools

IP address API for developers

Get your public IP from the command line or your code: plain text for scripts, JSON for apps. Free, fast, and no sign-up needed.

Your IP right now:

…

Command line

curl whatismyipadd.com
wget -qO- whatismyipadd.com/ip

PowerShell

(Invoke-WebRequest whatismyipadd.com/ip).Content

JSON

curl whatismyipadd.com/json

Need your public IP inside a script, a server setup, or an app? whatismyipadd answers with just the address when you request it from a command-line tool, so there's nothing to parse.

Endpoints

AddressReturns
whatismyipadd.comYour IP as plain text when called from curl, wget, HTTPie, or PowerShell; the normal website in a browser
whatismyipadd.com/ipYour IP as plain text, always
whatismyipadd.com/jsonIP, version, approximate location, time zone, ASN, and provider as JSON

Example JSON

{
  "ip": "203.0.113.42",
  "version": "IPv4",
  "city": "Los Angeles",
  "region": "California",
  "country": "US",
  "timezone": "America/Los_Angeles",
  "asn": 64500,
  "isp": "Example Internet"
}

Using it in code

# Python
import urllib.request
ip = urllib.request.urlopen("https://whatismyipadd.com/ip").read().decode().strip()

// JavaScript
const { ip } = await (await fetch("https://whatismyipadd.com/json")).json();

The JSON endpoint allows requests from any website (CORS is enabled). To force IPv4 or IPv6, use curl -4 or curl -6.

Fair use

The API is free for personal and small projects. Please don't call it more than once a minute from automated jobs; cache the result instead. We may limit traffic that harms the service for others.

Last updated October 2026.

More tools