惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

量子位
B
Blog
Last Week in AI
Last Week in AI
Jina AI
Jina AI
WordPress大学
WordPress大学
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
宝玉的分享
宝玉的分享
T
Tailwind CSS Blog
P
Proofpoint News Feed
酷 壳 – CoolShell
酷 壳 – CoolShell
Google DeepMind News
Google DeepMind News
U
Unit 42
雷峰网
雷峰网
J
Java Code Geeks
Apple Machine Learning Research
Apple Machine Learning Research
MongoDB | Blog
MongoDB | Blog
F
Fortinet All Blogs
美团技术团队
Y
Y Combinator Blog
腾讯CDC
B
Blog RSS Feed
T
The Blog of Author Tim Ferriss
Microsoft Azure Blog
Microsoft Azure Blog
Recent Announcements
Recent Announcements

人生足迹 · 博客

沧元图 - 人生足迹 · 博客 Matrix 家庭聊天室 - 人生足迹 · 博客 BitMagent - 种子市场 - 人生足迹 · 博客 Follow - 人生足迹 · 博客 (美国)电影分级制度 - MPAA - 人生足迹 · 博客 【弃用】沉浸式翻译 - 人生足迹 · 博客 应用图标 SVG - 人生足迹 · 博客 飞牛私有云 - 人生足迹 · 博客 LocalSend - 人生足迹 · 博客 边水往事 - 人生足迹 · 博客 网站监控服务 - 人生足迹 · 博客 哪吒监控 - 人生足迹 · 博客 SwitchHosts - 人生足迹 · 博客 Immich - 人生足迹 · 博客 PhotoPrism - 人生足迹 · 博客 独角数卡 - 人生足迹 · 博客 异次元店铺系统 - 人生足迹 · 博客 WSL2 - 人生足迹 · 博客 获取网站 Favicon - 人生足迹 · 博客
DeepLX API - 人生足迹 · 博客
qyg2297248353 · 2024-09-19 · via 人生足迹 · 博客

强大的 DeepL 翻译 API,您可以将 DeepLX 集成到任何应用程序中。

官网

DeepL 官网

https://www.deepl.com/

DeepLX

https://deeplx.owo.network/https://github.com/OwO-Network/DeepLX

安装教程

由于 Deepl API 网络问题,我们建议您自备网络代理。

通过 Docker-Compose

https://github.com/QYG2297248353/appstore-1panel/tree/custom/apps/deeplxhttps://git.lifebus.top/Ms-Studio/appstore-1panel/src/branch/custom/apps/deeplx

通过 1Panel 安装

安装第三方应用商店:Docker 应用商店 - 1Panel 版本

完成安装

API 端点

/translate

终端 - 免费版

模拟 DeepL iOS 客户端以发起翻译请求。不限次数,但在一定时间内频繁请求会导致 429 错误。

请求方式:POST

请求头部

标题 描述 价值
Content-Type 请求主体的内容类型。 application/json
Authorization 保护您的 API 所用的访问令牌。 Bearer your_access_token

请注意,如果无法通过 Authorization ,您也可以使用 URL 参数代替。例如, /translate?token=your_access_token

请求参数

参数 类型 描述 所需
text string 要翻译的文本。 true
source_lang string 源文本的语言代码。 true
target_lang string 您想要翻译成的语言代码。 true

请求响应

{
  "alternatives": [
    "Did you hear about this?",
    "You've heard about this?",
    "You've heard of this?"
  ],
  "code": 200,
  "data": "Have you heard about this?",
  "id": 8356681003,
  "method": "Free",
  "source_lang": "ZH",
  "target_lang": "EN"
}

/v1/translate

终端 - 专业版

模拟 DeepL Pro 账号以发起翻译请求。无限制,这可能有效地避免 429 问题,但你需要提供 Pro 账号的 dl_session 参数,否则无法使用。

请求方式:POST

请求头部

标题 描述 价值
Content-Type 请求主体的内容类型。 application/json
Authorization 保护您的 API 所用的访问令牌。 Bearer your_access_token

请注意,如果无法通过 Authorization ,您也可以使用 URL 参数代替。例如, /translate?token=your_access_token

请求参数

参数 类型 描述 所需
text string 要翻译的文本。 true
source_lang string 源文本的语言代码。 true
target_lang string 您想要翻译成的语言代码。 true

请求响应

{
  "alternatives": [
    "Did you hear about this?",
    "You've heard about this?",
    "You've heard of this?"
  ],
  "code": 200,
  "data": "Have you heard about this?",
  "id": 8356681003,
  "method": "Pro",
  "source_lang": "ZH",
  "target_lang": "EN"
}

/v2/translate

终端 - 官方版

模拟 DeepL 官方 API 发起翻译请求。不限次数,但在一定时间内频繁请求会导致 429 错误。

请求方式:POST

请求头部

标题 描述 价值
Content-Type 请求主体的内容类型。 application/json
Authorization 保护您的 API 所用的访问令牌。 Authorization: DeepL-Auth-Key [yourAccessToken]

请注意,如果您想同时传递两个参数,请用空格将它们分隔开。

请求参数

参数 类型 描述 所需
text string 要翻译的文本。 true
source_lang string 源文本的语言代码。 true
target_lang string 您想要翻译成的语言代码。 true

请求响应

{
  "alternatives": [
    "Did you hear about this?",
    "You've heard about this?",
    "You've heard of this?"
  ],
  "code": 200,
  "data": "Have you heard about this?",
  "id": 8356681003,
  "method": "Pro",
  "source_lang": "ZH",
  "target_lang": "EN"
}

集成

沉浸式翻译

不建议您使用 DeepLX 服务进行沉浸式翻译。这是因为沉浸式翻译会在短时间内发起大量请求,可能导致您的 IP 被 DeepL 封锁。

https://blog.lifebus.top/archives/a3a88e94-8add-4401-ac88-b8f935707857

cURL

可快速测试 API 是否正常,或临时使用。

curl -X POST http://localhost:1188/translate \
-H "Content-Type: application/json" \
-H "Authorization: Bearer your_access_token" \
-d '{
    "text": "Hello, world!",
    "source_lang": "EN",
    "target_lang": "DE"
}'