nidhaloff / deep-translator

A flexible free and unlimited python tool to translate between different languages in a simple way using multiple translators.
https://deep-translator.readthedocs.io/en/latest/?badge=latest
Apache License 2.0
1.55k stars 177 forks source link

Character limit or request limit while using Google Translate using deep-translator #263

Open karimkhanc opened 3 months ago

karimkhanc commented 3 months ago

Code

translated = GoogleTranslator(source='auto', target='german').translate(text=text)

# Alternatively, you can pass languages by their abbreviation:
translated = GoogleTranslator(source='en', target='de').translate(text=text)

I tried few examples with Google Translator, which works fine. But if I use this package in production,

  1. Is there any character limit while sending the request. I see 1800-2000 character limit ( https://stackoverflow.com/questions/18754905/google-translate-api-cannot-send-more-than-2000-characters-per-request ) but is there any specific limit from deep-translator documented
  2. IS there any limit in numbers of request to be sent in particular time frame or day

Any help on this is much appreciated.

ssb22 commented 3 months ago

Google has a page about their quotas here: https://cloud.google.com/translate/quotas

SalehDehqanpour commented 3 months ago

Google has a page about their quotas here: https://cloud.google.com/translate/quotas

Those APIs (unlike deep-translator) require API key from google. Are you sure the same limits apply here?

ssb22 commented 3 months ago

@SalehDehqanpour good point: deep-translator is using the endpoint https://translate.google.com/m (source: deep_translator/constants.py) and I wasn't able to find any confirmation on Google's site that this endpoint really is OK for third-party use. If it's not, then the limits are undocumented and it could stop working at any time.