Python 3 Script to Find & Test Internet Download & Upload Speed Using SpeedTest API Library
203 views
Jun 3, 2025
Buy the full source code of application here:
View Video Transcript
0:00
uh hello guys welcome to this video so
0:02
in this video I'll show you a Python
0:04
script which will find out your internet
0:06
uh download and upload speed of your
0:09
internet connection so I have written
0:11
this script here and if I run this
0:14
script now you will see it will take
0:16
some time and then it will you can see
0:18
it is testing your internet speed and
0:21
then it will return the download and
0:23
upload speed and also it will find out
0:26
the pink
0:28
all these three things will be returned
0:30
and it will be displayed in the terminal
0:32
and for this we are using the speed test
0:35
API library you can see download speed
0:38
is 255
0:40
uh Mbps upload is also 255 and ping is
0:44
5.95
0:46
and for this we are using the famous
0:48
speed
0:51
test library which is for by
0:54
OKLA the global broadband speed test
0:58
library so you have known this li uh
1:02
website it's a very popular website
1:04
which returns you the internet speed so
1:07
it also provides its own API as well so
1:10
we are simply using its API uh inside
1:13
the Python script to basically fetch all
1:16
this information so now
1:19
to install this so there is a package
1:23
here which is available if you just
1:25
write this package speed test simply
1:28
install this package speed
1:31
test and I think this is speed test CLI
1:34
yeah speed test- CLI this is actually
1:38
the module that we are using speed test
1:41
C cli yeah so simply install
1:45
this by this command i've already
1:47
installed it
1:49
so yeah so it's a command line interface
1:52
for testing the internet bandwidth using
1:55
this website
1:57
speedest.net so this is the website
2:00
which is by Okla yeah so after
2:03
installing this just make a simple app
2:05
dot py file and first of all import the
2:08
package speed test and then we just need
2:11
to define this function test
2:16
internet
2:18
speed and inside this function we will
2:22
initialize this speed test it contains
2:25
this function speed test and here you
2:27
need to specify the secure connection so
2:29
we are providing secure is equal to one
2:33
so after that we basically call this
2:35
function get best server so after
2:39
getting the best server it will test
2:41
your download and upload speed so we
2:44
create two variables download speed so
2:47
we will get the download speed by using
2:50
this function download and then we will
2:53
divide this
2:54
by this much of values
2:59
for converting it to Mbps and same for
3:02
upload speed as
3:05
well this is for upload again we will
3:08
divide this
3:12
by after getting we also get the ping as
3:15
well so results
3:18
dotping after getting all these three
3:20
information we will simply print this
3:22
information by using the print
3:24
statements so we just write the
3:28
print printing the download upload and
3:31
pink so now we simply call this function
3:36
simply calling this function you will
3:39
see so again if you run this script
3:43
now it
3:45
is just wait for five to 6 seconds for
3:49
it is testing your speed
3:52
so you don't need to go to the website
3:54
you can do this very easily using the
3:57
Python script then it will return you
3:59
the results here you'll see download
4:01
speed upload speed and the pink so this
4:03
is the Python script guys
4:06
so you can use this package and module
4:09
to test your internet bandwidth upload
4:12
and download speed using speed test API
4:15
uh thank you very much for watching this
4:17
video and also check out my website
4:19
freemediatetools.com
4:21
uh which contains thousands of tools
#ISPs
#Scripting Languages
#Web Services