You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
KaKi87 db89d1a291 Bump to v1.0.8 - fix npm readme (future changelog) 11 months ago
.gitignore Initial commit 1 year ago Bump to v1.0.8 - fix npm readme (future changelog) 11 months ago
index.js Fixed translation complete detection (again !) 11 months ago
package.json Bump to v1.0.8 - fix npm readme (future changelog) 11 months ago
yarn.lock Added getSupportedLanguages method 11 months ago


Scrape data from DeepL translator without applying for the paid authenticated API, using Puppeteer, Chrome browser’s headless API.

Getting started


  • NodeJS
  • NPM
  • Yarn


From npm

yarn add deepl-scraper


npm i deepl-scraper


const translate = require('deepl-scraper').translate;

translate(sentence, source, target, quit).then(console.log).catch(console.error);


  • sentence string - Word/sentence to be translated
  • source string (optional) - Word/sentence original language

    Default : auto
  • target string - Language for word/sentence to be translated
  • quit boolean (optional) - Quit the browser emulator after this translation

    Until the browser is active, it will keep the script running

Supported languages

The module doesn’t store languages and will always support DeepL’s languages list without required update.

Language format is 2 letters.

They can be found in DeepL’s HTML :

<div class="lmt__language_select__menu">
	<button dl-value="auto">Any language (detect)</button>
	<button dl-value="EN">English</button>
	<button dl-value="DE">German</button>
	<button dl-value="FR">French</button>
	<button dl-value="ES">Spanish</button>
	<button dl-value="PT">Portuguese</button>
	<button dl-value="IT">Italian</button>
	<button dl-value="NL">Dutch</button>
	<button dl-value="PL">Polish</button>
	<button dl-value="RU">Russian</button>

However, lowercase is supported in the module.

Get an array of supported languages using the following code :

const DeepL = require('deepl-scraper');

Error handling



Translate from defined language

translate('hello', 'en', 'fr').then(console.log);
	"source": {
		"lang": "en",
		"sentence": "hello"
	"target": {
		"lang": "fr",
		"sentences": [
				"bonjour, bonjour",
				"bonjour, bonjour.",
				"bonjour, salut"
		"translation": "bonjour"

Translate from auto-detected language

(a single word’s language is usually more difficult to detect)

translate('hello', null, 'fr').then(console.log);
	"source": {
		"lang": "en",
		"confident": false,
		"sentence": "hello"
	"target": {
		"lang": "fr",
		"sentences": [
			"bonjour, bonjour",
			"bonjour, bonjour.",
			"bonjour, salut"
		"translation": "bonjour"

(a sentence’s language is usually more efficient)

translate('hey, what\'s up ?', null, 'fr').then(console.log);
	"source": {
		"lang": "en",
		"confident": true,
		"sentence": "hey, what's up ?"
	"target": {
		"lang": "fr",
		"sentences": [
			"Hé, qu'est-ce qu'il y a ?",
			"Hé, qu'est-ce que c'est que ça ?",
			"Hé, qu'est-ce que tu as ?",
			"Hé, quoi de neuf ?",
			"hey, quoi de neuf ?",
			"Hey, quoi de neuf ?"
		"translation": "Hé, quoi de neuf ?"

Planned features

  • Get word-by-word definitions, quotes and synonyms


Why using Puppeteer instead of HTTP requests ?

Fucking rate limit error always showing up, whatever you do.


  • 1.0.0 (2019-05-06) • Initial release
  • 1.0.x (2019-05-11)

    • Added examples title in
    • Fixed Promise never resolving while alt sentences not available

    • Retry when browser error

    • Fixed retry
    • Fixed changelog version typo

    • Close page after translation
  • 1.0.5 (2019-06-27)
    • Added getSupportedLanguages method
    • Improved translation complete detection
    • Fixed cannot launch new browser when previously closed
    • Fixed incompatibility with multi-requests translation (#1)
  • 1.0.6 (2019-07-05)
    • Fixed auto/non-auto parameter
    • Fixed translation complete detection (again)
  • 1.0.7 (2019-07-05)
    • Fixed translation complete detection (again !)