Self-Hosting Free Google Translate API by Google Apps Script
This API calls LanguageApp.translate(text, sourceLanguage, targetLanguage)
POST https://script.google.com/macros/s/${your-script-id}/exec
Name | Type | Description |
---|---|---|
text |
string |
Required. |
target |
string |
Required. A list of language codes is available here |
source |
string |
If it is set to the empty string, the source language code will be auto-detected |
type |
string |
Supported values are 'text' (default) and 'html' |
curl -L -d "text=konjac&target=ja" https://script.google.com/macros/s/${your-script-id}/exec
{
"data": {
"translatedText": "コンニャク"
}
}