# Google Translate API

> Google Translate returns translated text, pronunciation, and alternatives as a workflow and API.

Google Translate’s Translate text method returns translations, language details, pronunciation when shown, and alternatives when available. It needs text and a target language; specify the source language or use auto-detect.

- Page: https://fous.com/workflows/google-translate
- Handle: `@google-translate`
- Category: [Productivity](https://fous.com/workflows/category/productivity)
- Source website: https://translate.google.com
- Last verified: Sep 29, 2026
- Fous is not affiliated with Google Translate.

## Methods

### Translate text

Operation `translate_text`, version 1. 1 credit per call.

Translate up to 5,000 characters on Google Translate. Includes detected source language, Latin-letter pronunciation when shown, and dictionary alternatives when available.

**Input**

| Field | Type | Required | Example | Description |
|---|---|---|---|---|
| `text` | string | yes | `"Good morning"` | Text to translate, for example Good morning. |
| `source_language` | string | no | `"English"` | Language name or code of the text, or auto-detect, for example English or auto-detect. |
| `target_language` | string | yes | `"Japanese"` | Language name or code to translate into, for example Spanish or es. |

**Input schema**

```json
{
  "type": "object",
  "required": [
    "text",
    "target_language"
  ],
  "properties": {
    "text": {
      "type": "string",
      "maxLength": 5000,
      "description": "Text to translate, for example Good morning.",
      "examples": [
        "Good morning",
        "bank",
        "こんにちは"
      ]
    },
    "source_language": {
      "type": "string",
      "default": "auto-detect",
      "description": "Language name or code of the text, or auto-detect, for example English or auto-detect.",
      "examples": [
        "English"
      ]
    },
    "target_language": {
      "type": "string",
      "description": "Language name or code to translate into, for example Spanish or es.",
      "examples": [
        "Japanese",
        "French",
        "English"
      ]
    }
  },
  "additionalProperties": false,
  "examples": [
    {
      "text": "Good morning",
      "target_language": "Japanese"
    },
    {
      "text": "bank",
      "source_language": "English",
      "target_language": "French"
    },
    {
      "text": "こんにちは",
      "target_language": "English"
    }
  ]
}
```

**Output**

| Field | Type | Example | Description |
|---|---|---|---|
| `pronunciation` | string or null | `"Ohayō"` | Latin-letter pronunciation of the translated text, if shown. |
| `source_language` | string | `"English"` | Detected or chosen source language name. |
| `target_language` | string | `"Japanese"` | Target language name. |
| `translated_text` | string | `"おはよう"` | Translated text. |
| `source_language_code` | string | `"en"` |  |
| `target_language_code` | string | `"ja"` |  |
| `alternative_translations` | array |  | Other translations shown for words or short phrases. |
| `alternative_translations[].word_type` | string | `"interjection"` |  |
| `alternative_translations[].alternative` | string | `"お早うございます!"` |  |

**Example input**

```json
{
  "text": "Good morning",
  "target_language": "Japanese"
}
```

**Example output**

```json
{
  "pronunciation": "Ohayō",
  "source_language": "English",
  "target_language": "Japanese",
  "translated_text": "おはよう",
  "source_language_code": "en",
  "target_language_code": "ja",
  "alternative_translations": [
    {
      "word_type": "interjection",
      "alternative": "お早うございます!"
    }
  ]
}
```

## Quick start

Call the API with a Fous API key (`FOUS_API_KEY`). To create one, turn on Developer mode in Fous Studio, then open Keys & connections → API keys (https://app.fous.com/keys).

```bash
# First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
: "${FOUS_API_KEY:?Set FOUS_API_KEY before running this example}"

curl 'https://api.fous.com/v1/query' \
  --fail-with-body --silent --show-error --max-time 120 \
  -H "Authorization: Bearer $FOUS_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "api": "@google-translate",
  "visibility": "public",
  "operation": "translate_text",
  "version": 1,
  "input": {
    "text": "Good morning",
    "target_language": "Japanese"
  },
  "response": {
    "format": "json"
  }
}'
```

```python
# Save as fous.py and run with python3 fous.py. No packages needed.
# First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
import json
import os
import urllib.error
import urllib.request

api_key = os.environ.get("FOUS_API_KEY")
if not api_key:
    raise RuntimeError("Set FOUS_API_KEY before running this example")

body = json.loads("{\n  \"api\": \"@google-translate\",\n  \"visibility\": \"public\",\n  \"operation\": \"translate_text\",\n  \"version\": 1,\n  \"input\": {\n    \"text\": \"Good morning\",\n    \"target_language\": \"Japanese\"\n  },\n  \"response\": {\n    \"format\": \"json\"\n  }\n}")
request = urllib.request.Request(
    "https://api.fous.com/v1/query",
    data=json.dumps(body).encode("utf-8"),
    headers={
        "Authorization": f"Bearer {api_key}",
        "Content-Type": "application/json",
    },
    method="POST",
)
try:
    with urllib.request.urlopen(request, timeout=120) as response:
        result = json.load(response)
except urllib.error.HTTPError as error:
    raise RuntimeError(f"HTTP {error.code}: {error.read().decode('utf-8', errors='replace')}") from error
if result.get("success") is False:
    raise RuntimeError(result.get("error", {}).get("message", "Request failed"))
print(json.dumps(result["data"]["output"], indent=2))
```

```typescript
// Save as fous.mts and run with npx tsx fous.mts.
// First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
const apiKey = process.env.FOUS_API_KEY;
if (!apiKey) throw new Error("Set FOUS_API_KEY before running this example");

const response = await fetch("https://api.fous.com/v1/query", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${apiKey}`,
    "Content-Type": "application/json",
  },
  signal: AbortSignal.timeout(120_000),
  body: JSON.stringify({
  "api": "@google-translate",
  "visibility": "public",
  "operation": "translate_text",
  "version": 1,
  "input": {
    "text": "Good morning",
    "target_language": "Japanese"
  },
  "response": {
    "format": "json"
  }
}),
});
type ApiResult = { success: boolean; data?: { output: unknown }; error?: { message: string } };
const result: ApiResult = await response.json();
if (!response.ok || result.success === false) {
  throw new Error(result.error?.message ?? `HTTP ${response.status}`);
}
if (!result.data) throw new Error("Missing API response data");
console.log(result.data.output);
```

Or describe the data in plain language: send `{"api":"@google-translate","prompt":"Describe the data you need, with every detail"}` to the same URL. Fous fills in the input, runs the method that fits and returns only the fields you asked for; `data.route.calls[].request` is the exact call it made. Routing is free; the run costs the same.

## Use cases

- Translate customer messages into a target language
- Check pronunciation of translated text
- Compare alternative translations for short phrases
- Identify the detected source language

## FAQ

### Is Fous affiliated with Google Translate?

No. Fous is not affiliated with Google Translate. This workflow reads the public translate.google.com website and returns its data.

### How much does it cost?

Each run costs 1 credit. With pay-as-you-go, a credit costs 1¢; monthly plans cost less per credit.

### Do I need a Google Translate account?

No. You only need a Fous account.

### How current is the data?

Fous gets the data from translate.google.com when you run it; repeating the same request within a day may return the saved result. Fous checks this workflow automatically; it last passed a check on Sep 29, 2026.

### How can I translate text into another language?

Use Translate text with the text and target language. Specify the source language or use auto-detect.

### What language was the text written in?

Translate text returns the detected or chosen source language.

### Are there alternative translations for a phrase?

Translate text returns dictionary alternatives when available.

## Related

- [DeepL API](https://fous.com/workflows/deepl.md): Translate text with DeepL.
- [YouTube API](https://fous.com/workflows/youtube.md): YouTube returns public video, caption, comment, channel and upload details, plus the latest weekly Top Songs chart; inferred dates and some counts may be approximate.
- [Cambridge Dictionary API](https://fous.com/workflows/cambridge-dictionary.md): Cambridge Dictionary provides English definitions, examples, grammar labels, and available UK and US pronunciations, plus translations and paired examples for supported languages, reflecting details shown on its pages.
- [WordReference API](https://fous.com/workflows/wordreference.md): Dictionary translations and language reference.
- [Google Search API](https://fous.com/workflows/google-search.md): Google Search returns public web, image, job, event, related-question, and autocomplete results in Google’s order, with answers and details when available; results may be fewer, omit information, or be empty.
- [Google Maps API](https://fous.com/workflows/google-maps.md): Google Maps returns nearby places, public place details, up to 100 public reviews, and up to three routes; transit options vary by departure time.
- [Google Finance API](https://fous.com/workflows/google-finance.md): Google Finance returns possibly delayed prices and figures, indexes, up to four movers timed by oldest quote, currency conversions, and up to five financial periods.
- [Google Flights API](https://fous.com/workflows/google-flights.md): Google Flights returns route schedules, public fares, monthly lowest prices, and flight or destination options with times, stops, emissions, and fares that may change.
- [All Productivity workflows](https://fous.com/workflows/category/productivity)
