Home

Awesome

DeepLX Vercel

English | Русский

A free, serverless solution for DeepL translation API, allowing seamless integration with your applications. Deploy your own instance or run it locally as per your needs.

Features

Deploying on Vercel

Deploy your own DeepLX translation API by clicking the button below.

Deploy with Vercel

After clicking the button, simply follow the prompts to set up the API on Vercel.

Running Locally

Here is the local deployment method described in the deeplx-serverless repository from LegendLeo

git clone https://github.com/LegendLeo/deeplx-serverless
cd deeplx-serverless
npm install
npm run start

This will start a local server with the API running on http://localhost:9000.

Usage

Once deployed or running locally, you can start making requests to translate text. Make a POST request to /api/translate with the following JSON structure:

{
  "text": "Your text to translate",
  "source_lang": "Source language code (e.g., 'EN')",
  "target_lang": "Target language code (e.g., 'DE')",
  "tag_handling": "Optional tag handling ('html', 'xml', or leave blank)"
}

Parameters:

Example using curl:

curl --location --request POST 'https://your-deployment-url/api/translate' \
--header 'Content-Type: application/json' \
--data-raw '{
    "text": "Hello, World!",
    "source_lang": "EN",
    "target_lang": "DE",
    "tag_handling": ""
}'

Replace https://your-deployment-url with the actual URL of your Vercel deployment or http://localhost:9000 if you're running locally.

Response:

The API will respond with a JSON object containing the translation and additional information:

{
  "code": 200,
  "id": 1234567890,
  "data": "Hallo, Welt!",
  "alternatives": ["Hallo, Welt!"],
  "source_lang": "EN",
  "target_lang": "DE",
  "method": "Free"
}

Important Notes

For Ballon Translator users

After receiving the link in the format https://your-deployment-url/api/translate, just paste it into api_url.

image

For Auto-Update

Just in case I think of something clever, I borrowed sync.yml from drmartinmar/Deeplx-vercel. Thank you.

Thanks

Contributing

Contributions are welcome! If you have a suggestion or fix, please fork the repository and submit a pull request.

License

This project is open-sourced under the MIT license. See the LICENSE file for more details.