> For the complete documentation index, see [llms.txt](https://cloudbrowser.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cloudbrowser.gitbook.io/docs/configurations/ai-functions/translate.md).

# Translate

### NodeJS

```javascript
const text = await getText("http://www.cloudbrowser.ai", "h1");

if (!text) return;

const rp = await ai.translate({
  text: text,
  isoLang: "ES",
});

console.log(rp.response);
```

### .NET

```csharp
var text = await GetText("http://www.cloudbrowser.ai","h1").ConfigureAwait(false);

if (text == null) return;

var rp = await ai.Translate(new() {
  Text=text,
  IsoLang="ES"
}).ConfigureAwait(false);

Console.WriteLine("{0}", rp.Response);
```

### **/api/v1/ai/Translate – Translate Text into a Specified Language**

**Method**:\
`POST`

**Parameters**:

* `text`: *(string)* – The text to translate.
* `isoLang`: *(string)* – The ISO language code for the target language (e.g., `fr` for French).
* `responseFormat`: *(string)* – The format of the response (e.g., `text`, `json`).

**Request Example**:

```bash
curl -X POST https://production.cloudbrowser.ai/api/v1/ai/Translate \
-H "Content-Type: application/json" \
-d '{
  "text": "Hello, world!",
  "isoLang": "fr",
  "responseFormat": "text"
}'
```
