
IP-API Has a Free API — Get Geolocation for Any IP Address Without an API Key
Every app that deals with users eventually needs to know where they are. Whether you're personalizing content, blocking suspicious traffic, or logging analytics — IP geolocation is essential. Most geolocation APIs require signup, API keys, and credit cards. IP-API gives you all of this for free — no key, no signup, no limits for non-commercial use. What You Get One HTTP request returns: Country, region, city, zip code Latitude and longitude Timezone ISP name and organization AS number Try It Right Now curl http://ip-api.com/json/8.8.8.8 Response: { "status" : "success" , "country" : "United States" , "regionName" : "Virginia" , "city" : "Ashburn" , "lat" : 39.03 , "lon" : -77.5 , "timezone" : "America/New_York" , "isp" : "Google LLC" , "org" : "Google Public DNS" , "query" : "8.8.8.8" } That's Google's public DNS server — located in Ashburn, Virginia. Python Example: Geolocate Any IP import requests def geolocate ( ip ): response = requests . get ( f " http://ip-api.com/json/ { ip } "
Continue reading on Dev.to Python
Opens in a new tab




