ZioMark's HUB | API Documentation
DiscordAbout Me
  • 🔳Introduction
    • 🔐Authentication
  • 🔲GET Endpoints
    • ▫️Dec to Hex
    • ▫️Hex to Dec
    • ▫️Timetamp to Date
    • ▫️CFX
    • ▫️Date
    • ▫️Date & Time Formatter
    • ▫️Text over Image
    • ▫️Image over Image
    • ▫️Weather
    • ▫️Translate
    • ▫️Convert Currency
    • ▫️Geolocation
    • ▫️QR Code Generator
    • ▫️Image Format Converter
    • ▫️Key Generator
    • 🌐Bored
    • ▫️BMI Calculator
    • ▫️VAT Calculator
    • ▫️SEO Analyzer
    • ▫️Local Time
    • ▫️Discount Calculator
    • ▫️Discount Discover
  • 🔲POST Endpoints
    • ▫️HTML to PDF
    • ▫️Loan Calculator
    • ▫️Excel to CSV
Powered by GitBook
On this page
  • /translate
  • Query Parameters
  • Example Usage
  • Example Response
  • Languages Supported
  1. GET Endpoints

Translate

This API endpoint allows you to translate text from one language to another using the MyMemory Translation API.

/translate

This endpoint translates text from one language to another based on the provided parameters. It accepts a GET request with query parameters including the text, fromLang, and toLang. If any of these parameters are missing, it returns a custom HTML page indicating missing parameters. If the translation is successful, it returns the original text along with its translation. If the translation fails or an error occurs, it returns a corresponding error message with a status code of 500.

Query Parameters

Parameter
Type
Description

text

string

The text to be translated.

fromLang

string

The language code of the text to be translated from.

toLang

string

The language code of the text to be translated to.

Example Usage

Translate "Hello, how are you?" from English to Spanish:

GET /translate?text=Hello how are you&fromLang=en&toLang=es

Example Response

{
  "originalText": "Hello, how are you?",
  "translatedText": "¡Hola, ¿cómo estás?"
}

Languages Supported

Go find all the language codes and their corresponding ISO 639-1 or RFC3066 codes online or in language code standards documentation.

PreviousWeatherNextConvert Currency

Last updated 1 year ago

🔲
▫️