Skip to content

A package that generates the necessary token to use the Google Translate API for free 💵🚫

License

Notifications You must be signed in to change notification settings

vitalets/google-translate-token

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

google-translate-token

XO code style

A package that generates the necessary token to use the Google Translate API for free 💵🚫

Why

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.

This package is the result of reverse engineering on the obfuscated and minified code used by Google to generate such token.

How it works

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 validate the request.

Install

npm install @vitalets/google-translate-token

Usage

const token = require('@vitalets/google-translate-token');

token.get('Hello').then(console.log);
//=> { name: 'tk', value: '159402.284291' }

Related

License

MIT © Matheus Fernandes, forked and maintained by Vitaliy Potapov.

About

A package that generates the necessary token to use the Google Translate API for free 💵🚫

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Languages

  • JavaScript 100.0%