我听说翻译API是收费的,但是到底是什么阻止我们免费使用谷歌翻译服务here呢?否则,免费服务的局限性是什么?
发布于 2015-11-19 19:38:20
根据下面的链接,没有什么可以阻止你。
https://translate.googleapis.com/translate_a/single?client=gtx&sl=en&tl=es&dt=t&q=Hello
将你的请求content-type设置为application/json,它会修复奇怪的格式,我在google网站上搜索了一段时间后发现了uri模式。
我不推荐用它来翻译圣经,但这周我已经做了大约10000字的翻译,没有任何问题。
如果有人找到另一个有效的client值,我很想知道。
发布于 2011-11-11 04:27:34
除了可访问性之外,没有什么能阻止你使用谷歌翻译网站。与通过框架将Google Translate嵌入您的站点相比,公共API为您提供了更紧密的集成。
发布于 2018-12-06 19:13:50
$translatedText = "प्रशांत कुमार सिंह";
$detectedSourceLanguage = "en";
$url ='https://www.google.com/inputtools/request?text='.urlencode($translatedText).'&ime=transliteration_hi_'.urlencode($detectedSourceLanguage);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_PROXYPORT,3128);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,0);
$response = curl_exec($ch);
$output = json_decode($response);
$resultText = '';
if($output[0] == 'SUCCESS'){
if(isset($output[1])){
if(isset($output[1][0])){
if(isset($output[1][0][1])){
$resultText = $output[1][0][1][0];
}
}
}
}
echo $resultText;https://stackoverflow.com/questions/8085743
复制相似问题