Search code examples
cloudgoogle-translation-api

'Maximum string size to be translated by google API'


I have a text in string format (+30000000 characters). I'm using python, code is ready, but can Google translate API (paid) translate it all at once?


Solution

  • As per the documentation of "Quotas & Limits" of the Cloud Translation API:

    The recommended max length for each request is 2K

    and the API will reject very large requests (with a 400 INVALID_ARGUMENT error) regardless of the available quota. Thus you'll have to split your text into different files for the translation requests.