W
W
web_dev2017-06-23 09:08:30
Google
web_dev, 2017-06-23 09:08:30

Expand google translate query to get examples?

Hello,
I'm trying to use "google translate api" a little, as we all know it's not free since 2011. But there is a url that works. In this article. https://ctrlq.org/code/19909-google-translate-api
So - this url returns a very small object that contains only one word.

https://translate.googleapis.com/translate_a/single?client=gtx&sl=en&tl=ru&dt=t&q=mother

If we look at the requests that google translate sends when translating text, we will get something like this url. In which there is much more information, examples, and so on ...
https://translate.google.com/translate_a/single?client=t&sl=en&tl=ru&hl=ru&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&pc=1&ssel=0&tsel=0&kc=2&tk=542002.924823&q=mother

Actually a question.
1. Is there information somewhere where you can read about clients, parameters? How to correct the request so that examples are also included in the response? There are examples of keys here, but they are not very suitable https://stackoverflow.com/questions/26714426/what-...
2. Or if you consider the option from Bing - https://azure.microsoft.com/en-us/ pricing/details/... it's a little unclear how he counts characters. It summarizes only characters which are in request?
3. Alternative?
Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
ScriptedEngineer, 2020-08-22
@ScriptedEngineer

Google Translate extension query string:
https://translate.googleapis.com/translate_a/singl...
Where:
client: gtx - Google Translate extension; t - Google Translate site;
sl - source language (from which language we are translating): auto (auto-detection); en (English); full list here ;
tl - translation language (into which language we translate): ru (Russian);
hl - interface language: en (English) by default;
dt - what is returned when responding (may be included multiple times):

  • t - the translation of the original text is returned;
  • at - returns an alternative translation;
  • rm - returns transliteration;
  • bd - the back translation is returned.

ie - input encoding: UTF-8 by default;
oe - output encoding: UTF-8 by default;
q - source-text.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question