Hello World

吞风吻雨葬落日 欺山赶海踏雪径

0%

DeepLX

DeepLX 是一个开源项目,它基于 DeepL 免费服务,将其转换为 API 提供给第三方使用。

简介

DeepLX 是一个开源项目,项目GITHUB地址→DeepLX
以下是一些常用的glob模式以及它们的含义(参考链接):

相关信息
zhile 反代了DeepL服务,并且能完美绕过频率限制

注意
假如你发现用不了了,请手动访问一次接口地址,过一下CF的五秒盾 接口地址

接口调用

接口地址:

1
https://api.deeplx.org/translate

接口参数

1
2
3
text: 待翻译的文字
source_lang: 你当前提交的文字语言(可设置为"auto"自动识别)
target_lang: 你欲要翻译为的语言

调用示例:

Curl

1
2
3
4
5
6
7
curl --location 'https://api.deeplx.org/translate' \
--header 'Content-Type: application/json' \
--data '{
"text": "Hello, world!",
"source_lang": "EN",
"target_lang": "ZH"
}'

Python

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import requests
import json

url = "https://api.deeplx.org/translate"

payload = json.dumps({
"text": "Hello, world!",
"source_lang": "auto",
"target_lang": "ZH"
})
headers = {
'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

在沉浸式翻译使用

  1. 访问官网下载浏览器插件
  2. 点击设置 -> 开发者设置 -> 开启Beta测试特性
  3. 基本设置 -> 翻译服务选择DeepLX(Beta) -> API URL 填入 https://api.deeplx.org/translate

就可以直接使用了。