$ curl 127.0.0.1:18081 3.239.192.241 $ http -b 127.0.0.1:18081 3.239.192.241 $ wget -qO- 127.0.0.1:18081 3.239.192.241 $ fetch -qo- https://127.0.0.1:18081 3.239.192.241 $ bat -print=b 127.0.0.1:18081/ip 3.239.192.241
$ http 127.0.0.1:18081/country United States $ http 127.0.0.1:18081/country-iso US
$ http 127.0.0.1:18081/city Ashburn
$ http 127.0.0.1:18081/json { "ip": "3.239.192.241", "ip_decimal": 66044145, "country": "United States", "country_eu": false, "country_iso": "US", "city": "Ashburn", "hostname": "ec2-3-239-192-241.compute-1.amazonaws.com", "latitude": 39.0481, "longitude": -77.4728, "user_agent": { "product": "CCBot", "version": "2.0", "comment": "(https://commoncrawl.org/faq/)", "raw_value": "CCBot/2.0 (https://commoncrawl.org/faq/)" } }
Setting the Accept: application/json
header also works as expected.
Always returns the IP address including a trailing newline, regardless of user agent.
$ http 127.0.0.1:18081/ip 3.239.192.241
$ http 127.0.0.1:18081/port/8080 { "ip": "3.239.192.241", "port": 8080, "reachable": false }
As of 2018-07-25 it's no longer possible to force protocol using
the v4 and v6 subdomains. IPv4 or IPv6 still can be forced
by passing the appropiate flag to your client, e.g curl -4
or curl -6
.