Public API to Get Your Public IP Information
Mar 30, 2014
There are actually some public services that you can test your public IP easily, for example, ipinfo.io for global users and ipip.net for Chinese users.
ipinfo.io
1 | curl ipinfo.io |
You will get a response in JSON, including your current city, region, country, organization, etc.
1 | { |
ipip.net
1 | curl myip.ipip.net |
You will get a plain text response, including your current city, country, ISP, etc.
1 | 当前 IP:16.221.25.51 来自于:中国 上海 上海电信 |