上传者: 42151772
|
上传时间: 2021-11-07 12:28:42
|
文件大小: 385KB
|
文件类型: -
自由翻译
| |
免费和开源机器翻译 API,完全自托管。 与其他 API 不同,它不依赖专有提供商(如 Google 或 Azure)来执行翻译。
|
API 示例
要求:
const res = await fetch ( "https://libretranslate.com/translate" , {
method : "POST" ,
body : JSON . stringify ( {
q : "Hello!" ,
source : "en" ,
target : "es"
} ) ,
headers : { "Content-Type" : "application/json" }
} ) ;
console . log ( await res . json ( ) ) ;
回复:
{
"translatedText" : "