From e2378c6e6373c50e9a939ebe4391208679ac850c Mon Sep 17 00:00:00 2001 From: gautam-arya <56232258+gautam-arya@users.noreply.github.com> Date: Fri, 3 Oct 2025 16:42:28 +0530 Subject: [PATCH] Create IPGeolocationfinder.py --- IPGeolocationfinder.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 IPGeolocationfinder.py diff --git a/IPGeolocationfinder.py b/IPGeolocationfinder.py new file mode 100644 index 0000000..80fcee6 --- /dev/null +++ b/IPGeolocationfinder.py @@ -0,0 +1,12 @@ +import requests + +def ip_geolocate(ip="8.8.8.8"): + url = f"https://ipapi.co/{ip}/json/" + response = requests.get(url) + if response.status_code == 200: + data = response.json() + print(f"IP: {data['ip']}, City: {data['city']}, Country: {data['country_name']}") + else: + print("Failed to fetch IP info") + +