Google 翻译免费 API
我一直调用 google 收费的 api,但是 100 万字 需要 20 美元,如果是万字长文的话,每调用一次接近 3 块钱,自从我的翻译上线来,免费额度(50 万字)已经用完了,有一个用户一天就用了差不多 20 万字和额度,今天看到有人调用 google 翻译的免费 api,大概看了一下,确实能用,不过用起来不是特别方便,好像是基于句子的,不能一次把整个文档给他,但是我想稍加修改,也够用了。
调用方式一
直接在浏览器请求就可以,返回的是一个 json ,格式如下。
1 |
https://clients5.google.com/translate_a/t?client=dict-chrome-ex&sl=auto&tl=zh-cn&q=To help, we’ve got all the best trying-to-conceive tips right here. Read on for the scoop on everything you need to know about how to get pregnant, from your odds of conceiving to what you can do to have a healthier pregnancy right from the start. Happy baby-making! |