Dynamically translate between languages using Google machine learning
Go to siteGoogle Cloud Translate API can be used to build applications that can translate between languages. Some examples of applications that can be built using Google Cloud Translate API include:
import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
google_cloud_translate: {
type: "app",
app: "google_cloud_translate",
}
},
async run({steps, $}) {
const data = {
"q": `¡hola mundo!`,
"target": `en`,
}
return await axios($, {
method: "post",
url: `https://translation.googleapis.com/language/translate/v2?key=${this.google_cloud_translate.$auth.api_key}`,
headers: {
"Content-Type": `application/json`,
"charset": `utf-8`,
},
data,
})
},
})
Google Cloud Translate uses API keys for authentication. When you connect your Google Cloud Translate account, Pipedream securely stores the keys so you can easily authenticate to Google Cloud Translate APIs in both code and no-code steps.
To create an API key, your account must be granted the primitive Editor role (roles/editor
) on the current project. For more information, see primitive roles.
To create an API key: