随机(403)超出用户速率限制 [英] Random (403) User Rate Limit Exceeded

查看:203
本文介绍了随机(403)超出用户速率限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用翻译API翻译页面中的一些文本,这些文本是大型html格式文本,所以我必须开发一个功能,将这些文本分成小于4500个字符的小块(包括html标签),以避免限制为每个请求5000个字符,我还必须修改Google PHP API以允许通过POST发送请求。



我已经在Goole Developers中启用了付费版本的api Console,并将总配额改为每天50M字符和500个请求/秒/ urser。

现在我正在用脚本翻译整个文本数据库,它工作正常,但在一些随机点我重振错误(403)超出用户速率限制,我必须等待几分钟才能重新运行该脚本,因为当达到错误时,api一遍又一遍地返回相同的错误,直到我等了一段时间。

我不知道为什么它会一直返回错误,如果我没有通过请求的数量,就像它有一些亲属d每个时间间隔的最大特性或者其他...

解决方案

您可能超过您之前设置的配额限制:this是每日计费或每秒请求字符的限制。

要更改使用限制或请求增加配额,请执行以下操作:
1.转到Google Developers Console https://console.developers.google.com/
2.选择一个项目。
3.在左侧边栏中,展开APIs& AUTH。
4.点击API。
5.点击您感兴趣的已激活API的名称,即The Translate API。
6.在API的信息页面顶部附近,点击配额。


  • 如果您有帐单只需点击配额,它就会将您带到配额页面,您可以查看和更改与配额相关的设置。

  • 如果没有,点击配额显示有关适用于Translate API的任何免费配额和限制的信息。

I am using translate API to translate some texts in my page, those texts are large html formated texts, so I had to develop a function that splits these texts into smaller pieces less than 4500 characters (including html tags) to avoid the limit of 5000 characters per request, also I had to modify the Google PHP API to allow send requests via POST.

I have enabled the paid version of the api in Goole Developers Console, and changed the total quota to 50M of characters per day and 500 requests/second/urser.

Now I am translating the whole database of texts with a script, it works fine but at some random points I revive the error "(403) User Rate Limit Exceeded", and I have to wait some minutes to re-run the script because when reached the error the api is returning the same error over and over until I wait some time.

I don't know why it keeps returning the error if I don't pass the number of requests, it's like it has some kind of maximum chaaracters per each interval of time or something...

解决方案

You probably exceed the quota limits you set before: this is either the daily billable or the limit on the request characters per second.

To change the usage limits or request an increase to your quota, do the following: 1. Go to the Google Developers Console "https://console.developers.google.com/". 2. Select a project. 3. On the left sidebar, expand APIs & auth. 4. Click APIs. 5. Click the name of an activated API you're interested in "i.e. The Translate API". 6. Near the top of the info page for the API, click Quota.

  • If you have the billing enabled, just click Quota and it will take you to the quota page where you can view and change the quota-related settings.

  • If not, clicking Quota shows information about any free quota and limits that apply to the Translate API.

这篇关于随机(403)超出用户速率限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆