How to get Geolocation from IP Address

I have been using ipapi for some time now and thought to share how easy it is to use their REST api. You can get a detailed geolocation data for any IP address with a single call.

It's a paid service with a generous free tier which will give you up to 30,000 requests a month. 30k a month is probably enough for tests and small projects.

Try it out

IP Address Geolocation Search
A simple IP location tool to get the detailed geo location data.

How to use it in a browser

let url = 'https://ipapi.co/' + ipAddress + '/json/';
fetch(url)
.then(data=>{return data.json()})
.then(res=>{console.log(JSON.stringify(res, undefined, 2))})         

How to use it on a command line

curl https://ipapi.co/8.8.8.8/json/

 { 
   "ip":"8.8.8.8",
   "city":"Mountain View",
   "region":"California",
   "region_code":"CA",
   "country":"US",
   "country_name":"United States",
   "continent_code":"NA",
   "in_eu":false,
   "postal":"94035",
   "latitude":37.386,
   "longitude":-122.0838,
   "timezone":"America/Los_Angeles",
   "utc_offset":"-0700",
   "country_calling_code":"+1",
   "currency":"USD",
   "languages":"en-US,es-US,haw,fr",
   "asn":"AS15169",
   "org":"Google LLC"
} 
Show Comments