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,913
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