Trace Phone Number Details Using Python

Enter the phone number as input and get the relevant information about the number. Yes! you can trace phone number details just by writing few lines of python code.

Jayeeta Mondal
2 min readNov 17, 2021

To get the details of any number, we use an amazing python module known as phonenumbers. By using this phonenumbers module we can get the information about phone number like the country name to which the phone number belongs to, or the network service provider name of that phone number or the time zone of that phone number. If you want to know more about this pakage click here.

First, we need to install phonenumbers package before going to the coding part. The command for installing the package is:

pip install phonenumbers

Now It’s Time For Coding

import phonenumbers as ph
from phonenumbers import carrier
from phonenumbers import geocoder
from phonenumbers import timezone

phno = input("Enter phone number along with country code : ")
phno = ph.parse(phno)
print(timezone.time_zones_for_number(phno))
print(carrier.name_for_number(phno, "en"))
print(geocoder.description_for_number(phno, "en"))

So this is how you can use the phonenumbers module to find some of the basic details of a phone number using Python programming language.

I hope you liked this article & learn something new. If you have any question feel free to ask in the comment section below.

--

--

Jayeeta Mondal

Data Scientist || Freelancer || Open Source Contributor