# 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/tools/google-translate
- Handle: `@google-translate`
- Category: [Productivity](https://fous.com/tools/category/productivity)
- Source website: https://translate.google.com
- Last verified: Sep 29, 2026

## Methods

### Translate text

Operation `translate_text`, version 1. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.

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

Replace `YOUR_API_KEY` with a Fous API key. To create one, open Developers at the bottom of Fous Studio, turn on Developer mode, then go to API keys (https://app.fous.com/keys). Change the values in `input` to run the same tool on new data.

```bash
curl 'https://api.fous.com/v1/query' \
  --fail-with-body --silent --show-error --max-time 180 \
  -H "Authorization: Bearer YOUR_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.
import json
import urllib.error
import urllib.request

api_key = "YOUR_API_KEY"

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=180) 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.
const apiKey = "YOUR_API_KEY";

const response = await fetch("https://api.fous.com/v1/query", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${apiKey}`,
    "Content-Type": "application/json",
  },
  signal: AbortSignal.timeout(180_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);
```

## Use from an AI assistant

Connect this tool to Claude Code, Claude Desktop, Cursor, VS Code, Codex and any MCP client as its own MCP server. Each method is a typed tool whose arguments are the method’s input.

- Server URL: `https://api.fous.com/mcp/tools/google-translate`
- Authorization: `Authorization: Bearer <Fous API key>`

**Tools**

- `translate_text`: Translate text. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.
- `fous_get_run`: the result of a run that was still going, by its `request_id`. Free.

Claude Code:

```bash
claude mcp add --scope user --transport http fous-google-translate https://api.fous.com/mcp/tools/google-translate --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"
```

To give the assistant every tool, connect `https://api.fous.com/mcp`: it finds one with `fous_search_tools` and runs it with `fous_run_tool`. Setup for other clients: https://fous.com/llms-full.txt.

## 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

### Can I run it with my own inputs?

Yes. Change the inputs in Studio and press Run, or send new inputs from your code, or ask a connected AI assistant.

### Can I call this Google Translate tool as an API?

Yes. Send a POST request to /v1/query with your Fous API key and the inputs, and get JSON back.

### How much does it cost?

Each completed run costs 1 credit. Failed runs without a completed receipt are free; completed work can remain charged if delivery is interrupted. 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. Some results are reused for up to 24 hours, and results that use your account or key are never reused. It was last verified 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/tools/deepl.md): Translate text with DeepL.
- [Cambridge Dictionary API](https://fous.com/tools/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/tools/wordreference.md): Dictionary translations and language reference.
- [YouTube API](https://fous.com/tools/youtube.md): YouTube returns public video, caption, comment and channel details, company channels, and the latest weekly Top Songs chart; inferred dates and some counts may be approximate.
- [Google Search API](https://fous.com/tools/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/tools/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/tools/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/tools/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 tools](https://fous.com/tools/category/productivity)
