Skip to content

Custom Translation API

The system will send application/www-urlencode data to the API address you provide via a GET request.

The following parameters will be included:

  • text: The text/string to be translated.
  • source_language: The language code of the original text (e.g., zh,en,ja,ko,ru,de,fr,tr,th,vi,ar,hi,hu,es,pt,it/string).
  • target_language: The language code of the desired translation language (e.g., zh,en,ja,ko,ru,de,fr,tr,th,vi,ar,hi,hu,es,pt,it/string).

The API is expected to return data in JSON format:

json
{
    code: 0, // 0 for success, >0 for failure
    msg: "ok", // "ok" for success, other messages for failure reasons
    text: "Translated text" // The translated text
}

For a free translation API based on Cloudflare and m2m100, see: https://github.com/jianchang512/translate-api