Translate

Translate a text into the specified language.

NodeJS

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

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:

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

Last updated