What is my IP address?

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

CLI examples:

$ curl ifconfig.co

$ http -b ifconfig.co

$ wget -qO- ifconfig.co

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

Country lookup:

$ http ifconfig.co/country
United States

City lookup:

$ http ifconfig.co/city

JSON output:

$ http ifconfig.co/json
    "city": "Ashburn",
    "country": "United States",
    "hostname": "ec2-54-167-181-242.compute-1.amazonaws.com",
    "ip": "",
    "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

Testing port connectivity:

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