• Skip to main content
  • Skip to secondary menu
  • Skip to primary sidebar
  • Skip to footer
  • Home
  • Crypto Currency
  • Technology
  • Contact
NEO Share

NEO Share

Sharing The Latest Tech News

  • Home
  • Artificial Intelligence
  • Machine Learning
  • Computers
  • Mobile
  • Crypto Currency

Create a Google Cloud Translation REST API Service

January 25, 2021 by systems

Sandeep Pamidamarri
Google Translation Service

In this particular post, you will learn to create and use the Google cloud translation REST API service. It is a pre-trained model over 100 languages to translate the data. Translation API helps web and mobile applications contents to translate content from one language to another language.

  1. Set-up google cloud account

Step 1: Enable Cloud Translation API

Enable the cloud translation API in the google developer console.

Step 2: Create a Google Service Account to access API

In the google cloud console, search for IAM & Admin and click on the service accounts. Create a Google Service Account with Cloud Translation API Editor role.

Generate the Key.json for the for the generated google service account

Step 3: Access the Google Cloud shell to invoke Translation API

In the top-right corner, click in the cloud shell. Cloud shell is a google provided Linux playground environment.

Access the cloud shell. Upload the generated key.json and export the GOOGLE_APPLICATION_CREDENTIALS as shown below.

export GOOGLE_APPLICATION_CREDENTIALS='key.json'

Note: If it doesn’t work, then provide the complete file path.

Step 4: Test the Google Translation Service in Cloud Shell

Create the request.json file as follows. Google translation service automatically identifies the source language.

In the following example, you are converting the source text to the target language Hindi.

{"q": ["How are you feeling today"],"target": "hi"}

Use the curl command to hit the Translation API endpoint

$ curl -X POST -H "Authorization: Bearer "$(gcloud auth application-default print-access-token) -H "Content-Type: application/json; charset=utf-8" -d @request.json https://translation.googleapis.com/language/translate/v2

Output

You can test the same using postman as well.

Congratulations 🙂 Now you successfully learned how to create and use the Google Cloud Translation API service.

Filed Under: Artificial Intelligence

Primary Sidebar

Stay Ahead: The Latest Tech News and Innovations

Cryptocurrency Market Updates: What’s Happening Now

Emerging Trends in Artificial Intelligence: What to Watch For

Top Cloud Computing Services to Secure Your Data

The Future of Mobile Technology: Recent Advancements and Predictions

Footer

  • Privacy Policy
  • Terms and Conditions

Copyright © 2025 NEO Share

Terms and Conditions - Privacy Policy