A package that generates the necessary token to use the Google Translate API for free 💵🚫
translate.google.com uses a token to authorize the requests. If you are not Google, you do not have this token and will have to pay $20 per 1 million characters of text. 457 This package is the result of reverse engineering on the obfuscated and minified code used by Google to generate such token.
The token is based on a seed which is updated once per hour and on the text that will be translated. Both are combined – by some strange math – in order to generate a final token (e.g. 820594.703830
) which is used by the API to validade the request.
npm install --save google-translate-token-plus
// here net is not required, can be 'cn', 'com', default is 'com', but 'cn' would be friendly to CHINA
const net = 'cn';
const token = require('google-translate-token-plus')(net);
token.get('Hello').then(console.log);
//=> { name: 'tk', value: '159402.284291' }
google-translate-api-plus
– A free and unlimited API for Google Translate 💵🚫