Translation API V2 - max character limit changed

1,807 views
Skip to first unread message

Dominik Opala

unread,
Dec 16, 2021, 10:18:13 AM12/16/21
to Google Cloud Translation API
Hi,

We've been using Google Cloud translations for many months now. But since last Monday, we've noticed that when pushing any text with more than 30000 characters, it fails with this error:

Google.GoogleApiException: Google.Apis.Requests.RequestError
The service is unavailable at this time. [503]
Errors [
Message[The service is unavailable at this time.] Location[ - ] Reason[backendError] Domain[global]
]

This didn't happen before, we have a logic that splits text for translation into parts when it exceeds 90000 characters. That was working fine (we were able to translate text much longer than 30000 characters) but since last Monday we can only successfully translate text shorter than 30000 characters. 

If we are exceeding any limits, I would expect to get 403 error, like in the documentation:

"If you exceed your quota, Cloud Translation returns a 403 error. The error message states Daily Limit Exceeded if you exceeded a daily quota or User Rate Limit Exceeded if you exceeded a per minute quota." 

We use basic Cloud translations tier.

I would be really grateful for any ideas of what could have happened, were there any changes to Google Cloud API limits?

Thank you,
Dominik

 

Olu

unread,
Dec 16, 2021, 11:21:47 AM12/16/21
to Google Cloud Translation API
Typically, the Cloud Translation API is optimized for translating smaller requests and as indicated in this doc[0], it is recommended that the maximum length for each request is 5K characters(Codepoints).

With that being said, if the Translation API V3 is a consideration for your use-case, the batchTranslateText Method[1] is optimized for handling large texts as yours.

[0]https://cloud.google.com/translate/quotas#content
[1]https://cloud.google.com/translate/docs/reference/rest/v3/projects.locations/translateText
Reply all
Reply to author
Forward
0 new messages