A free API interface for Chinese and English text translation

1. Text translation API interface

A free Chinese-English text translation interface

2. Usage steps

1. Interface

Important note: It is recommended to use https protocol. When https protocol cannot be used, try to use http protocol.
Request method: POST

https://luckycola.com.cn/tools/fanyi

2. Request parameters

serial number parameter Is it necessary illustrate
1 ColaKey yes The only verification ColaKey can be obtained from the official website ( http(s): //luckycola.com.cn )
2 text yes The text content that needs to be translated (Chinese or English text)
3 fromlang yes The text language type that needs to be translated, the value is: ZH (English) or EN (English)
4 help yes The result language type of the text that needs to be translated, the value is: ZH (English) or EN (English)

Note!!!: If you don’t have Colakey yet, please go to the official website to get it first.
Official website address: http(s): //luckycola.com.cn/

3. Cases and demos

1. Request parameter return example

{
    
    
	// 需要被翻译的文本
    "text": "索着生活的秘密。花儿一样的年纪,带着对未来的期许,我们喜欢在雨后的长亭或走道静静站立,闭上眼睛感受淡淡的泥土芬芳,风似调皮的孩子带着水汽扑面而来,轻轻扯动那秀丽的长发。一碧如洗的天空,",
    // 唯一key官网个人中心获取
    "ColaKey": "c******5",
    // 需要被翻译的文本语言类型,ZH表示中文,EN表示英文
    "fromlang": "ZH",
    // 翻译出的结果文本语言类型,ZH表示中文,EN表示英文
    "tolang": "EN",
}

2. Response return example

{
    
    
	// 请求成功code
	"code": 0,
	// 请求成功提示
	"msg": "翻译成功",
	"data": {
    
    
		// 被翻译的原文本
		"text": "索着生活的秘密。花儿一样的年纪,带着对未来的期许,我们喜欢在雨后的长亭或走道静静站立,闭上眼睛感受淡淡的泥土芬芳,风似调皮的孩子带着水汽扑面而来,轻轻扯动那秀丽的长发。一碧如洗的天空,",
		// 翻译的内容结果
		"dst": "Asking for the secrets of life. At the age of flowers, with expectations for the future, we like to stand quietly in the long pavilion or aisle after the rain, close our eyes and feel the faint fragrance of earth, and the wind is like a naughty child with water vapor rushing to the face, gently pulling the beautiful long hair. A clear sky,"
	}
}

Guess you like

Origin blog.csdn.net/qq_48896417/article/details/132768497