Python Script to Integrate Google Translate API Without API Key to Translate Text in Languages
671 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 will show you a Google
0:04
translate uh example inside Python uh
0:08
for completely free we don't need to use
0:10
any sort of Google translate API this is
0:12
actually a third party module which
0:14
actually provides you with the Google
0:16
translate functionalities for completely
0:18
free so I've written this example right
0:20
here we have the original text in
0:22
English language which is simply uh
0:26
original text is good morning so we need
0:28
to translate this text in various
0:30
languages so we have basically created
0:32
this uh object here which contains
0:34
German French Spanish Hindi Japanese
0:37
Chinese Arabic Russian Italian and
0:41
Portuguese and as I run this Python
0:43
script you will actually see this text
0:45
will be translated to all these
0:47
languages so as I run this script here
0:50
you will see Python app py so you will
0:53
see the text will be translated in all
0:55
these languages one by one and you can
0:58
see that the original text was good
0:59
morning in English language and this is
1:02
in German language you can see French
1:04
Spanish Hindi Japanese Chinese Arabic
1:08
Russian Italian Portuguese so this
1:11
module I founded guys it doesn't require
1:14
any sort of API key you don't need to
1:16
use Google Translate API which actually
1:18
cost money this is actually a free
1:21
module in Python you can use if you are
1:23
building some kind of uh translating
1:26
application you can definitely use this
1:28
module the name of the module is uh deep
1:32
translate so if you basically
1:34
uh go to the command line you just need
1:37
to execute the command here which is
1:40
deep translate so let me just show you
1:44
uh I basically got this module using uh
1:47
chat GPT i basically was searching for a
1:50
free module which are actually translate
1:53
so the name of the module you can see
1:55
it's a deep
1:57
translator so if you go to your command
2:00
line simply type the command pip install
2:05
deep sorry deep dash translator so this
2:09
is actually the name of the module go to
2:11
the command line just execute this
2:13
command to install this module pip
2:15
install deep translator i have already
2:18
installed it so this will just take 5
2:20
seconds to install and now let me show
2:22
you the complete example so first of all
2:25
you just need to require this module so
2:28
deep
2:31
translator and from this we need to
2:33
import this method or class you may say
2:36
Google translator so as you can see we
2:39
actually write this line at the top here
2:42
which actually imports this module the
2:44
next thing you need to do you need to
2:46
actually write the text that needs to be
2:47
translated so I will say hello
2:52
uh my name is Cotam and I'm
2:55
from and I'm
2:57
a software engineer so this is actually
3:00
the original text that I will translate
3:02
to various languages and then you just
3:04
need to uh make an object here so
3:07
various languages you can
3:09
put so you just need to create an object
3:13
here
3:14
of various languages so twoletter digit
3:17
code for language here so for German
3:20
language we have de French we have fr
3:23
Spanish es Hindi it says hi so
3:27
similarly add more languages if you want
3:31
just add their two twolet digit code
3:34
like this and after that this module
3:37
allows you to actually we will first of
3:40
all print out the original
3:43
text and then after that we will simply
3:45
run a simple for
3:48
loop for language name and the language
3:51
code in the different languages that we
3:55
define
3:56
languages dot items and we will loop
4:00
through and then we will simply create
4:03
use this class here which is Google
4:05
translator that we imported and this
4:08
class actually takes two attributes
4:10
first of all the source language which
4:12
in this case is English so you can see
4:15
we are translating from the English
4:17
language but you can translate with any
4:19
language it can be Hindi it can be
4:22
Spanish it can be German as well so so
4:24
the source language after that you
4:27
basically provide your target language
4:29
in which language you want to convert
4:31
your text so I will loop through so the
4:34
target here will be the language
4:36
code so one by one it contains this
4:39
function right here which is translate
4:42
so it will translate the text for you
4:44
we'll pass the text and then we will
4:47
simply show the language name and the
4:49
translated text in the output that's all
4:52
that we need to do and if I run this
4:54
Python script here you will see one by
4:57
one it will translate to all the
4:58
languages so this is German French
5:02
Spanish Hindi Japanese Chinese Arabic
5:06
Russian Italian Portuguese so you can
5:09
see guys how easy it is you can do this
5:12
unlimited number of times so there is no
5:14
kind of restriction you no don't need to
5:17
provide any API key you can completely
5:19
do this in free in Python using this
5:21
module so definitely use this module
5:24
guys i showed you a complete example
5:26
right
5:27
here of using the Google translate
5:30
feature inside your Python application
5:32
without having to sign up for any sort
5:35
of account you can do this for
5:37
completely free as you can see we
5:39
haven't used any API key but still we
5:42
can use the Google translate feature
5:44
inside Python so thank you very much for
5:46
watching this video and also check out
5:49
my website freemediatools.com
5:51
uh which contains thousands of
5:54
tools and I will be seeing you in the
5:57
next
#Foreign Language Resources
#Programming
#Software