google-translate-open-api就这样诞生了。 Usage 单段文本 importtranslatefrom'google-translate-open-api';constresult =awaittranslate(`I'm fine.`, {tld:"cn",to:"zh-CN", });constdata = result.data[0];// 我很好。 多段文本 importtranslatefrom'google-translate-open-api';constresult =awaittransl...
https://translation.googleapis.com/language/translate/v2?target=zh-CN&key=GOOGLE_KEY&q=test //GOOGLE_KEY 购买后获得 返回: { "data": { "translations": [ { "translatedText":"测试", "detectedSourceLanguage":"en" } ] } } 解析后获得翻译后的文本:translatedText 2.如何...
class Google_API_translator { public $url = "http://translate.google.com/translate_t"; public $text = ""; public $out = ""; public $ip = ''; function setText($text){ $this->text = $text; } function translate($from='auto',$to='zh-CN'){ $this->out = ""; $gphtml = $...
网络随身翻译机;在线翻译类;翻译函式库 网络释义
选择“API密钥”。你可以选择创建一个新的API密钥或使用现有的API密钥。如果你选择创建新的API密钥,则...
res=requests.get('https://translate.google.cn/translate_a/single?client=t&sl=auto&tl=zh-CN&hl=zh-CN&dt=at&dt=bd&dt=ex&dt=ld&dt=md&dt=qca&dt=rw&dt=rm&dt=ss&dt=t&ie=UTF-8&oe=UTF-8&otf=1&ssel=0&tsel=0&kc=7&tk=272537.149261&q=oh%20shit')print(res.text) ...
$translate = new TranslateClient([ 'key' => '这里写谷歌后台的APIKEY' ]); $result = $translate->translate('Get the languages supported for translation specifically for your target language.', [ 'source' => 'en',//默认EN,不设置自动检测原始语言 'target' => 'zh-CN' ]); echo $result...
https://www.googleapis.com/language/translate/v2?{parameters} 翻译请求的三个参数: 1)API key:需要向谷歌付费后,会给你一个key; 2)Target language:即你需要翻译的目标语言; 3)Source text string:需要翻译的文本(需要少于2k)。 2.下面是给不同的参数的一些例子,可以根据自己的需要来对该url进行传参: ...
google-translate-api AfreeandunlimitedAPI for Google Translate 💵🚫 Features Auto language detection Spelling correction Language correction Fast and reliable – it uses the same servers thattranslate.google.comuses Install npm i --save google-translate-api-jp...
type传入参数:google to 翻译语言:en(英语) keywords 翻译内容:地政总署测绘处 import requests url = "http://api.tanshuapi.com/api/translate/v1/index?key=&type=google&from=&to=en&keywords=地政总署测绘处" payload={} headers = { 'User-Agent': 'Apifox' ...