Google Translate is a multilingual neural machine translation service developed by Google, to translate text, documents and websites from one language into another. We can use the Google Translate API to import data from Google Translate into Google Sheets. In this tutorial, we’ll show you how to connect the Google Translate API to Google Sheets in 5 steps:
To pull data from the Google Translate API into Google Sheets, first install and open the Apipheny Google Sheets add-on.
Apipheny is a no-code API integrator for Google Sheets that you can use to make unlimited API requests, connect to unlimited APIs, save API requests, schedule API requests, and more.
1. Install Apipheny by opening the following link on desktop and then clicking the Install button on the page: https://apipheny.io/install
2. After you’ve installed Apipheny, open a Google Sheet and then click on the Add-Ons or Extensions option in the top menu. In the add-ons menu, you should see Apipheny.
Click Apipheny > Import API to open the Apipheny sidebar in your Google Sheets.
Next, go to this page: https://rapidapi.com/googlecloud/api/google-translate1
Then scroll down until you see the X-RapidAPI-Key field:
Copy and paste the value of your API key to a safe location because you’ll need this key in the next steps.
After you copy the value of your API Key, click the “Subscribe to Test” button and on the next page, choose a subscription plan. The free plan is fine to start with:
In this section, we’ll show you how to browse the Google Translate API documentation to find the Google Translate API URL that retrieves the information you need from your Google Translate account. If you already know your API URL and endpoint, or you want to use the same example URL as us, just skip to Step 4.
First, open the Google Translate API documentation page: https://english.api.rakuten.net/googlecloud/api/google-translate1/endpoints
The menu on the left contains a list of three endpoints:
An example endpoint is Detect, which detects the language of the text within a request. This is the URL for this endpoint:
The documentation for each endpoint contains a short description of the endpoint’s purpose, its HTTP method (GET), a table with the accepted parameters’ names, types and descriptions and an example request made using various technologies, including cURL:
All API calls to the Google Translate API should be made to the https://google-translate1.p.rapidapi.com/language/translate/v2/ base domain. All endpoints should be appended to this base URL.
Now go back to your Google Sheet and make sure that the Apipheny add-on is open on the “Import” tab. With the Import tab open, enter these details into the add-on:
Method: At the top of the Apipheny sidebar, select the HTTP method (GET or POST) required by your API endpoint. For this example, we are using the GET method. The documentation specifies what method is required for each endpoint.
API URL: In Step 3, we explained how you can find the Google Translate REST API endpoint that you need. Now copy and paste your complete Google Translate API URL into the Apipheny add-on, where it says API URL Path, followed by any parameters required for your query (if applicable).
For this example, we are using the Languages endpoint, which returns a list of supported languages for translation. This is what the whole URL looks like:
Headers: In the Headers section of Apipheny, add three row with the following keys and values:
In the second head, you should replace <API_key> with the key that you previously obtained in Step 2. This is what our Google Translate API request looked like when entered into Apipheny:
Finally, the last step is to click the Run button at the bottom of the Apipheny add-on and then wait for the Google Translate API data to be imported into your Google Sheet. Here’s what our request looked like when completed:
After making a successful request to the Google Translate API, try querying a different Google Translate API endpoint, or try using one of the more advanced features in the Apipheny add-on, such as:
Constant Contact API
Facebook Graph API
Facebook Ads API
Google SERP API
Linkedin Ads API
Product Hunt API
Reddit Ads API
Riot Games API