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

推荐订阅源

罗磊的独立博客
I
InfoQ
雷峰网
雷峰网
Hugging Face - Blog
Hugging Face - Blog
IT之家
IT之家
云风的 BLOG
云风的 BLOG
有赞技术团队
有赞技术团队
Martin Fowler
Martin Fowler
MyScale Blog
MyScale Blog
The GitHub Blog
The GitHub Blog
博客园_首页
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
G
Google Developers Blog
WordPress大学
WordPress大学
B
Blog
人人都是产品经理
人人都是产品经理
小众软件
小众软件
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
量子位
Apple Machine Learning Research
Apple Machine Learning Research
N
Netflix TechBlog - Medium
Last Week in AI
Last Week in AI
博客园 - 聂微东
Jina AI
Jina AI

人生足迹 · 博客

沧元图 - 人生足迹 · 博客 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"
}'