What is my IP address?

54.167.181.242

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

CLI examples:

$ curl ifconfig.co
54.167.181.242

$ http -b ifconfig.co
54.167.181.242

$ wget -qO- ifconfig.co
54.167.181.242

$ fetch -qo- https://ifconfig.co
54.167.181.242

Country lookup:

$ http ifconfig.co/country
United States

City lookup:

$ http ifconfig.co/city
Ashburn

JSON output:

$ http ifconfig.co/json
{ 
    "city": "Ashburn",
    "country": "United States",
    "hostname": "ec2-54-167-181-242.compute-1.amazonaws.com",
    "ip": "54.167.181.242",
    "ip_decimal": 916960754
}

Setting the Accept header to application/json also works.

Plain output:

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

$ http ifconfig.co/ip
54.167.181.242

Testing port connectivity:

$ http ifconfig.co/port/8080
{
    "ip": "54.167.181.242",
    "port": 8080,
    "reachable": false
}