0

we are working with the Google Cloud - Translate API. We need to translate more than the 100.000 characters per 100 seconds. The limitations describes the "Maximum" values per 100 seconds.

  • Characters per 100 seconds per project: 1.000.000
  • Characters per 100 seconds per project per user: 100.000

We don't understand when the first limitation (1.000.000) is relevant for our requests. The translation api is called with an api key from our backend application. What is the meaning of "user" in this context and how to use the maximum of 1.000.000 characters per 100 seconds?

If we request more than 100.000 characters we got 403 userRateLimitExceeded.

Can someone explain?

Thank you!

EDIT: We want to use the translate api from our server application (php) without any user restrictions. Request code:

`$url = 'https://www.googleapis.com/language/translate/v2?key='.$apiKey.'&q='.rawurlencode($inputText).'&source='.$sourceLanguage.'&target='.$targetLanguage;
$handle = curl_init($url);
curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($handle);
$responseDecoded = json_decode($response, true);
$responseCode = curl_getinfo($handle, CURLINFO_HTTP_CODE);
curl_close($handle);`

For testing i setup the project quotas as follows: Conigured QUOTA

With the chrome postman plugin i tried several requests, but it is not possibile to translate more than 10 characters within 100 seconds. I thought that it should be possible to translate 30 characters within 100 seconds.

2 Answers2

0

You need the quotaID=userID parameter

See https://support.google.com/cloud/answer/7035610?hl=en for how to make your API requests from multiple users

Matt Wilbert
  • 376
  • 1
  • 8
  • Thank you for your answer. We read the page several times and made some tests but it still doesn't work. We will use the translate api from our server side application. Our target is to have NO restrictions. Google Support Page: "If you don't send the quotaUser parameter, then all calls are attributed to your server machines, in which case calls can't be capped by user." Unfortunately we understand that we shouldn't run in the quota limitations with current api call. https://translation.googleapis.com/language/translate/v2?key={key} – I WANT AN ELEPHANT May 27 '18 at 10:52
0

At the moment, quotas for API keys and similarly service accounts, are treated as user quota. Thus, explaining the 100 000 characters per 100 seconds limit. In the future, this may change per this feature request given that many users up-voted it (click Me too). Meanwhile, I suggest submitting a request to increase this specific quota per this FAQ.

Fady
  • 355
  • 1
  • 8
  • It's still not clear what that means and how to use the api in an scaleable application. We created 3 API Keys but unfortunately we can still request 100.000 characters tatal(!) within 100 seconds. I expected a limit of 300.000 characters (100.000 characters for each Key) There are similar questions on the google issue board - without a solution. https://issuetracker.google.com/issues/110057529 It seems to me that the google translate api can't be used in an enterprise application. I compared it with microsoft translate api -> pricing tiers with maxium characters of 10Billion charcters – I WANT AN ELEPHANT Jun 22 '18 at 18:34
  • Quotas in general are implemented to prevent abuse and to ensure an equitable distribution of the system resources. But most importantly, they are used to protect customers from accumulating charges, and usually can be increased when requested. Have you tried requesting an increase through this [link](https://console.cloud.google.com/iam-admin/quotas?service=translate.googleapis.com)? Select “Characters per 100 seconds per user”, and click "Edit Quota", provide all information needed and explain your use case. – Fady Jun 23 '18 at 23:07