Python 3 Script to Extract & Track Sim Card & Carrier Details Using Mobile Number and Save as JSON
548 views
Jun 3, 2025
Get the full source code of application here: https://codingshiksha.com/python/python-3-script-to-extract-track-sim-card-carrier-details-using-mobile-number-and-save-as-json/
View Video Transcript
0:00
uh hello guys welcome to this video so
0:02
in this video I will show you how to
0:04
track uh the phone number inside your
0:08
Python so you can actually track uh the
0:11
SIM card details the
0:14
carrier all company as well using the
0:16
phone number so here you just need to
0:18
specify the 10digit mobile number
0:20
alongside with the country code and then
0:23
this module inside Python which is
0:26
called as phone numbers will actually
0:28
tell you the information regarding that
0:29
mobile number such as the SIM card
0:31
details and the carrier information as
0:33
well so let me show you a very simple
0:35
example i input my own number right here
0:39
if you see that and as soon as I run the
0:42
script here it will
0:44
actually save all this information
0:46
inside a JSON file so you will see SIM
0:50
card details saved to SIM details.json
0:53
so it actually creates a file right here
0:55
sim details.json and as soon as you open
0:58
this file it will return you the
1:00
information regarding that phone number
1:02
such as the mobile
1:04
number if it's a valid number or not so
1:07
it's a valid number the region belongs
1:09
to India the carrier is ATAL company and
1:13
the time zone also returns Asia Kolkata
1:16
so you can similarly input any number
1:21
any valid number 10 digit number and it
1:24
will return out these details and
1:26
creates a simple JSON file every time
1:29
you run this Python script so you can uh
1:33
let me show you the module here uh if
1:36
you go to this
1:38
website just search for this Python
1:40
module which is phone numbers it's a
1:42
very famous module which
1:45
returns the SIM card details you can
1:48
track your phone number every detail so
1:52
just install this module and after
1:54
installing it let me show you how to use
1:57
it so the full script is given in the
1:59
description of this video so if you need
2:01
to get the full script the link is given
2:03
in the description so first of all we
2:06
import the phone numbers module then we
2:09
also need to import the JSON module for
2:11
saving the information in a JSON file
2:14
and then from this module from phone
2:16
numbers we need to import the geocoder
2:19
and the
2:21
carrier after that we also need to
2:24
import the time zone as well to get all
2:26
this information after that we specify
2:29
the
2:30
number which should include your country
2:33
code as well so + 9 for India so then we
2:36
input in input my
2:38
number and then after that first of all
2:41
we need to parse this
2:44
number for parsing this number we have
2:47
this function which is parse so here we
2:49
will simply pass your number it will
2:51
pass your number and then for getting
2:54
the details we need to specify a object
2:58
sim data and inside this object we will
3:01
specify various properties first of all
3:03
your number second of all the if it's a
3:07
valid number or not so we have this true
3:10
or
3:11
false
3:13
so this contains phone numbers dot is
3:17
valid you'll see inside this drop-down
3:20
so this contains all these functions
3:22
that this module contains so we have
3:27
this is valid number so it will return
3:29
either true or false depending upon
3:31
whether this number exist or not so this
3:34
is really important to
3:37
do whether it's a real number or not so
3:40
in this way you can detect that after
3:42
that now to get the region information
3:45
so this geooder module from this we will
3:49
call this and then it contains this
3:52
function which is
3:53
description for number so now it will
3:56
return you the address of this number
3:59
where this number is located so
4:02
here we need to put get the information
4:05
in English language and then then we
4:08
also can actually get the information
4:11
regarding which company this mobile
4:13
number belong to which is the
4:16
carrier so carrier name for number so it
4:21
will return you the number of the
4:23
company so parse number again English
4:26
language and then lastly we can even get
4:29
the time zone so which time zone this
4:31
number belongs to so we for this we use
4:34
the time zone information which is time
4:37
zone for
4:39
number that's all so this contains this
4:42
five information number you can see now
4:45
we just need to save this information in
4:47
a JSON file for saving it we simply use
4:50
the open function and we create a simple
4:53
file which is sim
4:57
details dojson and open it in write
5:03
mode and then we simply call this
5:06
function json dot
5:09
dump like this and then we can print out
5:12
a statement that sim card details saved
5:14
to this file so now what I will do I
5:17
will delete this file and uh again run
5:20
the script so as soon as I run the
5:23
script you will see on the left hand
5:24
side the file will be created and you
5:27
can check this for any number you can
5:29
see again it
5:32
returns let me change the number here i
5:35
provide any other random
5:37
number it just need to be 1 2 3 4 5 6 7
5:41
8 9 10
5:43
so again you will run
5:47
this you will
5:50
see now you will see the carrier is
5:52
different because it's a different
5:54
number so you can see the script works
5:56
for all the numbers you can check any
5:58
number in the world just put the country
6:01
code and then the 10digit mobile number
6:03
and then it will return you the
6:05
information regarding this number so I
6:08
just tested this module this module
6:10
works every time so you can definitely
6:12
install it and start using it and if you
6:14
need the script the link is given in the
6:17
description so thank you very much for
6:18
watching this video uh please hit that
6:20
like button subscribe the channel and
6:23
also check out my website
6:25
freemediattools.com
6:27
uh which contains thousands of tools
#Mobile & Wireless
#Mobile Phones
#Phone Service Providers