Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Google Cloud Translate API

Hi,

i am use free trails of Google Cloud Translate send request on this URL  https://translation.googleapis.com/language/translate/v2 with API key with body row

q:  Discovering Supported Languages,
source: en,
target:ar,
format:text

get error response kindly see below


"code": 403,
"message": "The request is missing a valid API key.",
"errors":

"message": "The request is missing a valid API key.",
"domain": "global",
"reason": "forbidden"
"status": "PERMISSION_DENIED"

Solved Solved
0 7 6,872
1 ACCEPTED SOLUTION

Hi, mjunaid,

The key you're using might not have the permission to use Translate APIs.

To fix this:

  1. Go to the Google Cloud Platform console
  2. Choose your project from the drop-down menu in the top bar
  3. Go to API & Services > Library
  4. Search for Cloud Translation API and click on it
  5. Enable it
    comaro_0-1668532342605.png
  6. Go to API & Services > Credentials
  7. Select the key you are using in your Android App
  8. From the menu called Restrict key, choose Cloud Translation API
  9. Save your edit.

Now the APIs should work properly.

Additionally, please note that the documentation mentions that the structure of the HTTP method should be something like:

https://translation.googleapis.com/language/translate/v2?key=[yourAPIkey]&target=language

View solution in original post

7 REPLIES 7

Hi, mjunaid,

The key you're using might not have the permission to use Translate APIs.

To fix this:

  1. Go to the Google Cloud Platform console
  2. Choose your project from the drop-down menu in the top bar
  3. Go to API & Services > Library
  4. Search for Cloud Translation API and click on it
  5. Enable it
    comaro_0-1668532342605.png
  6. Go to API & Services > Credentials
  7. Select the key you are using in your Android App
  8. From the menu called Restrict key, choose Cloud Translation API
  9. Save your edit.

Now the APIs should work properly.

Additionally, please note that the documentation mentions that the structure of the HTTP method should be something like:

https://translation.googleapis.com/language/translate/v2?key=[yourAPIkey]&target=language

Thanks

İlk defa sizin sayenizde sorunumu çözdüm çok teşekkür ederim.

THank,
I actived the API and Rectriction but I have the same error

Thanks for informative article. This is one of the best resource I have found in quite sometime
Google Cloud Training.

@mjunaid I use Google's translate api service in my Translate.How project, sometimes I get access errors. All permissions were given. I don't know if there is a problem with API overlap. I make at least 40 multiple connections per second.

I wanted to use google API for tranlation of english language to balochi. In June 2024 Google announced its support for balochi language. Please let me know, how to do it.