What is my IP address?

54.234.247.118

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

CLI examples:

$ curl ifconfig.co
54.234.247.118

$ http -b ifconfig.co
54.234.247.118

$ wget -qO- ifconfig.co
54.234.247.118

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

$ bat -print=b ifconfig.co/ip
54.234.247.118

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-234-247-118.compute-1.amazonaws.com",
    "ip": "54.234.247.118",
    "ip_decimal": 921368438
}

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.234.247.118

Testing port connectivity:

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

FAQ

Is using this service from automated scripts/tools permitted?

Yes, as long as the rate limit is respected. Please limit automated requests to 1 request per minute. No guarantee is made for requests that exceed this limit. They may be rate-limited (with a 429 response code) or dropped entirely.

Is IPv6 supported?

IPv6 is currently not supported. You are however free to host your own service with IPv6 support, see next question.

Can I run my own service?

Yes, the source code and documentation is available on GitHub.