Not strictly a curl hack, but you can quickly get your IP geolocation details with curl and <a href="http://ipinfo.io" rel="nofollow">http://ipinfo.io</a> (full disclosure, it's my service):<p><pre><code> $ curl ipinfo.io
{
"ip": "208.54.39.206",
"hostname": "mce2736d0.tmodns.net",
"city": "Los Angeles",
"region": "California",
"country": "US",
"loc": "34.0522,-118.2437",
"org": "AS21928 T-Mobile USA, Inc.",
"postal": "90013",
"phone": 213
}
</code></pre>
Or just your IP<p><pre><code> $ curl ipinfo.io/ip
208.54.39.206
</code></pre>
Or any other field (eg. city)<p><pre><code> $ curl ipinfo.io/city
Los Angeles
</code></pre>
Or lookup another IP<p><pre><code> $ curl ipinfo.io/8.8.8.8
{
"ip": "8.8.8.8",
"hostname": "google-public-dns-a.google.com",
"city": "Mountain View",
"region": "California",
"country": "US",
"loc": "37.3860,-122.0838",
"org": "AS15169 Google Inc.",
"postal": "94040",
"phone": 650
}
</code></pre>
Or a specific field for that IP:<p><pre><code> $ curl ipinfo.io/8.8.8.8/org
AS15169 Google Inc.</code></pre>