"HTTPError: HTTP Error 404: Not Found" while using translation function in TextBlob

When I try to use translate function in TextBlob library in jupyter notebook, I get:

HTTPError: HTTP Error 404: Not Found

I have posted my code and screenshot of error message for reference here. This code worked well 5-6 days ago when I ran exactly the same code first time but after that whenever I run this code it gives me the same error message. I have been trying to run this code since last 4-5 days but it never worked again.

My code:

from textblob import TextBlob

en_blob = TextBlob('Simplilearn is one of the world’s leading certification training providers.')

en_blob.translate(to='es')  

I am new to stackoverflow and asking my first question on this plateform so please pardon me if I my question is not following rules of this platform.


Textblob library uses Google API for translation functionality in the backend. Google has made some changes in the its API recently. Due to this reason TextBlob's translation feature has stopped working. I noticed that by making some minor changes in translate.py file (in your folder where all TextBlob files are located) as mentioned below, we can get rid of this error:

original code:

url = "http://translate.google.com/translate_a/t?client=webapp&dt=bd&dt=ex&dt=ld&dt=md&dt=qca&dt=rw&dt=rm&dt=ss&dt=t&dt=at&ie=UTF-8&oe=UTF-8&otf=2&ssel=0&tsel=0&kc=1"

change above code in translate.py to following:

url = "http://translate.google.com/translate_a/t?client=te&format=html&dt=bd&dt=ex&dt=ld&dt=md&dt=qca&dt=rw&dt=rm&dt=ss&dt=t&dt=at&ie=UTF-8&oe=UTF-8&otf=2&ssel=0&tsel=0&kc=1"