- method:
POST
- url:
/translate
orhttps://translate-server-five.vercel.app/api/translate
- params: engine:
google
ordeepl
- body application/json:
{
"text": "Hello world",
"source_lang": "en",
"target_lang": "zh"
}
{
"alternatives": ["你好世界", "世界你好"],
"code": 200,
"data": "你好世界"
}
You can use JSONP to request the api, just add callback
param to the url, like this:
- method:
POST
- url:
/translate?callback=tr
(In order to avoid abusing the public API, the vercel version of the API is not supported for jsonp requests.) - params:
- engine:
google
ordeepl
- engine:
- body application/json:
{
"text": "Hello world",
"source_lang": "en",
"target_lang": "zh"
}
tr({
alternatives: ["你好世界", "世界你好"],
code: 200,
data: "你好世界",
});
Always used to translate RSS feed:
- Add prefix
https://translate-server-five.vercel.app/api/rss?url=
to the original rss feed url. e.g.http://export.arxiv.org/rss/cs.DC
->https://translate-server-five.vercel.app/api/rss?url=http://export.arxiv.org/rss/cs.DC
- Add
&engine=deepl
or&engine=google
to the end of the url. The default engine is google. if you want to specify the engine, you should run your own instance of the server instead of using the vercel one, like this:http://127.0.0.1:1188/rss?url=http://export.arxiv.org/rss/cs.DC&engine=deepl
// TODO
Shevon Kwan © translate-server Contributors