Track Anyone’s IP Address using Python

prkskrs
Catalysts Reachout
Published in
1 min readSep 4, 2022

Using this technique, you can make your own IP Tracker.

At first, download python in your system.

Step 1 : Add Dependencies

import os
import urllib2
import json

OS Module : It will be used to interact with Operating System.

urllib2 Module : It will be used to handle “urls”.

json(JavaScript Object Notation) Module : It will be used to store and exchange data.

Step 2 : Take Raw Input From User (Tageted IP)

ip = input("What is your target IP: ")

Step 3 : Enter URL, whose api we are using

url = "http://ip-api.com/json/"

Step 4 : Get HttpResponse in a variable

response=urllib2.urlopen(url+ip)

Step 5 : Get Data from response in a variable

data=response.read()

Step 6 : Get Data in JSON form in a variable

values=json.loads(data)

Step 7 : Showcase the Informations

print("IP: "+values["query"])
print("City: "+values["city"])
print("ISP: "+values["isp"])
print("Country: "+values["country"])
print("Region: "+values["region"])
print("Timezone: "+values["timezone"])

Full Code : Link

--

--

prkskrs
Catalysts Reachout

backend developer and data scientist. currently studying computer science and constantly learning!