You can get your IP, and a whole bunch of other information, from my service http://ipinfo.io:
$ curl ipinfo.io
{
"ip": "67.188.232.131",
"hostname": "c-67-188-232-131.hsd1.ca.comcast.net",
"city": "Mountain View",
"region": "California",
"country": "US",
"loc": "37.385999999999996,-122.0838",
"org": "AS7922 Comcast Cable Communications, Inc.",
"phone": 650
}
If you want just the IP:
$ curl ipinfo.io/ip
67.188.232.131
That also works for other fields, eg:
$ curl ipinfo.io/org
AS7922 Comcast Cable Communications, Inc.
More details available at http://ipinfo.io/developers