# google-translate-token

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

Latest version **1.0.0** (published 2016-07-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install google-translate-token
pnpm add google-translate-token
yarn add google-translate-token
bun add google-translate-token
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2016-07-01 |
| First published | 2016-07-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Matheus Fernandes |
| Maintainers | matheuss |
| Keywords | translate, translator, google, translate, api, free, language, tk, token |

## Links

- npm: https://www.npmjs.com/package/google-translate-token
- Repository: https://github.com/matheuss/google-translate-tk
- Homepage: https://github.com/matheuss/google-translate-tk#readme
- Issues: https://github.com/matheuss/google-translate-tk/issues
- npm.io page: https://npm.io/package/google-translate-token

## Dependencies (2)

- [got](https://npm.io/package/got.md) ^6.3.0
- [configstore](https://npm.io/package/configstore.md) ^2.0.0

## Alternatives

- [ext-list](https://npm.io/package/ext-list.md) — 6.3M weekly downloads
- [@lexical/selection](https://npm.io/package/@lexical/selection.md) — 3.8M weekly downloads
- [@lexical/text](https://npm.io/package/@lexical/text.md) — 3.6M weekly downloads
- [@lexical/clipboard](https://npm.io/package/@lexical/clipboard.md) — 3.0M weekly downloads
- [@tiptap/extension-mention](https://npm.io/package/@tiptap/extension-mention.md) — 3.0M weekly downloads

## Recent versions

- 1.0.0 (latest) — 2016-07-01

## README

# google-translate-token [![Build Status](https://travis-ci.org/matheuss/google-translate-token.svg?branch=master)](https://travis-ci.org/matheuss/google-translate-token) [![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/sindresorhus/xo)
A package that generates the necessary token to use the [**Google Translate API for free** :dollar::no_entry_sign:](https://github.com/matheuss/google-translate-api)

## Why

[translate.google.com](https://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](https://cloud.google.com/translate/v2/pricing).

This package is the [result](https://github.com/matheuss/google-translate-token/blob/master/index.js#L12-110) of reverse engineering on the [obfuscated and minified code](https://translate.google.com/translate/releases/twsfe_w_20160620_RC00/r/js/desktop_module_main.js) 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 validade the request. 


## Install

```
npm install --save google-translate-token
```

## Usage

``` js
const token = require('google-translate-token');

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

## Related

- [`google-translate-api`](https://github.com/matheuss/google-translate-api) – A **free** and **unlimited** API for Google Translate :dollar::no_entry_sign:

---
_Source: https://npm.io/package/google-translate-token · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
