Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why am I getting 403 Forbidden "User Rate Limit Exceeded" while using the Google Translate API?

I just started using Google Translate API for the first time, yet my requests are denied due to 403 Forbidden "User Rate Limit Exceeded". How is this possible?? According to the cloud console, I have generated only a few requests, but they have all been errors. Here is a screenshot where I got that info:

enter image description here

Also, Google says that none of my quotas seem to be exceeded:

enter image description here

Seems impossible that I could be exceeding any quote from just 5 requests. How can I better understand why I'm getting "User Rate Limit Exceeded", and how to make it stop happening?

As far as I can tell, I was using the default quotas. I've never been able to successfully make a call (using the official Python library). I later slightly decreased the quota just for funzies (the default is the maximum allowed value), but that didn't help.

Here is the exact code that I used:

>>> import six
>>> from google.cloud import translate_v2 as T
>>> c = T.Client()
>>> t = "The rain in Spain."
>>> r = c.translate(t, target_language='es')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/allyourcode/.local/lib/python2.7/site-packages/google/cloud/translate_v2/client.py", line 268, in translate
    response = self._connection.api_request(method="POST", path="", data=data)
  File "/home/allyourcode/.local/lib/python2.7/site-packages/google/cloud/_http.py", line 483, in api_request
    raise exceptions.from_http_response(response)
google.api_core.exceptions.Forbidden: 403 POST https://translation.googleapis.com/language/translate/v2?prettyPrint=false: User Rate Limit Exceeded
like image 924
allyourcode Avatar asked Oct 20 '25 14:10

allyourcode


1 Answers

Figured it out! The problem was that the project was assigned to a defunct billing account. Unsurprisingly, by changing the billing account of the project to a non-defunct billing account, I was able to get a successful response to my requests. The error reason is pretty unhelpful!

like image 181
allyourcode Avatar answered Oct 23 '25 08:10

allyourcode



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!