Getting my public IP via API [closed]

While not from big companies, all of these should work:

curl icanhazip.com
curl -s 'http://checkip.dyndns.org' | sed 's/.*Current IP Address: \([0-9\.]*\).*/\1/g'
host -t a dartsclink.com | sed 's/.*has address //'
curl curlmyip.com
curl ifconfig.me # this has a lot of different alternatives too, such as ifconfig.me/host

Source

  • http://www.commandlinefu.com/commands/view/2966/return-external-ip#comment

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)