A simple web API to translate. There is power by Google Translate.
Get Request:
/?w=word[&f=auto&t=zh]
Response:
{
"word": "word",
"text": "字",
"candidate": [
"字",
"词",
"单词",
"话",
"言",
"言辞",
"笔墨",
"约言",
"字",
"词",
"单词"
]
}
key | description |
---|---|
w | The word want to translate |
f | The source language. Default is recognized automatically. (Optional) |
t | The target language. Default is Chinese. (Optional) |
Note: If there is no target language, the target language is Chinese. When there is about 50% Chinese in source language, the target language will be changed to English.
key | description |
---|---|
word | The word want to translate |
text | The most match result |
candidate | Other translate result |
The values of f
and t
of the parameters shall be the language code. You can check it in here (ISO 639-1).
GET /?w=word&t=ja
{
"word": "word",
"text": "ワード",
"candidate": [
"ワード",
"単語",
"語",
"言葉",
"語句",
"伝言",
"一言半句",
"口舌"
]
}
GET /?w=中文&f=zh&t=ko
{
"word": "中文",
"text": "중국어",
"candidate": [
"중국어"
]
}
GET /?w=中文
{
"word": "中文",
"text": "Chinese",
"candidate": [
"Chinese"
]
}