$ curl ip.nutz.cn 3.239.242.55 $ http -b ip.nutz.cn 3.239.242.55 $ wget -qO- ip.nutz.cn 3.239.242.55 $ fetch -qo- https://ip.nutz.cn 3.239.242.55 $ bat -print=b ip.nutz.cn/ip 3.239.242.55
$ http ip.nutz.cn/country 美国
$ http ip.nutz.cn/city 未知
$ http ip.nutz.cn/json { "city": "未知", "country": "美国", "ip": "3.239.242.55", "ip_decimal": 66056759 }
Setting the Accept header to application/json also works.
Always returns the IP address including a trailing newline, regardless of user agent.
$ http ip.nutz.cn/ip 3.239.242.55
$ http ip.nutz.cn/port/8080 { "ip": "3.239.242.55", "port": 8080, "reachable": false }