有道翻译有官方接口-非官方

有道官方接口

官方接口:https://openapi.youdao.com/openapi

可查询英语单词注释、单词发音、网络释义(不一定存在),可获取在线发音地址。

具体使用,可参考 C# 有道API翻译 查询单词详细信息

有道非官方接口

何谓非官方接口,即不对外发布、小范围使用的接口。这种一般人都不知道的接口,官方不能保证数据的准确性

API接口:http://dict.youdao.com/jsonapi

拼接参数:

  • jsonversion:json 版本,目前已知取值12,返回结果大同小异。本文档采用2
  • client:客户端类型,取值mobile
  • q:查询的单词
  • dicts:需要查询哪些字典。目前已知 {"count":99,"dicts":[["ec","ce","newcj","newjc","kc","ck","fc","cf","multle","jtj","pic_dict","tc","ct","typos","special","tcb","baike","lang","simple","wordform","exam_dict","ctc","web_search","auth_sents_part","ec21","phrs","input","wikipedia_digest","ee","collins","ugc","media_sents_part","syno","rel_word","longman","ce_new","le","newcj_sents","blng_sents_part","hh"],["ugc"],["longman"],["newjc"],["newcj"],["web_trans"],["fanyi"]]}。可为空,为空则返回全部字段
  • keyfrom:mdict. + 版本号 + .手机平台。可为空
  • model:手机型号。可为空
  • mid:平台版本。可为空
  • imei:未知。可为空
  • vendor:应用下载平台。可为空
  • screen:屏幕宽高。可为空
  • ssid:用户名。可为空
  • network:网络状态,取值 wifi4G5G 等
  • abtest:ab测试。可为空
  • xmlVersion:默认使用5.1

案例:查询account单词

http://dict.youdao.com/jsonapi?jsonversion=2&client=mobile&q=account&dicts=%7B%22count%22%3A99%2C%22dicts%22%3A%5B%5B%22ec%22%2C%22ce%22%2C%22newcj%22%2C%22newjc%22%2C%22kc%22%2C%22ck%22%2C%22fc%22%2C%22cf%22%2C%22multle%22%2C%22jtj%22%2C%22pic_dict%22%2C%22tc%22%2C%22ct%22%2C%22typos%22%2C%22special%22%2C%22tcb%22%2C%22baike%22%2C%22lang%22%2C%22simple%22%2C%22wordform%22%2C%22exam_dict%22%2C%22ctc%22%2C%22web_search%22%2C%22auth_sents_part%22%2C%22ec21%22%2C%22phrs%22%2C%22input%22%2C%22wikipedia_digest%22%2C%22ee%22%2C%22collins%22%2C%22ugc%22%2C%22media_sents_part%22%2C%22syno%22%2C%22rel_word%22%2C%22longman%22%2C%22ce_new%22%2C%22le%22%2C%22newcj_sents%22%2C%22blng_sents_part%22%2C%22hh%22%5D%2C%5B%22ugc%22%5D%2C%5B%22longman%22%5D%2C%5B%22newjc%22%5D%2C%5B%22newcj%22%5D%2C%5B%22web_trans%22%5D%2C%5B%22fanyi%22%5D%5D%7D&keyfrom=mdict.7.2.0.android&model=honor&mid=5.6.1&imei=659135764921685&vendor=wandoujia&screen=1080x1800&ssid=superman&network=wifi&abtest=2&xmlVersion=5.1 

详细数据:

 以上节点中,代表的是字典关键字。我们来分析下其中关键的字典数据:

  • collins — 柯林斯英汉双解大辞典
  • ec — 英汉翻译字典(英汉释义)
  • ee — 英英翻译字典(英英释义
  • exam_dict — 考试专用字典(词汇词根+联想记忆法)
  • longman — 朗文当代高级英语辞典
  • phrs — 词组短语,如account单词对应的“current account”
  • rel_word — 同根词,如account单词对应的形容词“accountable”
  • syno — 近义词,单词每种释义对应的近义词列表
  • web_trans — 网络释义

 英语单词查询Demo

源代码请见Github: https://github.com/Kybs0/SearchWordByYoudao

Demo效果如下截图:

关键字:英语单词详细信息查询、有道API详细接口

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注