简体   繁体   中英

Google translate API v2 - Showing 403 'Daily Limit Exceeded' error

I wanted to translate the Japanese character to English. But the bellow code is not giving any result. I tried with different api_key of different accounts. Code is like this:

from apiclient.discovery import build

API_KEY = '...'

print build(
    'translate', 'v2', developerKey=API_KEY,
).translations().list(
    q=u'こんにちは', source='ja', target='en',
).execute()

Showing following error massage:

googleapiclient.errors.HttpError: <HttpError 403 when requesting https://www.googleapis.com/language/translate/v2?q=%E3%81%93%E3%82%93%E3%81%AB%E3%81%A1%E3%81%AF&source=ja&alt=json&target=en&key=API_KEY returned "Daily Limit Exceeded. The quota will be reset at midnight Pacific Time (PT). You may monitor your quota usage and adjust limits in the API Console: https://console.developers.google.com/apis/api/translate/quotas?project=906333222111">

I enabled the translate api . But I not did anything with billing account . I think it is not necessary( Google Translate API has default limits of 2 million characters/day and 10,000 characters per 100 seconds (average 100 characters/second) ).

他们还会在“结算”部分检查域使用情况。

Daily Limit Exceeded

Means that you have exceeded the number of requests you are allowed to make to that API per day. You cant make any more requests to the API until midnight Pacific Time (PT).

Answer: There is no free Google translate API you need to enable billing. FAQ: Is there a free quota .

Is there any free quota?
No, the Google Translate API is only available as a paid service. Please see Pricing and Support for more details. However we do offer the Google Website Translator gadget , which will translate your website without charge.

To enable billing for your project, do the following:

  1. Go to the project settings page. If prompted, select a project or create a new one.
  2. In the Billing section, click Enable billing.
  3. If you do not have a billing account, create one.
  4. Select your location, fill out the form, and click Submit and enable billing.

Pricing documentation: Pricing

Important: Google Translate API v2 requires billing information for all accounts before you can start using the service. See instructions below on how to enable billing.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM