Are you looking to integrate Google Translate into your website or application, but don’t want to break the bank? Look no further! In this article, we’ll show you how to get a Google Translate API key for free, and start translating your content in no time.
const axios = require('axios'); const apiKey = 'YOUR_API_KEY'; const text = 'Hello, world!'; const targetLanguage = 'es'; axios.get(`https://translation.googleapis.com/language/translate/v2?key=${apiKey}&q=${text}&target=${targetLanguage}`) .then(response => { console.log(response.data.data.translations[0].translatedText); }) .catch(error => { console.error(error); });
The Google Translate API is a powerful tool that allows developers to integrate Google’s machine translation capabilities into their applications. With the API, you can translate text from one language to another, detect the language of a piece of text, and even get the supported languages.
The good news is that Google offers a free tier for the Google Translate API, which allows you to make a limited number of requests per day. This is perfect for small projects, or for developers who want to test out the API.
You don't have credit card details available. You will be redirected to update payment method page. Click OK to continue.